/* ============================================================
   AETHYX — Site Styles
   The team that never clocks out.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #080808;
  --surface-1: #0f0f0f;
  --surface-2: #161616;
  --surface-3: #1c1c1c;

  /* Accent */
  --gold: #c9a86a;
  --gold-bright: #d8ba80;
  --gold-deep: #8a7142;
  --gold-glow: rgba(201, 168, 106, 0.08);
  --gold-glow-mid: rgba(201, 168, 106, 0.18);
  --gold-glow-strong: rgba(201, 168, 106, 0.32);

  /* Type */
  --fg: #f2f2f0;
  --fg-secondary: #9a9a9a;
  --fg-muted: #555555;

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(201, 168, 106, 0.35);

  /* Signal */
  --danger: #c2554a;

  /* Type families */
  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-mono: "DM Mono", "JetBrains Mono", ui-monospace, "Menlo", monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 520ms;
  --dur-grand: 900ms;

  /* Layout */
  --container: 1100px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ------------------------------------------------------------
   Reset
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "ss01", "kern";
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: #000; }

/* Mouse cursor handled by custom cursor on desktop */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, input, select, textarea, label { cursor: none; }
}

/* ------------------------------------------------------------
   Typography primitives
   ------------------------------------------------------------ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.45em;
  color: var(--gold);
  margin: 0 0 28px;
  display: inline-block;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 14px;
  transform: translateY(-2px);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--fg);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.serif-italic { font-family: var(--font-display); font-style: italic; color: var(--gold); }

p { margin: 0 0 1em; color: var(--fg-secondary); }
p.lead { color: var(--fg); }

.mono { font-family: var(--font-mono); }
.text-secondary { color: var(--fg-secondary); }
.text-muted { color: var(--fg-muted); }
.text-gold { color: var(--gold); }

/* ------------------------------------------------------------
   Layout helpers
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
section { position: relative; }
.section-pad { padding-block: clamp(64px, 12vw, 120px); }

.divider-gold {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 24px auto;
  opacity: 0.6;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease-out);
  white-space: nowrap;
  position: relative;
}
.btn .arrow { transition: transform var(--dur) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-gold {
  background: var(--gold);
  color: #15110a;
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-bright);
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(201, 168, 106, 0.4),
    0 12px 32px rgba(201, 168, 106, 0.18),
    0 0 64px rgba(201, 168, 106, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-gold);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 24px rgba(201, 168, 106, 0.08);
  transform: translateY(-1px) scale(1.02);
}

.btn-lg { padding: 18px 32px; font-size: 15px; }

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease-out), backdrop-filter var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  border-bottom: 1px solid transparent;
  animation: navSlideDown 700ms var(--ease-out) both;
}
.nav.is-scrolled {
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}
.brand-word {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--fg);
  padding-left: 4px; /* compensate for tracking */
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-link {
  position: relative;
  font-size: 13px;
  color: var(--fg-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color var(--dur) var(--ease-out);
  padding: 6px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out);
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--fg); }
.nav-link.is-active::after { transform: scaleX(1); background: var(--gold); }
.nav-cta {
  padding: 8px 18px;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  transition: all var(--dur) var(--ease-out);
}
.nav-cta:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  box-shadow: 0 0 24px var(--gold-glow);
}

.nav-burger { display: none; }

@media (max-width: 720px) {
  .nav-links .nav-link { display: none; }
  .nav-cta { display: none; }
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px;
    padding: 6px;
  }
  .nav-burger span {
    display: block; width: 22px; height: 1px; background: var(--fg);
    transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
  }
  .nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-burger.is-open span:nth-child(2) { opacity: 0; }
  .nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

.mobile-menu {
  position: fixed; inset: 0;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(24px);
  z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
  color: var(--fg);
}
.mobile-menu a:hover { color: var(--gold); }

/* ------------------------------------------------------------
   Hero shared
   ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero--short { min-height: 60vh; }
.hero--mid { min-height: 50vh; }
.hero--smid { min-height: 45vh; }

.ember {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ember::before,
.ember::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: emberDrift 24s ease-in-out infinite alternate;
}
.ember::before {
  width: 700px; height: 700px;
  background: radial-gradient(closest-side, rgba(201, 168, 106, 0.12), rgba(201, 168, 106, 0.02), transparent 70%);
  left: -10%; top: 20%;
}
.ember::after {
  width: 900px; height: 900px;
  background: radial-gradient(closest-side, rgba(201, 168, 106, 0.10), rgba(201, 168, 106, 0.015), transparent 70%);
  right: -15%; bottom: -10%;
  animation-duration: 32s;
  animation-direction: alternate-reverse;
}
.ember .ember-core {
  position: absolute;
  width: 480px; height: 480px;
  left: 50%; top: 55%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(201, 168, 106, 0.16), rgba(201, 168, 106, 0.04) 40%, transparent 70%);
  filter: blur(60px);
  border-radius: 50%;
  animation: emberPulse 8s ease-in-out infinite;
  opacity: 0.8;
}
.ember--subtle::before,
.ember--subtle::after { opacity: 0.55; }
.ember--subtle .ember-core { opacity: 0.45; }

/* Grain overlay */
.grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.6'/></svg>");
  mix-blend-mode: overlay;
}

@keyframes emberDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(40px, -30px, 0) scale(1.1); }
  100% { transform: translate3d(-30px, 40px, 0) scale(0.95); }
}
@keyframes emberPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}
@keyframes navSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ------------------------------------------------------------
   Hero text (home)
   ------------------------------------------------------------ */
.hero-inner {
  position: relative;
  text-align: center;
  width: 100%;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 112px);
  font-weight: 400;
  line-height: 0.98;
  margin: 0 0 32px;
  letter-spacing: -0.02em;
}
.hero-title .line { display: block; }
.hero-title .line-2 {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-secondary);
}
.hero-ctas {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* hero ticker */
.ticker {
  position: absolute;
  bottom: 32px;
  left: 0; right: 0;
  overflow: hidden;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  padding-left: 48px;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex; align-items: center; gap: 48px;
}
.ticker-item::after {
  content: "✦";
  color: var(--gold-deep);
  font-size: 8px;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ------------------------------------------------------------
   Section title block
   ------------------------------------------------------------ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0 0 24px;
  max-width: 760px;
}
.section-title .italic { font-style: italic; color: var(--gold); }
.section-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-secondary);
  max-width: 600px;
  margin: 0 0 32px;
}

/* ------------------------------------------------------------
   Pill chip
   ------------------------------------------------------------ */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--fg-secondary);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: all var(--dur) var(--ease-out);
}
.chip::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--fg-muted);
  transition: background var(--dur) var(--ease-out);
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}
.chip:hover::before { background: var(--gold); }

/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
  position: relative;
}
.card-accent-left {
  border-left: none;
  position: relative;
}
.card-accent-left::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.7;
}

/* ------------------------------------------------------------
   Reveal animations
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }
.reveal[data-delay="6"] { transition-delay: 480ms; }

.scale-in {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.scale-in.is-in { opacity: 1; transform: scale(1); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer {
  position: relative;
  padding-top: 80px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border-gold);
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 24px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer ul a {
  color: var(--fg-secondary);
  font-size: 14px;
  transition: color var(--dur) var(--ease-out);
}
.footer ul a:hover { color: var(--fg); }
.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--fg);
  margin: 24px 0 16px;
  max-width: 280px;
  line-height: 1.3;
}
.footer-calyx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.footer-contact {
  font-size: 14px;
  color: var(--fg);
  margin-bottom: 20px;
}
.footer-contact a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

/* ------------------------------------------------------------
   Custom cursor
   ------------------------------------------------------------ */
.cursor, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  mix-blend-mode: difference;
}
.cursor {
  width: 8px; height: 8px;
  background: var(--gold);
  transform: translate(-50%, -50%);
  transition: width 240ms var(--ease-out), height 240ms var(--ease-out), background 240ms;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%);
  transition: width 240ms var(--ease-out), height 240ms var(--ease-out), border-color 240ms, opacity 240ms;
  opacity: 0.6;
}
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--gold-bright);
  opacity: 0.9;
}
.cursor.is-hover { width: 4px; height: 4px; }
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-ring { display: none; }
}

/* ------------------------------------------------------------
   Page transitions
   ------------------------------------------------------------ */
body.page-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out);
}
body { transition: opacity 600ms var(--ease-out); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .ember::before, .ember::after, .ember .ember-core { animation: none; }
}
