:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --bg-3: #18181b;
  --line: #232327;
  --line-2: #2e2e33;
  --text: #ededef;
  --muted: #8b8b93;
  --dim: #5c5c63;
  --accent: #c8f560;
  --accent-ink: #0a0a0b;
  --danger: #ff6b6b;
  --ok: #7ee2a8;
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { width: min(1680px, 100% - clamp(32px, 6vw, 120px)); margin: 0 auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 11, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.logo-icon { width: 30px; height: 30px; display: block; transition: transform .3s; }
.logo:hover .logo-icon { transform: rotate(-12deg) scale(1.08); }
.logo-dot { color: var(--accent); margin-left: -10px; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 120px 0 96px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(200,245,96,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(200,245,96,0); } 100% { box-shadow: 0 0 0 0 rgba(200,245,96,0); } }
.hero h1 {
  font-size: min(30vw, 545px);
  white-space: nowrap;
  line-height: .9; letter-spacing: -0.06em; font-weight: 800;
  margin: 28px 0 36px; margin-left: -0.04em;
}
.hero h1 { user-select: none; -webkit-user-select: none; }
.hn-gap { display: inline-block; position: relative; width: 0; height: .2em; transition: width .42s cubic-bezier(.34, 1.56, .64, 1); }
.hn-gap.open { width: .24em; }
.hn-dot {
  position: absolute; left: 50%; bottom: 0; width: .175em; height: .175em; margin-left: -.06em;
  border-radius: 50%; background: var(--accent); cursor: grab; touch-action: none;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.hn-dot:hover { transform: scale(1.12); }
.hn-dot.hint { animation: hop 1.1s 1.4s cubic-bezier(.34, 1.56, .64, 1) 2; }
.hn-dot.hop { animation: hop .8s cubic-bezier(.34, 1.56, .64, 1) 1; }
/* "drag me" tooltip — sized in px because the dot lives inside the giant heading */
.hn-dot.tip::after {
  content: "drag me"; position: absolute; left: 50%; bottom: calc(100% + 12px);
  transform: translate(-50%, 6px); padding: 6px 12px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 13px/1 var(--font); letter-spacing: 0; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
/* Like a normal tooltip: only after the pointer rests on the dot for a moment (no delay when hiding). */
.hn-dot.tip:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .9s; }
.hn-dot.dragging::after { display: none; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-.35em) scale(.92, 1.08); } 55% { transform: translateY(0) scale(1.15, .85); } 75% { transform: translateY(-.06em); } }
.hn-dot.dragging { position: fixed; left: 0; top: 0; bottom: auto; margin: 0; cursor: grabbing; transition: none; animation: none; z-index: 60; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .hn-dot.hint { animation: none; } }
.hero p.lead { font-size: clamp(18px, 2.2vw, 24px); max-width: 640px; color: var(--muted); margin: 0 0 40px; }
.hero p.lead strong { color: var(--text); font-weight: 500; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: 500 14px var(--font); cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary:disabled { opacity: 1; background: var(--bg-3); border-color: var(--line-2); color: var(--muted); }

input, textarea, select {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 14px; font: 15px var(--font); outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.check input { width: auto; }

/* ---------- sections ---------- */
section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.section-head h2 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.04em; margin: 8px 0 0; line-height: 1; font-weight: 700; }

/* ---------- works ---------- */
/* Rows bleed 20px past the text column so the hover card has breathing room,
   while the content stays aligned with the section heading. */
.works { --bleed: 20px; display: flex; flex-direction: column; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.work {
  position: relative;
  display: grid; grid-template-columns: 56px 64px 1fr auto; gap: 24px; align-items: center;
  margin: 0 calc(var(--bleed) * -1); padding: 24px var(--bleed); border-radius: 16px;
  transition: background .2s;
}
.work + .work::before {
  content: ""; position: absolute; top: 0; left: var(--bleed); right: var(--bleed);
  height: 1px; background: var(--line); transition: opacity .2s;
}
.work:hover { background: var(--bg-2); }
.work:hover::before, .work:hover + .work::before { opacity: 0; }
.work .num { font-family: var(--mono); color: var(--dim); font-size: 14px; }
.icon {
  width: 64px; height: 64px; border-radius: 16px; background: var(--bg-3);
  border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: 22px; color: var(--accent);
}
.icon img { width: 100%; height: 100%; object-fit: cover; }
.icon.auto { border-color: transparent; font-size: 20px; letter-spacing: -0.02em; }
.work h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.work p { margin: 0; color: var(--muted); font-size: 15px; max-width: 620px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; }
.empty { color: var(--muted); padding: 40px 0; }
.work .action { position: relative; display: flex; flex-direction: column; align-items: flex-end; }
.code-form { display: flex; gap: 8px; align-items: center; animation: fade .15s; }
.code-inline {
  width: 168px; height: 44px; padding: 0 12px; border-radius: 999px;
  font-family: var(--mono); font-size: 16px; letter-spacing: .12em; text-align: center; text-transform: uppercase;
}
.btn.icon-btn { width: 44px; padding: 0; color: var(--muted); }
/* Status line floats under the button so it never shifts the row layout. */
.row-msg { position: absolute; top: calc(100% + 8px); right: 0; margin: 0; font-size: 12px; color: var(--dim); white-space: nowrap; animation: fade .2s; }
.row-msg:empty { display: none; }
.row-msg.ok { color: var(--dim); }
.row-msg .tick { color: var(--ok); }
.row-msg .spin {
  display: inline-block; width: 9px; height: 9px; margin-right: 2px; vertical-align: -1px;
  border: 1.5px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: row-spin .8s linear infinite;
}
@keyframes row-spin { to { transform: rotate(360deg); } }
.row-msg.err { color: var(--danger); }
.work.flash { background: var(--bg-3); transition: background 1.2s; }

/* ---------- about / contact ---------- */
.about .section-head { margin-bottom: 20px; }
.about p {
  max-width: 620px; margin: 0; white-space: pre-line;
  font-size: 17px; font-weight: 300; font-style: italic; line-height: 1.7; color: var(--muted);
}
.about p::before { content: "\201C"; }
.about p::after { content: "\201D"; }
.about p:empty { display: none; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg-2); }
.step b { display: block; font-family: var(--mono); color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.step span { color: var(--muted); font-size: 14px; }
.contact-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.contact-links a {
  display: flex; justify-content: space-between; align-items: center;
  font-size: clamp(24px, 4vw, 40px); letter-spacing: -0.03em; font-weight: 600;
  padding: 18px 0; border-bottom: 1px solid var(--line); transition: color .15s, padding .2s;
}
.contact-links a:hover { color: var(--accent); padding-left: 10px; }
.contact-links a .arrow { color: var(--dim); font-size: 24px; transition: color .15s, transform .2s; }
.contact-links a:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.link-end { display: flex; align-items: center; gap: 20px; min-width: 0; }
.link-detail { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-links a:hover .link-detail { color: var(--muted); }
@media (max-width: 560px) { .link-detail { display: none; } }
footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.to-top:hover { color: var(--text); }

/* ---------- modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(440px, 100%); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 20px; padding: 28px; position: relative; animation: rise .2s;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.modal .close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: .18em; text-align: center; text-transform: uppercase; padding: 14px; }
.msg { font-size: 14px; margin: 12px 0 0; min-height: 20px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.modal form .btn[type=submit] { width: 100%; margin-top: 16px; }

@media (max-width: 760px) {
  .nav-links { gap: 18px; }
  .hero { padding: 72px 0 64px; }
  .works { --bleed: 12px; }
  .work { grid-template-columns: 48px 1fr; gap: 16px; }
  .work .num { display: none; }
  .work .icon { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
  .work .action { grid-column: 1 / -1; align-items: stretch; }
  .work .action .dl-btn { width: 100%; }
  .code-form .code-inline { flex: 1; width: auto; min-width: 0; }
  .row-msg { position: static; margin-top: 8px; white-space: normal; }
  .steps { grid-template-columns: 1fr; }
}

/* ---------- custom dropdown (select.js) ---------- */
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.sel-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.sel-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 14px; font: 15px var(--font); text-align: left; cursor: pointer; transition: border-color .15s;
}
.sel-btn:hover { border-color: var(--dim); }
.sel-btn:focus-visible, .sel-btn.open { outline: none; border-color: var(--accent); }
.sel-btn.placeholder .sel-label { color: var(--dim); }
.sel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-chev { display: grid; place-items: center; color: var(--muted); flex: none; transition: transform .2s; }
.sel-btn.open .sel-chev { transform: rotate(180deg); color: var(--accent); }
.sel-list {
  position: fixed; z-index: 100; overflow-y: auto; padding: 6px;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: sel-in .12s ease-out;
}
@keyframes sel-in { from { opacity: 0; transform: translateY(-4px); } }
.sel-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap;
}
.sel-opt.placeholder { color: var(--dim); }
.sel-opt.active { background: var(--line-2); }
.sel-opt[aria-selected="true"] { color: var(--accent); }
.sel-opt[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.sel-check { display: grid; place-items: center; visibility: hidden; color: var(--accent); }
.sel-opt[aria-selected="true"] .sel-check { visibility: visible; }

input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
