/* =============================================================================
   Afterhours Works: built after hours.
   Sibling to Flexin: same palette, same hand. Dark-mode native. Zero build.
   Spacing rides an 8-based scale: 8 · 16 · 24 · 32 · 48 · 64 · 96 · 128.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Core surface: inherited verbatim from Flexin so the brands read as kin. */
  --bg: #000000;
  --fg: #f4f4f5;
  --muted: #8a8a92;
  --faint: #56565d;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --card: rgba(255, 255, 255, 0.025);
  --field: rgba(255, 255, 255, 0.04);

  /* The glow trio. Blue → violet carries the brand; mint means alive / live. */
  --glow-a: #5b8cff; /* electric blue  */
  --glow-b: #b14bff; /* violet         */
  --glow-c: #2ce6a8; /* mint: gradients only */
  --live: #4f9b78;   /* desaturated green: quiet "live/active" dot */

  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@layer base {
  * { box-sizing: border-box; margin: 0; padding: 0; }
}

html {
  overflow-x: hidden;
  max-width: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.4;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Top-down vignette to seat the content and deepen the black at the edges. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}

::selection { background: var(--glow-a); color: #fff; }

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

/* ---------- Ambient field: blurred orbs ------------------------------------ */
.field { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.28;
  will-change: transform;
}
.orb--a { width: 46vmax; height: 46vmax; top: -20vmax; left: -14vmax; background: var(--glow-a); animation: drift1 26s ease-in-out infinite; }
.orb--b { width: 36vmax; height: 36vmax; bottom: -16vmax; right: -10vmax; background: var(--glow-b); opacity: 0.22; animation: drift2 30s ease-in-out infinite; }
.orb--c { width: 18vmax; height: 18vmax; top: 40%; right: 24%; background: var(--glow-c); opacity: 0.1; animation: drift3 34s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vmax,4vmax) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-5vmax,-3vmax) scale(1.12); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-4vmax,5vmax) scale(0.92); } }



/* ---------- Layout -------------------------------------------------------- */
.wrap { position: relative; z-index: 2; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding-block: clamp(72px, 13vh, 140px); }
.section-line { border-top: 1px solid var(--line-soft); }

/* Section eyebrow: a mono "system label" with a bracketed index. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 32px;
}
.eyebrow .idx { color: var(--glow-a); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--line); }

/* ---------- Top bar (sticky) ---------------------------------------------- */
/* Plain inline header, like Flexin: transparent, not sticky, no divider. */
.topbar { position: relative; z-index: 20; }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: inline-flex; align-items: center; }
/* The "aftr" wordmark is the logo; no text beside it. */
.logo svg { width: 46px; height: 20px; color: var(--fg); display: block; }

/* Live status pill: a clock that proves it's after hours. */
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--muted);
}
.status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live); flex: 0 0 auto;
}
.status .clock { color: var(--fg); font-variant-numeric: tabular-nums; }
.status .label { color: var(--muted); }
@media (max-width: 560px) { .status .label { display: none; } }

/* ---------- Hero ---------------------------------------------------------- */
.hero {
  min-height: calc(100dvh - 64px);
  display: flex; flex-direction: column; justify-content: center;
  /* padding-block only: must NOT clobber .wrap's horizontal padding (24px),
     otherwise the hero content goes flush to the viewport edge on mobile. */
  padding-block: 56px 80px;
}
.hero-log {
  font-family: var(--mono); font-size: 13px; color: var(--faint);
  letter-spacing: 0.02em; margin-bottom: 28px;
}
.hero-log .on { color: var(--muted); }

.hero-wordmark {
  font-family: var(--mono);
  font-size: 13px; font-weight: 600; letter-spacing: 0.34em;
  color: var(--muted); margin-bottom: 24px; text-transform: uppercase;
}
.headline {
  font-size: clamp(44px, 12vw, 132px);
  font-weight: 900; letter-spacing: -0.04em; line-height: 0.9;
  text-transform: lowercase; max-width: 13ch;
  overflow-wrap: break-word; hyphens: none;
}
.grad {
  background: linear-gradient(100deg, var(--glow-a), var(--glow-b) 70%, var(--glow-c));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede {
  margin-top: 32px; font-size: clamp(18px, 3.4vw, 24px);
  color: var(--muted); max-width: 30ch; line-height: 1.45;
}
.hero-lede b { color: var(--fg); font-weight: 600; }
/* Scroll cue at the base of the hero. */
.scroll-cue {
  margin-top: 56px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
}
.scroll-cue .bar {
  position: relative; width: 1px; height: 32px; overflow: hidden;
  background: var(--line);
}
.scroll-cue .bar::after {
  content: ""; position: absolute; inset: 0; height: 12px;
  background: linear-gradient(var(--glow-a), transparent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(-12px); } 100% { transform: translateY(32px); } }

/* ---------- About --------------------------------------------------------- */
.about-stack {
  font-size: clamp(28px, 5.6vw, 56px);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.08;
  max-width: 18ch;
}
.about-stack p { color: var(--faint); transition: color 0.6s var(--ease); }
.about-stack p + p { margin-top: 8px; }
.about-stack p.lit { color: var(--fg); }
.about-stack .between { color: var(--muted); }
.about-stack .between b {
  font-weight: 800;
  background: linear-gradient(100deg, var(--glow-a), var(--glow-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Current (products) -------------------------------------------- */
.current-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 48px;
}
.current-title {
  font-size: clamp(30px, 6vw, 54px); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1; text-transform: lowercase;
}

.grid-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .grid-cards { grid-template-columns: 1.4fr 1fr; } }

/* Featured product: Flexin. */
.product {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px); overflow: hidden;
  background: linear-gradient(180deg, var(--card), transparent);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease);
  min-height: 320px;
}
.product::before {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(91, 140, 255, 0.12), transparent 55%);
  transition: opacity 0.5s var(--ease);
}
.product:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.2); }
.product:hover::before { opacity: 1; }

.product-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.product-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--fg);
  background: #000; border: 1px solid var(--line);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.8);
}
.product-mark svg { width: 22px; height: 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: lowercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex: 0 0 auto; }
.tag-wip .dot { background: var(--faint); } /* not live yet: neutral, no green */

.product-body { margin-top: auto; padding-top: 40px; }
.product-name {
  font-size: clamp(32px, 5vw, 44px); font-weight: 900;
  letter-spacing: -0.02em; line-height: 1;
}
.product-desc { margin-top: 14px; font-size: 16px; color: var(--muted); line-height: 1.5; max-width: 34ch; }
.product-link {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--fg);
}
.product-link svg { width: 14px; height: 14px; transition: transform 0.4s var(--ease); }
.product:hover .product-link svg { transform: translate(3px, -3px); }

/* Ghost slots: what's next, deliberately blank. */
.ghosts { display: grid; gap: 16px; }
.ghost {
  position: relative; border: 1px dashed var(--line); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; justify-content: space-between;
  background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
  min-height: 150px;
}
.ghost:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
.ghost-top {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--faint); text-transform: uppercase;
}
.ghost-name {
  font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; letter-spacing: -0.02em;
  color: var(--faint); text-transform: lowercase;
}

/* ---------- Footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 80px 0 56px; position: relative; z-index: 2; }
.footer-grid {
  display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between;
}
.footer-brandwrap { max-width: 22ch; }
.footer-brand {
  font-size: clamp(40px, 8vw, 80px); font-weight: 900; letter-spacing: -0.04em;
  line-height: 0.9; text-transform: lowercase;
}
.footer-tag { margin-top: 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 16px;
}
.footer-col a, .footer-col p {
  display: block; font-size: 15px; color: var(--muted);
  margin-bottom: 10px; transition: color 0.3s var(--ease); width: fit-content;
}
.footer-col a:hover { color: var(--fg); }
.footer-bottom {
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.04em;
}
.footer-bottom .clock { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Entrance animation ------------------------------------------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 760px) {
  .footer-grid { gap: 40px; }
  .footer-cols { gap: 40px; }
}

/* On phones, drop the gradient word to its own line: cleaner, more editorial. */
@media (max-width: 560px) {
  .headline { max-width: none; }
  .headline .grad { display: block; }
  .hero-log { font-size: 12px; margin-bottom: 22px; }
  /* Top-align the hero on phones: centering left big dead voids above/below.
     padding-block only, so .wrap's 24px horizontal padding survives. */
  .hero {
    min-height: auto;
    justify-content: flex-start;
    padding-block: 28px 64px;
  }
  .hero-wordmark { margin-bottom: 18px; }
  .hero-lede { margin-top: 26px; }
  .scroll-cue { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
