:root {
  --bg: oklch(0.97 0.004 80);
  --fg: oklch(0.15 0.005 60);
  --fg-60: oklch(0.15 0.005 60 / 0.6);
  --fg-40: oklch(0.15 0.005 60 / 0.4);
  --fg-20: oklch(0.15 0.005 60 / 0.18);
  --fg-10: oklch(0.15 0.005 60 / 0.08);
  --fg-05: oklch(0.15 0.005 60 / 0.04);
  --accent: oklch(0.15 0.005 60);
  --sans: "Inter Tight", "Inter", -apple-system, system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
}

[data-theme="dark"] {
  --bg: oklch(0.13 0.005 60);
  --fg: oklch(0.96 0.004 80);
  --fg-60: oklch(0.96 0.004 80 / 0.6);
  --fg-40: oklch(0.96 0.004 80 / 0.4);
  --fg-20: oklch(0.96 0.004 80 / 0.18);
  --fg-10: oklch(0.96 0.004 80 / 0.08);
  --fg-05: oklch(0.96 0.004 80 / 0.04);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  overflow-x: hidden;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
}

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; background: none; border: none; color: inherit; cursor: pointer; }

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

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}

@media (max-width: 768px) { .container { padding: 0 24px; } }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.display {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-wrap: balance;
}

/* reveal animation base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-blur {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(16px);
  transition: opacity 1.2s var(--ease), filter 1.2s var(--ease), transform 1.2s var(--ease);
}
.reveal-blur.in { opacity: 1; filter: blur(0); transform: none; }

/* line reveal */
.line-reveal { overflow: hidden; display: block; }
.line-reveal > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease);
}
.line-reveal.in > span { transform: none; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 999px;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px var(--fg-40); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg-20);
}
.btn-ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

/* section label */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-60);
}
.section-label .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

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

/* marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* shimmering divider */
.h-line {
  height: 1px;
  background: var(--fg-20);
  width: 100%;
}

/* cursor magnet hover */
.magnet { transition: transform 0.4s var(--ease); }

/* number ticker */
.ticker {
  display: inline-flex;
  overflow: hidden;
  line-height: 1;
  vertical-align: baseline;
}
.ticker-col {
  display: flex;
  flex-direction: column;
  transition: transform 1.6s var(--ease-smooth);
}

/* diagram styles */
.node-pulse {
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.flow-line {
  stroke-dasharray: 4 4;
  animation: flow 2s linear infinite;
}
@keyframes flow {
  to { stroke-dashoffset: -16; }
}

/* accordion */
.acc-item {
  border-top: 1px solid var(--fg-20);
  overflow: hidden;
}
.acc-item:last-child { border-bottom: 1px solid var(--fg-20); }

.acc-head {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  padding: 32px 0;
  width: 100%;
  text-align: left;
  gap: 24px;
  transition: padding 0.4s var(--ease);
}
.acc-head:hover { padding-left: 8px; }

.acc-body {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.6s var(--ease), opacity 0.6s var(--ease), padding 0.6s var(--ease);
  padding: 0 0 0 60px;
}
.acc-item.open .acc-body {
  max-height: 600px;
  opacity: 1;
  padding: 0 0 40px 60px;
}

.acc-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--fg-20);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s var(--ease);
  flex-shrink: 0;
}
.acc-item.open .acc-toggle {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
  transform: rotate(45deg);
}

/* case card */
.case-card {
  border: 1px solid var(--fg-20);
  border-radius: 20px;
  padding: 40px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  transition: transform 0.6s var(--ease), border-color 0.4s var(--ease);
}
.case-card:hover {
  transform: translateY(-6px);
  border-color: var(--fg);
}
.case-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), var(--fg-05), transparent 50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.case-card:hover::before { opacity: 1; }

/* tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--bg);
  border: 1px solid var(--fg-20);
  border-radius: 16px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 24px 60px -20px var(--fg-40);
  backdrop-filter: blur(20px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tweak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--fg-10);
}
.tweak-row:first-of-type { border-top: none; }

.tweak-segmented {
  display: inline-flex;
  gap: 4px;
  background: var(--fg-05);
  padding: 3px;
  border-radius: 999px;
}
.tweak-segmented button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--fg-60);
  transition: all 0.3s var(--ease);
}
.tweak-segmented button.on {
  background: var(--fg);
  color: var(--bg);
}

/* service card */
.service-card {
  border-top: 1px solid var(--fg-20);
  padding: 36px 0;
  display: grid;
  grid-template-columns: 80px 1fr 2fr auto;
  gap: 32px;
  align-items: start;
  cursor: pointer;
  transition: padding 0.5s var(--ease);
}
.service-card:last-child { border-bottom: 1px solid var(--fg-20); }
.service-card:hover { padding-left: 12px; }
.service-card .s-num { font-family: var(--mono); font-size: 12px; color: var(--fg-40); padding-top: 6px; }
.service-card .s-title { font-family: var(--sans); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.service-card .s-desc { font-size: 15px; color: var(--fg-60); line-height: 1.55; padding-top: 6px; max-width: 480px; }
.service-card .s-flag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--fg-40); padding-top: 10px; }
.service-card.flagship .s-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 34px; letter-spacing: -0.01em; }

@media (max-width: 900px) {
  .service-card { grid-template-columns: 1fr; gap: 12px; }
  .service-card .s-flag { display: none; }
}

/* footer */
footer { padding: 120px 0 48px; border-top: 1px solid var(--fg-20); margin-top: 120px; }

/* selection */
::selection { background: var(--fg); color: var(--bg); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fg-20); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-40); }
