/* ==========================================================================
   FAI · For AI — fai.asia
   Dark technical base with an indigo-violet → cyan accent. No external
   fonts, no CDNs, no images. Everything below is drawn with CSS and inline
   SVG that ships inside the HTML.

   Type scale : 11.5 / 12 / 13 / 14 / 16 / 17 / 20 / 24 / clamp(24–34) / clamp(40–72)
   Spacing    : 4px base (4 8 12 16 20 24 32 40 48 56 64 80 96)
   ========================================================================== */

:root {
  /* Surfaces — near-black, faintly blue-shifted */
  --bg:          #07080c;
  --bg-panel:    #0e1017;
  --bg-elev:     #141824;
  --bg-input:    #0b0d14;
  --line:        #1d2130;
  --line-soft:   #161a26;
  --line-strong: #2b3145;

  /* Text */
  --ink:      #e9ebf2;
  --ink-soft: #c2c7d6;
  --dim:      #8b92a8;
  --dim2:     #5c6379;

  /* Accent A — indigo violet (primary) */
  --accent:      #7c6cff;
  --accent-hi:   #a78bfa;
  --accent-dim:  #5b4bd6;
  --accent-soft: rgba(124, 108, 255, 0.13);
  --accent-line: rgba(124, 108, 255, 0.36);

  /* Accent B — cyan (secondary, used in gradients and glow only) */
  --accent2:      #38e0d0;
  --accent2-hi:   #5eead4;
  --accent2-soft: rgba(56, 224, 208, 0.12);

  /* Semantic */
  --ok:   #4ade80;
  --warn: #fbbf24;
  --err:  #f87171;

  /* Shape */
  --r-xs: 6px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Elevation — light layering, never heavy drops */
  --sh-1: 0 1px 0 rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 1px 0 rgba(255, 255, 255, 0.02), 0 10px 30px rgba(0, 0, 0, 0.42);
  --sh-3: 0 24px 60px rgba(0, 0, 0, 0.55);

  /* Motion */
  --t-fast: 120ms;
  --t:      200ms;
  --t-slow: 340ms;
  --ease:   cubic-bezier(.2, .7, .2, 1);

  /* Type */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;

  --wrap: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  overflow-x: clip;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
ul, ol { list-style: none; padding: 0; }
code, pre, kbd, samp { font-family: var(--mono); }
::selection { background: rgba(124, 108, 255, 0.34); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 5px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Background layers (kept under 8% opacity) ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 140, 180, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 140, 180, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 96% 58% at 50% 0%, #000 20%, transparent 72%);
          mask-image: radial-gradient(ellipse 96% 58% at 50% 0%, #000 20%, transparent 72%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
}
.bg-glow::before,
.bg-glow::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(24px);
}
.bg-glow::before {
  top: -460px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(closest-side, rgba(124, 108, 255, 0.20), rgba(124, 108, 255, 0.05), transparent 72%);
}
.bg-glow::after {
  top: -260px; right: -180px;
  width: 640px; height: 520px;
  background: radial-gradient(closest-side, rgba(56, 224, 208, 0.13), rgba(56, 224, 208, 0.03), transparent 70%);
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.mt-16 { margin-top: 16px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--bg-elev); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 10px 16px; font-size: 14px;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 14px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 12, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
          backdrop-filter: blur(16px) saturate(150%);
}
.site-header .container {
  display: flex; align-items: center; gap: 16px;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-dim), var(--accent) 55%, var(--accent2));
  box-shadow: 0 0 0 1px rgba(124, 108, 255, 0.4), 0 8px 20px rgba(124, 108, 255, 0.3);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-name {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 16px; font-weight: 700; letter-spacing: 0.01em;
}
.brand-name b { font-weight: 700; }
.brand-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dim2);
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--dim); font-size: 14px; padding: 8px 13px; border-radius: var(--r-sm);
  text-decoration: none; transition: color var(--t-fast), background var(--t-fast);
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.045); text-decoration: none; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center;
  transition: border-color var(--t-fast);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:hover { border-color: var(--line-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-elev); color: var(--ink);
  font-size: 14.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); background: #1a1f2d; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(140deg, var(--accent-dim), var(--accent) 60%, var(--accent-hi));
  box-shadow: 0 10px 26px rgba(124, 108, 255, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(140deg, var(--accent), var(--accent-hi));
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(124, 108, 255, 0.4);
}
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.035); border-color: var(--line-strong); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-soft); text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; background: rgba(255, 255, 255, 0.025);
  margin-bottom: 30px;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--warn);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

.hero-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 20px;
  margin-bottom: 4px;
}
.wordmark {
  font-size: clamp(60px, 15vw, 138px);
  font-weight: 800; line-height: 0.92; letter-spacing: -0.045em;
  background: linear-gradient(104deg, #ffffff 4%, var(--accent-hi) 42%, var(--accent2-hi) 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding-right: 0.04em;
}
.wordmark-note {
  font-family: var(--mono); font-size: clamp(13px, 2.2vw, 18px);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  padding-bottom: 0.6em;
}
.hero-tagline {
  margin-top: 22px;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 650; letter-spacing: -0.025em; line-height: 1.25;
  max-width: 22ch;
}
.hero-tagline .grad {
  background: linear-gradient(100deg, var(--accent-hi), var(--accent2-hi));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-lead {
  margin-top: 20px; max-width: 62ch;
  color: var(--dim); font-size: 16.5px; line-height: 1.75;
}
.hero-lead strong { color: var(--ink-soft); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 36px;
  font-family: var(--mono); font-size: 12.5px; color: var(--dim2);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta b { color: var(--ink-soft); font-weight: 600; }

/* ---------- Section headings ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-hi); margin-bottom: 12px;
}
.section-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.03em; }
.section-sub { margin-top: 14px; color: var(--dim); font-size: 15.5px; max-width: 64ch; line-height: 1.7; }

/* ---------- Direction cards ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 40px;
}
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 22px 20px 20px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg));
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: var(--sh-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-ico {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--accent-hi);
  transition: border-color var(--t), color var(--t);
}
.card:hover .card-ico { border-color: var(--accent-line); color: var(--accent2-hi); }
.card-ico svg { width: 19px; height: 19px; }
.card-index { font-family: var(--mono); font-size: 12px; color: var(--dim2); letter-spacing: 0.06em; }
.card h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-en {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--dim2); margin-top: 5px; margin-bottom: 12px;
}
.card p:last-child { font-size: 13.5px; color: var(--dim); line-height: 1.68; }

/* ---------- Roadmap ---------- */
.roadmap { margin-top: 40px; display: grid; gap: 0; }
.roadmap-item {
  position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 18px;
  padding-bottom: 26px;
}
.roadmap-item:last-child { padding-bottom: 0; }
.roadmap-item::before {
  content: ""; position: absolute; left: 11px; top: 22px; bottom: -4px;
  width: 1px; background: var(--line);
}
.roadmap-item:last-child::before { display: none; }
.roadmap-dot {
  position: relative; z-index: 1;
  width: 23px; height: 23px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg);
  display: grid; place-items: center; margin-top: 2px;
}
.roadmap-dot::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dim2);
}
.roadmap-item.is-active .roadmap-dot { border-color: rgba(251, 191, 36, 0.5); }
.roadmap-item.is-active .roadmap-dot::after { background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.14); }
.roadmap-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.roadmap-head h3 { font-size: 16px; font-weight: 600; }
.roadmap-body p { margin-top: 7px; color: var(--dim); font-size: 14px; max-width: 58ch; line-height: 1.65; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.03em;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); background: rgba(255, 255, 255, 0.02);
}
.badge-warn {
  color: var(--warn); border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.09);
}

/* ---------- Contact ---------- */
.contact {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 56px 40px; text-align: center;
  background:
    radial-gradient(ellipse 70% 130% at 50% 0%, rgba(124, 108, 255, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg-panel), var(--bg));
}
.contact h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.025em; margin-bottom: 12px; }
.contact > p:not(.eyebrow) { color: var(--dim); max-width: 54ch; margin: 0 auto 28px; font-size: 15.5px; line-height: 1.7; }
.contact-actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center;
}
.mail {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 15px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 0 22px; min-height: 44px; background: var(--bg-input);
  transition: border-color var(--t), box-shadow var(--t);
}
.mail:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mail svg { width: 17px; height: 17px; color: var(--accent-hi); }

/* ---------- 404 ---------- */
.notfound {
  max-width: 640px; margin: 32px auto 0; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 56px 36px;
  background: linear-gradient(180deg, var(--bg-panel), var(--bg));
}
.notfound-code {
  font-family: var(--mono); font-size: clamp(52px, 12vw, 96px); font-weight: 700;
  line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(100deg, var(--accent-hi), var(--accent2-hi));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.notfound-title { font-size: 21px; margin: 16px 0 12px; }
.notfound-text { color: var(--dim); font-size: 15px; max-width: 46ch; margin: 0 auto; line-height: 1.7; }
.notfound-actions { justify-content: center; margin-top: 28px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 48px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.footer-grid h4 {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--dim2); margin-bottom: 15px; font-weight: 600;
}
.footer-grid p { color: var(--dim); font-size: 13.5px; max-width: 42ch; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a { color: var(--dim); font-size: 13.5px; }
.footer-links a:hover { color: var(--accent-hi); }
.footer-bottom {
  margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--dim2); font-size: 12.5px; font-family: var(--mono);
}
.footer-bottom a { color: var(--dim); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast {
  font-size: 13.5px; color: var(--ink);
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 18px; box-shadow: var(--sh-3);
  display: inline-flex; align-items: center; gap: 8px;
  animation: toast-in var(--t) var(--ease);
}
.toast svg { width: 15px; height: 15px; color: var(--ok); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Utilities ---------- */
.mono { font-family: var(--mono); }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-panel); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; gap: 2px; box-shadow: var(--sh-2);
  }
  .nav.open a { padding: 13px; font-size: 15.5px; }
  .nav-toggle { display: inline-flex; }
  .site-header .container { position: relative; }
  .hero { padding: 64px 0 44px; }
  .section { padding: 56px 0; }
  .contact { padding: 40px 22px; }
  .notfound { padding: 40px 22px; }
}
@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .container { padding: 0 18px; }
  .hero-meta { gap: 8px 18px; }
  .hero-title { gap: 0 12px; }
  .hero-lead { font-size: 15.5px; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .contact-actions .btn, .contact-actions .mail { width: 100%; }
  .roadmap-item { grid-template-columns: 20px 1fr; gap: 14px; }
  .roadmap-dot { width: 19px; height: 19px; }
  .roadmap-item::before { left: 9px; }
  .footer-bottom { flex-direction: column; }
}

/* ---------- Entrance motion (CSS-only, plays once on load) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero .container > * { animation: rise 620ms var(--ease) both; }
.hero .container > *:nth-child(1) { animation-delay: 40ms; }
.hero .container > *:nth-child(2) { animation-delay: 90ms; }
.hero .container > *:nth-child(3) { animation-delay: 140ms; }
.hero .container > *:nth-child(4) { animation-delay: 190ms; }
.hero .container > *:nth-child(5) { animation-delay: 240ms; }
.hero .container > *:nth-child(6) { animation-delay: 290ms; }
.card { animation: rise 620ms var(--ease) both; }
.card:nth-child(1) { animation-delay: 60ms; }
.card:nth-child(2) { animation-delay: 130ms; }
.card:nth-child(3) { animation-delay: 200ms; }
.card:nth-child(4) { animation-delay: 270ms; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover { transform: none; }
  .hero-eyebrow .dot { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  .bg-grid, .bg-glow, .site-header, .site-footer, .toast-wrap, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .card, .contact, .notfound { border-color: #ccc; background: #fff; }
}
