:root {
  color-scheme: dark;
  --bg: #05070b;
  --text: #e6edf3;
  --muted: #8b98a5;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(12, 16, 22, 0.55);
  --a1: #2dd4bf;
  --a2: #38bdf8;
  --a3: #a78bfa;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--a2); }
.defs { position: absolute; }

#flow, .veil { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.veil {
  background:
    radial-gradient(ellipse 55% 65% at 20% 50%, rgba(5, 7, 11, 0.62), transparent 72%),
    linear-gradient(to bottom, transparent 62%, rgba(5, 7, 11, 0.8));
}
header, main, footer { position: relative; z-index: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; }
nav { display: flex; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color 0.2s; }
nav a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; min-height: calc(100vh - 80px); min-height: calc(100svh - 80px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 60px; }
.mark {
  position: absolute; z-index: -1; right: 0; top: 50%; translate: 0 -54%;
  width: clamp(280px, 36vw, 460px); height: auto; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 34px rgba(56, 189, 248, 0.35));
}
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a1); margin: 0 0 14px; }
.word {
  font-size: clamp(3.4rem, 12vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 760;
  margin: 0 0 22px;
  align-self: flex-start;
  background: linear-gradient(100deg, #ffffff 0%, #d7ecff 30%, var(--a2) 62%, var(--a3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px; }
.lede p { color: var(--muted); max-width: 34rem; font-size: 1.08rem; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text); text-decoration: none; font-size: 15px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn:hover { border-color: rgba(56, 189, 248, 0.45); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(100deg, var(--a1), var(--a2)); color: #03121a; border-color: transparent; font-weight: 650; }
.btn.primary:hover { box-shadow: 0 8px 30px rgba(45, 212, 191, 0.25); }

/* Work */
.work { padding-top: 40px; padding-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.grid .card { grid-column: span 2; }
.grid .card:nth-child(-n+2) { grid-column: span 3; }
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .card, .grid .card:nth-child(-n+2) { grid-column: span 1; }
  .grid .card:last-child { grid-column: span 2; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .grid .card:last-child { grid-column: span 1; }
}
.card {
  position: relative; overflow: hidden; padding: 24px 22px 22px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s, opacity 0.7s, translate 0.7s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(56, 189, 248, 0.16), transparent 45%);
}
.card:hover { border-color: rgba(56, 189, 248, 0.35); transform: translateY(-3px); }
.card:hover::before { opacity: 1; }
.num { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.card h3 { margin: 10px 0 8px; font-size: 1.25rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.card:nth-child(1) h3 { color: #5eead4; }
.card:nth-child(2) h3 { color: #7dd3fc; }
.card:nth-child(3) h3 { color: #93c5fd; }
.card:nth-child(4) h3 { color: #a5b4fc; }
.card:nth-child(5) h3 { color: #c4b5fd; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; padding-top: 70px; padding-bottom: 40px; }
.principle { border-top: 1px solid var(--line); padding-top: 18px; transition: opacity 0.7s, translate 0.7s; }
.principle h3 { margin: 0 0 6px; font-size: 1.05rem; }
.principle p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* Contact */
.contact { padding-top: 90px; padding-bottom: 100px; transition: opacity 0.7s, translate 0.7s; }
.contact h2 { font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 0 0 14px; }
.mail {
  display: inline-block; font-size: clamp(1.2rem, 4vw, 1.9rem); font-weight: 600; text-decoration: none;
  background: linear-gradient(100deg, var(--a1), var(--a2), var(--a3)); -webkit-background-clip: text; background-clip: text; color: transparent;
  border-bottom: 2px solid rgba(56, 189, 248, 0.35); padding-bottom: 4px; overflow-wrap: anywhere;
}
.mail:hover { border-bottom-color: var(--a2); }

/* Footer */
footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-top: 22px; padding-bottom: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.status { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 8px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .brush-reveal { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.6s cubic-bezier(0.55, 0, 0.3, 1) 0.15s forwards; }
  .hero .eyebrow, .word, .lede, .actions { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero .eyebrow { animation-delay: 0.35s; }
  .word { animation-delay: 0.45s; }
  .lede { animation-delay: 0.6s; }
  .actions { animation-delay: 0.75s; }
  .reveal.pending { opacity: 0; translate: 0 18px; }
  .grid .card:nth-child(2) { transition-delay: 0s, 0s, 0.08s, 0.08s; }
  .grid .card:nth-child(3) { transition-delay: 0s, 0s, 0.16s, 0.16s; }
  .grid .card:nth-child(4) { transition-delay: 0s, 0s, 0.24s, 0.24s; }
  .grid .card:nth-child(5) { transition-delay: 0s, 0s, 0.32s, 0.32s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .mark { width: 80vw; right: -34vw; top: -4%; translate: none; opacity: 0.14; }
}
@media (max-width: 520px) {
  nav { gap: 16px; }
  .hero { min-height: auto; padding-top: 40px; }
}
