/* Fonts loaded via <link> tags in each page's <head> for optimal LCP performance */

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

/* Universal safety net: no heading or large text can ever push past the screen edge */
h1, h2, h3 { max-width: 100%; overflow-wrap: break-word; }

:root {
  --ink:     #06070d;
  --ink2:    #0c0e1c;
  --cyan:    #00d4ff;
  --violet:  #9b6dff;
  --green:   #00e5a0;
  --amber:   #ff6b35;
  --white:   #ffffff;
  --muted:   rgba(255,255,255,0.65);
  --faint:   rgba(255,255,255,0.06);
  --rule:    rgba(255,255,255,0.06);
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--ink);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

/* ── CANVAS ── */
#field {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.wrap { position: relative; z-index: 1; overflow-x: clip; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 60px;
  background: rgba(6,7,13,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--rule);
  transition: padding 0.3s ease;
}

.logo {
  text-decoration: none;
  flex: 1 1 0;
  display: block;
  line-height: 1;
}
.logo-img {
  display: block;
  height: 52px;
  width: auto;
}
.logo-name { display: block; }
.logo-sub  { display: block; }
.logo-dot  { color: var(--cyan); }

.nav-links {
  display: flex; list-style: none; gap: 2.5rem;
  flex: 0 1 auto;
  justify-content: center;
}
nav::after {
  content: '';
  flex: 1 1 0;
}
.nav-links a {
  font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute;
  bottom: -3px; left: 0; width: 0; height: 1px;
  background: var(--cyan); transition: width 0.3s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--white); }
.nav-links a.active::after { width: 100%; }

.nav-badge {
  font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,212,255,0.45);
  border: 1px solid rgba(0,212,255,0.14);
  padding: 5px 12px; border-radius: 2px;
}

/* ── RULES ── */
.h-rule {
  height: 1px; margin: 0 60px;
  background: linear-gradient(90deg, transparent, var(--rule) 20%, var(--rule) 80%, transparent);
}
.h-rule-full {
  height: 1px;
  background: var(--rule);
}

/* ── SECTION BASE ── */
section { position: relative; z-index: 1; }

.eyebrow {
  font-size: 0.68rem; font-weight: 300;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 18px;
}
.eyebrow.violet { color: var(--violet); }
.eyebrow.green  { color: var(--green); }
.eyebrow.amber  { color: var(--amber); }

h2.section-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08; letter-spacing: -0.025em;
  margin-bottom: 20px; color: var(--white);
}

.section-body {
  font-size: 1rem; line-height: 1.9;
  color: rgba(255,255,255,0.65); font-weight: 300;
  max-width: 520px;
}

/* ── BUTTONS ── */
.btn {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 14px 36px; border-radius: 2px;
  text-decoration: none; display: inline-block;
  transition: all 0.25s ease; cursor: pointer;
  border: 1px solid;
}
.btn-fill {
  background: var(--cyan); color: var(--ink);
  border-color: var(--cyan);
}
.btn-fill:hover { background: transparent; color: var(--cyan); }
.btn-fill.violet { background: var(--violet); border-color: var(--violet); color: var(--ink); }
.btn-fill.violet:hover { background: transparent; color: var(--violet); }
.btn-fill.green  { background: var(--green); border-color: var(--green); color: var(--ink); }
.btn-fill.green:hover  { background: transparent; color: var(--green); }
.btn-fill.amber  { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-fill.amber:hover  { background: transparent; color: var(--amber); }
.btn-outline {
  background: transparent; color: var(--muted);
  border-color: rgba(255,255,255,0.14);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.38); color: var(--white); }

/* ── REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── HERO (shared) ── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 120px 40px 100px;
  position: relative;
}
.hero-kicker {
  font-size: 0.68rem; font-weight: 300;
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 40px;
  opacity: 0; animation: rise 1s 0.2s cubic-bezier(.16,1,.3,1) forwards;
}
.hero-kicker.violet { color: var(--violet); }
.hero-kicker.green  { color: var(--green); }
.hero-kicker.amber  { color: var(--amber); }

.hero-h {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(4.5rem, 13vw, 10rem);
  line-height: 0.9; letter-spacing: -0.02em;
  margin-bottom: 36px;
  max-width: 100%;
  white-space: nowrap;
  opacity: 0; animation: rise 1s 0.38s cubic-bezier(.16,1,.3,1) forwards;
}
.hero-h .solid, .hero-h .stroke,
.hero-h .accent-cyan, .hero-h .accent-violet,
.hero-h .accent-green, .hero-h .accent-amber { white-space: nowrap; }
.hero-h .solid  { color: var(--white); }
.hero-h .stroke { -webkit-text-stroke: 1.5px rgba(255,255,255,0.2); color: transparent; }
.hero-h .accent-cyan   { color: var(--cyan); }
.hero-h .accent-violet { color: var(--violet); }
.hero-h .accent-green  { color: var(--green); }
.hero-h .accent-amber  { color: var(--amber); }

.hero-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem); font-weight: 300;
  font-style: italic; line-height: 1.75;
  color: rgba(255,255,255,0.65);
  margin-bottom: 52px;
  opacity: 0; animation: rise 1s 0.52s cubic-bezier(.16,1,.3,1) forwards;
}

.hero-cta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  opacity: 0; animation: rise 1s 0.66s cubic-bezier(.16,1,.3,1) forwards;
}

.scroll-indicator {
  position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; animation: rise 1s 1.1s cubic-bezier(.16,1,.3,1) forwards;
}
.scroll-indicator span {
  font-size: 0.58rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--muted);
}
.scroll-tick {
  width: 1px; height: 50px;
  background: linear-gradient(180deg, rgba(0,212,255,0.6), transparent);
  animation: tick 2.2s ease-in-out infinite;
}

/* ── FOOTER ── */
footer {
  padding: 36px 60px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--rule);
  position: relative; z-index: 1;
}
.foot-left .logo-svg { height: 36px; }
.foot-left .logo-img { height: 36px; }
.foot-copy {
  font-size: 0.7rem; font-weight: 300;
  color: rgba(255,255,255,0.18); margin-top: 7px; letter-spacing: 0.04em;
}
.foot-right {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.66rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.2);
}
.foot-nav {
  display: flex; gap: 1.8rem; list-style: none; margin-bottom: 8px;
}
.foot-nav a {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.25); text-decoration: none;
  transition: color 0.2s;
}
.foot-nav a:hover { color: var(--muted); }

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* ── BACK LINK ── */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s; margin-bottom: 32px;
}
.back-link::before { content: '←'; font-size: 0.8rem; }
.back-link:hover { color: var(--white); }

/* ── PAGE TRANSITION ── */
.page-enter {
  animation: page-in 0.6s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── KEYFRAMES ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tick {
  0%   { transform: scaleY(0); transform-origin: top; }
  49%  { transform: scaleY(1); transform-origin: top; }
  50%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.35); }
}

/* ── RESPONSIVE ── */
/* ── MOBILE NAV TOGGLE (hidden on desktop) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent; border: none;
  cursor: pointer; padding: 8px;
  z-index: 120;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--white); border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  nav { padding: 18px 20px; justify-content: flex-start; }
  nav::after { display: none; }
  .logo { flex: 0 0 auto; margin-right: auto; }
  .logo-svg { height: 40px; }
  .logo-img { height: 40px; }
  .nav-toggle { display: flex; flex: 0 0 auto; margin-left: auto; }

  /* Decorative scroll hint can collide with CTAs on taller mobile heroes — hide it */
  .scroll-indicator { display: none; }

  /* Slide-in mobile menu — compact, hugs the words */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0; right: 0;
    height: 100vh; width: 70vw; max-width: 280px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    padding: 80px 28px;
    margin: 0;
    background: #06070d;
    box-shadow: -20px 0 60px rgba(0,0,0,0.7);
    border-left: 1px solid rgba(255,255,255,0.08);
    transform: translateX(105%);
    transition: transform 0.34s cubic-bezier(.16,1,.3,1), visibility 0s linear 0.34s;
    z-index: 110;
    visibility: hidden;
    will-change: transform;
  }
  .nav-links.open { transform: translateX(0); visibility: visible; transition: transform 0.34s cubic-bezier(.16,1,.3,1); }
  .nav-links::after { display: none; }
  .nav-links li { width: 100%; list-style: none; }
  .nav-links a {
    display: block;
    font-size: 0.82rem;
    padding: 13px 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.82);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
  }
  body.nav-open { overflow: hidden; }

  /* Tappable dim backdrop — sits BELOW the nav stack so menu links stay tappable */
  .nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 90;
  }
  .nav-backdrop.show { opacity: 1; visibility: visible; }

  .h-rule { margin: 0 24px; }
  footer { padding: 32px 24px; flex-direction: column; gap: 20px; text-align: center; }
  .foot-nav { justify-content: center; flex-wrap: wrap; }
}
/* Backdrop hidden on desktop */
.nav-backdrop { display: none; }
@media (max-width: 900px) { .nav-backdrop { display: block; } }

/* ── PHONE BREAKPOINT ── */
@media (max-width: 480px) {
  nav { padding: 16px 20px; }
  .logo-svg { height: 34px; }
  .logo-img { height: 34px; }

  .hero { min-height: 92vh; padding: 0 24px; }
  .hero-kicker { font-size: 0.62rem; letter-spacing: 0.18em; margin-bottom: 28px; }
  .hero-h {
    font-size: clamp(2.2rem, 13vw, 3.9rem);
    margin-bottom: 34px;
    letter-spacing: -0.035em;
    max-width: 100%;
    white-space: nowrap;
    hyphens: none;
  }
  .hero-sub {
    font-size: 1.05rem; line-height: 1.85;
    max-width: 340px; margin-left: auto; margin-right: auto;
    margin-bottom: 40px;
  }
  .section-title { font-size: clamp(1.7rem, 8vw, 2.3rem); line-height: 1.15; }
  .section-body { font-size: 0.96rem; line-height: 1.8; }
  .h-rule { margin: 0 18px; }

  /* Refined buttons — not full-width slabs */
  .btn { font-size: 0.7rem; padding: 15px 28px; letter-spacing: 0.14em; }
  .hero-cta {
    flex-direction: column;
    gap: 14px;
    align-items: center;
    width: 100%;
  }
  .hero-cta .btn {
    width: auto;
    min-width: 220px;
    text-align: center;
  }

  /* Section padding rhythm — generous but not wasteful */
  .proj-section, section { padding-left: 24px; padding-right: 24px; }
}
