/* ============================================================
   Phiphygital — Design System v2 (dark / premium / frontier-AI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Base — near-black navy */
  --bg:        oklch(0.155 0.018 264);   /* page */
  --bg-2:      oklch(0.185 0.022 264);   /* elevated panel */
  --surface:   oklch(0.205 0.024 264);   /* card */
  --surface-2: oklch(0.235 0.028 264);   /* card hover / nested */

  --line:      oklch(0.32 0.03 264 / 0.6);
  --line-soft: oklch(0.3 0.025 264 / 0.4);
  --line-bright: oklch(0.5 0.06 262 / 0.55);

  /* Text */
  --ink:       oklch(0.97 0.008 264);
  --ink-2:     oklch(0.82 0.015 264);
  --muted:     oklch(0.68 0.02 264);
  --faint:     oklch(0.55 0.02 264);

  /* Accents */
  --blue:      oklch(0.62 0.17 256);
  --blue-2:    oklch(0.7 0.15 250);
  --violet:    oklch(0.62 0.19 290);
  --cyan:      oklch(0.78 0.13 210);
  --grad: linear-gradient(120deg, var(--blue) 0%, var(--violet) 100%);
  --grad-soft: linear-gradient(120deg, oklch(0.62 0.17 256 / 0.18), oklch(0.62 0.19 290 / 0.12));

  --green:     oklch(0.72 0.17 155);
  --amber:     oklch(0.78 0.14 70);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 24px;
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);

  --shadow-lg: 0 30px 80px oklch(0.08 0.02 264 / 0.7), 0 8px 24px oklch(0.05 0.02 264 / 0.5);
  --shadow-md: 0 14px 40px oklch(0.08 0.02 264 / 0.5);
  --glow-blue: 0 0 0 1px oklch(0.62 0.17 256 / 0.4), 0 16px 50px oklch(0.55 0.16 256 / 0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}
/* ambient page glow */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% -5%, oklch(0.45 0.16 270 / 0.28), transparent 70%),
    radial-gradient(50% 40% at 8% 8%, oklch(0.5 0.15 240 / 0.18), transparent 70%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.4;
  background-image: radial-gradient(oklch(0.6 0.03 264 / 0.07) 1px, transparent 1px);
  background-size: 4px 4px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: oklch(0.62 0.17 256 / 0.35); color: #fff; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1360px; margin: 0 auto; padding-inline: var(--gutter); }
section { position: relative; }
.section { padding-block: clamp(68px, 9vw, 140px); }
.section-sm { padding-block: clamp(48px, 6vw, 84px); }
.soft { background: linear-gradient(180deg, oklch(0.18 0.022 264 / 0.5), oklch(0.165 0.02 264 / 0.2)); border-block: 1px solid var(--line-soft); }
.dark { background: oklch(0.135 0.018 266); }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600; line-height: 1.04; letter-spacing: -0.035em;
  color: var(--ink); text-wrap: balance;
}
h1 { font-size: clamp(2.7rem, 6vw, 5rem); font-weight: 700; letter-spacing: -0.045em; }
h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
p { text-wrap: pretty; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-2); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, var(--blue), transparent); }

.lede { font-size: clamp(1.08rem, 1.4vw, 1.3rem); color: var(--muted); line-height: 1.6; max-width: 62ch; }

.section-head { max-width: 780px; margin-bottom: clamp(44px, 5vw, 70px); }
.section-head .eyebrow { margin-bottom: 22px; }
.section-head h2 { margin-bottom: 22px; }
.kicker-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.08em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.97rem; letter-spacing: -0.01em;
  padding: 13px 22px; border-radius: 11px; border: 1px solid transparent; position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.3s, background 0.25s, border-color 0.25s, color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.3s var(--ease); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 30px oklch(0.55 0.16 256 / 0.4); }
.btn-primary:hover { background: oklch(0.66 0.17 255); transform: translateY(-2px); box-shadow: 0 16px 44px oklch(0.55 0.16 256 / 0.55); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 12px 34px oklch(0.55 0.17 270 / 0.45); }
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 18px 48px oklch(0.55 0.17 270 / 0.6); }
.btn-grad:hover svg { transform: translateX(3px); }
.btn-ghost { background: oklch(0.5 0.04 264 / 0.12); color: var(--ink); border-color: var(--line); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--line-bright); background: oklch(0.5 0.06 264 / 0.2); transform: translateY(-2px); }
.btn-light { background: var(--ink); color: oklch(0.18 0.02 264); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 14px 40px oklch(0.9 0.02 264 / 0.2); }
.btn-dark { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-dark:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-lg { padding: 16px 28px; font-size: 1.02rem; }

.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--blue-2); font-size: 0.95rem; }
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.155 0.018 264 / 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line-soft); background: oklch(0.15 0.018 264 / 0.85); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.04em; color: var(--ink); }
.brand .mark { width: 30px; height: 30px; flex: none; transition: transform 0.4s var(--ease); filter: drop-shadow(0 4px 10px oklch(0.55 0.16 256 / 0.4)); }
.brand:hover .mark { transform: rotate(-8deg); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > a, .nav-item > button {
  font-weight: 500; font-size: 0.95rem; color: var(--muted);
  padding: 9px 14px; border-radius: 9px; background: none; border: none;
  display: inline-flex; align-items: center; gap: 5px; transition: color 0.2s, background 0.2s;
}
.nav-links > a:hover, .nav-item > button:hover { color: var(--ink); background: oklch(0.5 0.04 264 / 0.12); }
.nav-links > a.active { color: var(--blue-2); }
.nav-item { position: relative; }
.nav-item .chev { width: 13px; height: 13px; transition: transform 0.3s var(--ease); }
.nav-item:hover .chev { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px);
  width: 350px; background: oklch(0.2 0.024 264 / 0.96); backdrop-filter: blur(20px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 10px;
  opacity: 0; visibility: hidden; transition: all 0.28s var(--ease);
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dd-item { display: flex; gap: 13px; padding: 11px 12px; border-radius: 12px; transition: background 0.18s; align-items: center; }
.dd-item:hover { background: oklch(0.5 0.05 264 / 0.14); }
.dd-ico { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 0.95rem; box-shadow: 0 4px 14px oklch(0.3 0.1 264 / 0.5); }
.dd-text { flex: 1; }
.dd-text strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink); letter-spacing: -0.02em; }
.dd-text span { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.dd-tag { font-family: var(--font-mono); font-size: 0.58rem; padding: 3px 7px; border-radius: 6px; background: oklch(0.72 0.17 155 / 0.16); color: var(--green); letter-spacing: 0.05em; align-self: flex-start; }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; background: none; border: none; width: 42px; height: 42px; border-radius: 10px; }
.menu-toggle:hover { background: oklch(0.5 0.04 264 / 0.12); }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; border-radius: 2px; transition: 0.3s var(--ease); }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 72px 0 0; z-index: 99; background: var(--bg); padding: 24px var(--gutter);
  transform: translateY(-12px); opacity: 0; visibility: hidden; transition: all 0.3s var(--ease); overflow-y: auto;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-menu a { display: block; padding: 15px 4px; font-size: 1.15rem; font-weight: 600; font-family: var(--font-display); color: var(--ink); border-bottom: 1px solid var(--line-soft); letter-spacing: -0.02em; }
.mobile-menu .mm-sub { font-size: 0.95rem; font-weight: 500; font-family: var(--font-body); color: var(--muted); padding-left: 16px; }
.mobile-menu .btn { width: 100%; justify-content: center; margin-top: 18px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface), oklch(0.18 0.022 264));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; position: relative;
  transition: transform 0.4s var(--ease), box-shadow 0.4s, border-color 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-bright); }

/* ---------- Pill / tag ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted);
  background: oklch(0.5 0.04 264 / 0.1); backdrop-filter: blur(6px);
}
.pill.live { color: var(--green); border-color: oklch(0.72 0.17 155 / 0.4); background: oklch(0.72 0.17 155 / 0.1); }
.pill.live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.4s infinite; }
.pill.soon { color: var(--amber); border-color: oklch(0.78 0.14 70 / 0.35); background: oklch(0.78 0.14 70 / 0.08); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- Image placeholders (fallback — prefer mockups) ---------- */
.ph {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(120% 120% at 80% 0%, oklch(0.5 0.12 270 / 0.12), transparent 55%),
    linear-gradient(180deg, var(--surface), oklch(0.17 0.02 264));
  border: 1px solid var(--line); display: grid; place-items: center;
}
.ph::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent 75%);
}
.ph::after {
  content: attr(data-label); position: relative; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase;
  background: oklch(0.5 0.05 264 / 0.18); backdrop-filter: blur(4px); padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line-bright);
}
.ph.dark-ph { background: linear-gradient(180deg, oklch(0.19 0.022 266), oklch(0.155 0.018 266)); }

/* ---------- Footer ---------- */
.site-footer { background: oklch(0.13 0.018 266); color: var(--muted); padding-block: clamp(60px, 7vw, 96px) 36px; border-top: 1px solid var(--line-soft); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px 28px; }
.footer-brand .brand { color: var(--ink); margin-bottom: 16px; }
.footer-brand p { color: var(--faint); font-size: 0.92rem; max-width: 30ch; line-height: 1.6; }
.footer-col h4 { font-family: var(--font-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }
.footer-col a { display: block; padding: 6px 0; font-size: 0.92rem; color: var(--muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--blue-2); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line-soft); font-size: 0.82rem; color: var(--faint); }
.footer-bottom .fb-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Helpers ---------- */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-s { margin-top: 14px; } .mt-m { margin-top: 26px; } .mt-l { margin-top: 44px; }
.wrap-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); border: none; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 4vw, 3.4rem); letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.stat-num .u { color: var(--blue-2); }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-links, .nav-cta .btn-demo-desktop { display: none; }
  .menu-toggle { display: block; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}
