/* ===================================================
   Nexus Studio Finance — Clean Institutional Design
   Inspired by Anthropic's minimal aesthetic
   =================================================== */

:root {
  color-scheme: dark;

  /* Brand palette */
  --red: #e8000b;
  --red-soft: #c2000a;
  --red-glow: rgba(232, 0, 11, 0.15);
  --red-subtle: rgba(232, 0, 11, 0.06);

  /* Neutrals */
  --bg: #050505;
  --bg-elevated: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.025);
  --surface: #111111;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Text */
  --text-primary: #f0efed;
  --text-secondary: #9e9b97;
  --text-tertiary: #6b6966;

  /* Typography */
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing */
  --nav-height: 64px;
  --page-padding: clamp(20px, 4vw, 48px);
  --section-gap: clamp(64px, 10vh, 120px);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ───── Reset ───── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ───── Preloader ───── */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader.removed {
  display: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.preloader-logo {
  width: 72px;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
}

.preloader-bar {
  width: 120px;
  height: 1px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.preloader-bar-fill {
  width: 40%;
  height: 100%;
  background: var(--red);
  animation: preloader-slide 1.1s var(--ease) infinite;
}

/* ───── Ambient Canvas ───── */

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ───── Page Layout ───── */

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
}

/* ───── Navigation ───── */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-height);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(5, 5, 5, 0.78);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.2s var(--ease);
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-logo {
  width: 40px;
  height: auto;
  object-fit: contain;
}

.nav-wordmark {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.nav-wordmark-accent {
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  transition: border-color 0.3s var(--ease);
}

.nav-status:hover {
  border-color: var(--border-hover);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse 2.5s ease-in-out infinite;
}

.status-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ───── Hero ───── */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-gap) var(--page-padding);
}

.hero-inner {
  width: 100%;
  max-width: 680px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 6px 16px;
  border: 1px solid rgba(232, 0, 11, 0.22);
  border-radius: 100px;
  background: rgba(232, 0, 11, 0.06);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: eyebrow-breathe 3.4s var(--ease) infinite;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.hero-title-muted {
  color: var(--text-tertiary);
}

.hero-title-shine {
  background: linear-gradient(
    100deg,
    var(--text-primary) 0%,
    var(--text-primary) 38%,
    #ff5964 50%,
    var(--text-primary) 62%,
    var(--text-primary) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shine 5.5s var(--ease) infinite;
}

.hero-description {
  max-width: 520px;
  margin: 24px auto 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1vw + 0.8rem, 1.15rem);
  line-height: 1.65;
  font-weight: 400;
}

.hero-divider {
  width: 40px;
  height: 1px;
  margin: 40px auto;
  background: var(--border);
  position: relative;
}

.hero-divider::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--red-glow);
}

/* ───── Status Cards ───── */

.status-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.status-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
}

.status-card-separator {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.status-card-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.status-card-value {
  font-size: clamp(0.92rem, 1vw + 0.7rem, 1.08rem);
  font-weight: 600;
  color: var(--text-primary);
}

.status-card-value {
  transition: color 0.3s var(--ease);
}

.status-cards:hover {
  border-color: var(--border-hover);
}

/* ───── Access request ───── */

.access {
  margin-top: 40px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 50% 0%, var(--red-subtle), transparent 60%),
    var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.access-title {
  font-size: clamp(1.1rem, 1.4vw + 0.8rem, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.access-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

.access-form {
  margin-top: 22px;
}

.access-row {
  display: flex;
  gap: 10px;
}

.access-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.access-input::placeholder {
  color: var(--text-tertiary);
}

.access-input:focus {
  outline: none;
  border-color: rgba(232, 0, 11, 0.55);
  box-shadow: 0 0 0 3px var(--red-subtle);
}

.access-btn {
  flex-shrink: 0;
  padding: 13px 24px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.15s var(--ease),
    box-shadow 0.25s var(--ease);
}

.access-btn:hover {
  background: var(--red-soft);
  box-shadow: 0 8px 24px var(--red-glow);
  transform: translateY(-1px);
}

.access-btn:active {
  transform: translateY(0);
}

.access-note {
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.access-note.is-success {
  color: var(--red);
  font-weight: 600;
}

/* ───── Footer ───── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0 var(--page-padding);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.footer-brand {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.footer-separator {
  opacity: 0.4;
}

/* ───── Animations ───── */

@keyframes preloader-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(350%); }
}

@keyframes title-shine {
  0%, 20% { background-position: 130% 0; }
  60%, 100% { background-position: -30% 0; }
}

@keyframes eyebrow-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 0, 11, 0); }
  50% { box-shadow: 0 0 22px 0 var(--red-subtle); }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px var(--red-glow);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 4px transparent;
  }
}

/* ───── Reveal animation on load ───── */

.hero-eyebrow,
.hero-title,
.hero-description,
.hero-divider,
.status-cards,
.access {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 0.7s var(--ease-out) forwards;
}

.hero-eyebrow { animation-delay: 0.3s; }
.hero-title { animation-delay: 0.42s; }
.hero-description { animation-delay: 0.54s; }
.hero-divider { animation-delay: 0.64s; }
.status-cards { animation-delay: 0.74s; }
.access { animation-delay: 0.84s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ───── Responsive: Tablet ───── */

@media (max-width: 768px) {
  .nav-wordmark-accent {
    display: none;
  }

  .hero-inner {
    max-width: 100%;
  }

  .status-cards {
    padding: 24px 20px;
  }

  .status-card {
    padding: 0 12px;
  }
}

/* ───── Responsive: Mobile ───── */

@media (max-width: 540px) {
  .nav-status .status-label {
    display: none;
  }

  .nav-status {
    padding: 6px;
    min-width: 28px;
    min-height: 28px;
    justify-content: center;
  }

  .hero {
    text-align: left;
  }

  .hero-inner {
    text-align: left;
  }

  .hero-eyebrow {
    align-self: flex-start;
  }

  .hero-description {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-divider {
    margin-left: 0;
    margin-right: auto;
  }

  .status-cards {
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: 12px;
  }

  .status-card {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 16px 20px;
  }

  .status-card-separator {
    width: 100%;
    height: 1px;
  }

  .access {
    padding: 24px 20px;
  }

  .access-row {
    flex-direction: column;
  }

  .access-btn {
    width: 100%;
  }
}

/* ───── Reduced motion ───── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
