/* ==========================================================================
   Cykoai — minimal static build
   Plain CSS, no framework, no build step. Same design tokens as the full
   Next.js app (src/app/globals.css) so the two stay visually consistent.
   ========================================================================== */

:root {
  --void: #050608;
  --charcoal: #0a0c10;
  --surface: #0e1116;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --ink: #f3f5f7;
  --ink-muted: #9aa4b0;
  --ink-faint: #5a6270;

  --blue: #4f8cff;
  --cyan: #35d4d1;
  --emerald: #38d39f;
  --violet: #8d7cf6;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { background: var(--void); color-scheme: dark; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--blue); color: var(--void); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--void);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Reveal-on-scroll (IntersectionObserver toggles .is-visible) --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

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

/* ---------- Type scale ---------- */
.label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  margin: 0 0 28px;
}
.label i { width: 32px; height: 1px; background: var(--border-strong); display: inline-block; }
.label.center { justify-content: center; }
.label .idx { font-family: monospace; color: var(--ink-faint); letter-spacing: 0; text-transform: none; }

.h2 {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 20px;
  max-width: 46rem;
}
.h2.wide { max-width: 52rem; }
.lead { font-size: 1.05rem; line-height: 1.6; color: var(--ink-muted); max-width: 32rem; margin: 0; }
.fine-print { font-size: 0.85rem; color: var(--ink-faint); margin-top: 14px; }

.accent-text {
  background: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 55%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 14px 28px;
  font-size: 0.9rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--ink); color: var(--void); }
.btn-solid:hover { box-shadow: 0 0 40px rgba(79, 140, 255, 0.35); }
.btn-outline { border: 1px solid var(--border-strong); }
.btn-outline:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-lg { padding: 18px 36px; font-size: 1rem; }
.btn-sm { padding: 10px 20px; font-size: 0.8rem; }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 24px;
  transition: padding 0.4s var(--ease);
}
.nav.scrolled .nav-inner { padding: 16px 24px; }
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 100%;
  background: rgba(5, 6, 8, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: -1;
}
.nav.scrolled::before { opacity: 1; }

.wordmark { font-weight: 500; font-size: 1.05rem; white-space: nowrap; }
.wordmark span { margin-left: 6px; font-size: 0.65rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ink-faint); }

.nav-links { display: none; align-items: center; gap: 34px; }
.nav-links a { font-size: 0.875rem; color: var(--ink-muted); position: relative; transition: color 0.3s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: var(--ink); transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: none; }

.nav-toggle { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.nav-toggle span { width: 22px; height: 1px; background: var(--ink); transition: transform 0.3s, opacity 0.3s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  max-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px;
  background: rgba(5, 6, 8, 0.97); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: max-height 0.4s var(--ease);
}
.nav-mobile.open { max-height: 420px; }
.nav-mobile a { padding: 14px 24px; font-size: 1.05rem; color: var(--ink-muted); }
.nav-mobile .btn { margin: 10px 24px 20px; }

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle, .nav-mobile { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(55% 50% at 68% 42%, rgba(79, 140, 255, 0.22), transparent 70%),
              radial-gradient(40% 40% at 15% 80%, rgba(141, 124, 246, 0.12), transparent 70%);
  animation: breathe 10s ease-in-out infinite;
}
.hero-rings { position: absolute; inset: 0; z-index: -1; display: flex; align-items: center; justify-content: flex-end; padding-right: 8%; }
.hero-rings span {
  position: absolute; border: 1px solid rgba(79, 140, 255, 0.18); border-radius: 50%;
  animation: spin linear infinite;
}
.hero-rings span:nth-child(1) { width: 44vmin; height: 44vmin; animation-duration: 60s; }
.hero-rings span:nth-child(2) { width: 60vmin; height: 60vmin; border-color: rgba(141, 124, 246, 0.14); animation-duration: 90s; animation-direction: reverse; }
.hero-rings span:nth-child(3) { width: 30vmin; height: 30vmin; border-color: rgba(53, 212, 209, 0.16); animation-duration: 40s; }

@keyframes breathe { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-inner { max-width: 46rem; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.03);
  border-radius: 999px; padding: 8px 18px; font-size: 0.75rem; color: var(--ink-muted);
  margin-bottom: 32px;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }

.hero-title { font-size: clamp(2.75rem, 7vw, 6rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.03em; margin: 0; }
.hero-sub { font-size: 1.05rem; line-height: 1.6; color: var(--ink-muted); max-width: 34rem; margin: 32px 0 0; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 44px; }

.scroll-hint { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scroll-hint span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--ink-faint); }
.scroll-line { width: 1px; height: 40px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.scroll-line i { display: block; width: 100%; height: 100%; background: linear-gradient(to bottom, transparent, var(--ink), transparent); animation: scrollDrop 1.8s ease-in-out infinite; }
@keyframes scrollDrop { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* ---------- Sections ---------- */
.section { padding: 128px 0; position: relative; }
.section.alt { background: var(--charcoal); }
@media (max-width: 640px) { .section { padding: 88px 0; } }

.split-head { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: end; margin-bottom: 24px; }
@media (min-width: 900px) { .split-head { grid-template-columns: 1.1fr 0.9fr; } }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 24px; margin-top: 56px; }
.grid-4 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border-radius: 24px;
  padding: 32px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.card h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; margin: 24px 0 10px; }
.card p { font-size: 0.92rem; line-height: 1.6; color: var(--ink-muted); margin: 0; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-top .idx { font-family: monospace; font-size: 0.75rem; color: var(--ink-faint); }

.glyph { width: 56px; height: 56px; stroke: var(--blue); fill: none; stroke-width: 1.4; filter: drop-shadow(0 0 10px rgba(79, 140, 255, 0.35)); }
.glyph .fill { fill: currentColor; stroke: none; }
.glyph.sm { width: 44px; height: 44px; }
.glyph.lg { width: 120px; height: 120px; flex-shrink: 0; }
svg.glyph:has(use[href="#glyph-field"]) { stroke: var(--violet); filter: drop-shadow(0 0 10px rgba(141, 124, 246, 0.35)); }
svg.glyph:has(use[href="#glyph-weave"]) { stroke: var(--violet); filter: drop-shadow(0 0 10px rgba(141, 124, 246, 0.35)); }
svg.glyph:has(use[href="#glyph-grid"]) { stroke: var(--emerald); filter: drop-shadow(0 0 10px rgba(56, 211, 159, 0.35)); }
svg.glyph:has(use[href="#glyph-pulse"]) { stroke: var(--emerald); filter: drop-shadow(0 0 10px rgba(56, 211, 159, 0.35)); }
svg.glyph:has(use[href="#glyph-flow"]) { stroke: var(--cyan); filter: drop-shadow(0 0 10px rgba(53, 212, 209, 0.35)); }
svg.glyph:has(use[href="#glyph-ascend"]) { stroke: var(--cyan); filter: drop-shadow(0 0 10px rgba(53, 212, 209, 0.35)); }
svg.glyph:has(use[href="#glyph-orbit"]) { stroke: var(--violet); filter: drop-shadow(0 0 10px rgba(141, 124, 246, 0.35)); }

/* ---------- Why Cykoai rows ---------- */
.rows { display: flex; flex-direction: column; margin-top: 56px; }
.row { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 44px 0; border-top: 1px solid var(--border); text-align: center; }
.row:last-child { border-bottom: 1px solid var(--border); }
.row .idx { font-family: monospace; font-size: 0.75rem; color: var(--ink-faint); }
.row h3 { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.01em; margin: 10px 0 12px; }
.row p { font-size: 1rem; line-height: 1.6; color: var(--ink-muted); margin: 0; max-width: 40rem; }
@media (min-width: 768px) {
  .row { flex-direction: row; text-align: left; gap: 56px; padding: 60px 0; }
  .row.reverse { flex-direction: row-reverse; }
  .row div { max-width: 42rem; }
}

/* ---------- Philosophy: scroll-pinned line reveal ----------
   A tall wrapper (400vh) + a `position: sticky` inner panel pins the
   viewport natively — no JS layout work needed for the "pin" itself.
   A small scroll listener (rAF-throttled, see script.js) just toggles
   which line is active based on scroll progress through that wrapper. */
.philosophy-pin { position: relative; height: 400vh; background: var(--charcoal); }
.philosophy-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.philosophy-glow {
  position: absolute; left: 50%; top: 50%; width: 900px; height: 600px;
  transform: translate(-50%, -50%); background: rgba(141, 124, 246, 0.08); filter: blur(120px); border-radius: 999px;
}
.philosophy-inner { position: relative; height: 100%; }
.philosophy-label { position: absolute; left: 24px; top: 64px; }
@media (min-width: 900px) { .philosophy-label { left: 40px; } }

.philosophy-lines {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 100%; max-width: 56rem; height: 200px; padding: 0 24px;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.phil-line {
  position: absolute; inset: 0 24px; margin: 0; display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem); font-weight: 500; letter-spacing: -0.01em; color: var(--ink-muted);
  opacity: 0; transform: translateY(32px); filter: blur(6px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.phil-line.is-active { opacity: 1; transform: translateY(0); filter: blur(0); }
.phil-line.is-past { transform: translateY(-32px); }
.phil-line.big { font-size: clamp(2rem, 4.6vw, 3.25rem); }
/* .accent-text sets color: transparent for its gradient clip — .phil-line's
   own `color` above has equal specificity and comes later in the cascade,
   so without this override it would silently cancel the gradient out. */
.phil-line.accent-text { color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .philosophy-pin { height: auto; }
  .philosophy-sticky { position: static; height: auto; padding: 140px 0; }
  .philosophy-inner { height: auto; }
  .philosophy-label { position: static; margin-bottom: 40px; }
  .philosophy-lines { position: static; transform: none; height: auto; max-width: none; flex-direction: column; gap: 28px; margin: 0 auto; }
  .phil-line { position: static; opacity: 1; transform: none; filter: none; }
}

/* ---------- Process timeline ---------- */
.timeline { list-style: none; margin: 56px 0 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 24px; padding: 28px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.timeline li:last-child { border-bottom: 1px solid var(--border); }
.timeline .idx { font-family: monospace; font-size: 0.8rem; color: var(--ink-faint); padding-top: 4px; }
.timeline h3 { font-size: 1.3rem; font-weight: 500; margin: 0 0 8px; }
.timeline p { font-size: 0.95rem; line-height: 1.6; color: var(--ink-muted); margin: 0; max-width: 40rem; }

/* ---------- Case studies ---------- */
.case-list { margin-top: 48px; border-bottom: 1px solid var(--border); }
.case { border-top: 1px solid var(--border); }
.case summary {
  list-style: none; cursor: pointer; padding: 28px 0; display: grid; gap: 8px;
  grid-template-columns: 1fr; transition: color 0.3s;
}
.case summary::-webkit-details-marker { display: none; }
.case .sector { font-family: monospace; font-size: 0.8rem; color: var(--ink-faint); }
.case .title { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.01em; }
.case .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.case .tags i { font-style: normal; border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; font-size: 0.7rem; color: var(--ink-muted); }
.case p { margin: 0 0 24px; color: var(--ink-muted); font-size: 0.95rem; max-width: 40rem; }
.case:hover summary .title { color: var(--blue); }
@media (min-width: 900px) {
  .case summary { grid-template-columns: 1fr 2.2fr 1fr; align-items: center; }
}

/* ---------- Testimonials ---------- */
.testimonials { text-align: center; }
.quote-wrap { max-width: 46rem; margin: 0 auto; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#quote { font-size: clamp(1.4rem, 3vw, 2.25rem); font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; margin: 0; transition: opacity 0.5s var(--ease); }
.quote-author { margin-top: 28px; transition: opacity 0.5s var(--ease); }
.quote-author .name { font-size: 0.95rem; font-weight: 500; margin: 0; }
.quote-author .org { font-size: 0.85rem; color: var(--ink-faint); margin: 4px 0 0; }
.fade-out #quote, .fade-out .quote-author { opacity: 0; }
.quote-dots { display: flex; justify-content: center; gap: 12px; margin-top: 36px; }
.quote-dots button { width: 40px; height: 1px; background: rgba(255, 255, 255, 0.15); position: relative; }
.quote-dots button::after {
  content: ""; position: absolute; inset: 0; width: 0; background: var(--ink); transition: width 0.5s var(--ease);
}
.quote-dots button.active::after { width: 100%; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 48px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.email-link { display: inline-block; margin-top: 40px; font-size: 1.1rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--border-strong); }
.email-link:hover { color: var(--blue); }

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}
.form { border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form input, .form textarea {
  width: 100%; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
  border-radius: 16px; padding: 16px 20px; font: inherit; font-size: 0.95rem; color: var(--ink);
  transition: border-color 0.3s, background 0.3s;
}
.form input::placeholder, .form textarea::placeholder { color: var(--ink-faint); }
.form input:focus, .form textarea:focus { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.05); outline: none; }
.form textarea { resize: none; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.form-status { font-size: 0.85rem; color: var(--emerald); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 0; }
.footer-inner { display: flex; flex-direction: column; gap: 56px; }
.footer-brand { max-width: 26rem; }
.footer-brand .wordmark { font-size: 1.3rem; }
.footer-brand p { font-size: 0.95rem; line-height: 1.6; color: var(--ink-muted); margin: 16px 0 32px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.footer-cols h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ink-faint); margin: 0 0 20px; }
.footer-cols a { display: block; font-size: 0.9rem; color: var(--ink-muted); padding: 6px 0; }
.footer-cols a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; flex-direction: column-reverse; gap: 8px; align-items: flex-start;
  border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 24px; font-size: 0.8rem; color: var(--ink-faint);
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; }
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}
