/* daiuski.dev — design tokens extracted from HANDOFF.md §1.
   The prototype used inline styles for streaming reasons; this is the production form. */

:root {
  --bg: #0b0b0c;
  --surface: #000;
  --accent: #3ad0de;
  --accent-hover: #7ee3ed;
  --accent-on-light: #12a6b6;
  --text: #f4f4f2;
  --text-muted: #a0a0a4;
  --text-dim: #76767a;
  --text-dimmer: #87878c;
  --border: #1c1c20;
  --border-strong: #26262a;
  --accent-wash: #08181a;
  --danger: #ff7a7a;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::selection { background: rgba(58, 208, 222, 0.25); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img, video { max-width: 100%; }

@keyframes blink   { 0%, 55% { opacity: 1; } 55.01%, 100% { opacity: 0.15; } }
@keyframes floatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulseDot{ 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }
@keyframes scan    { 0% { transform: translateY(-100%); } 100% { transform: translateY(300%); } }

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.caret {
  display: inline-block; width: 8px; height: 15px; background: var(--accent);
  animation: blink 1.5s steps(1, end) infinite; vertical-align: -2px;
}
.float-in { animation: floatIn 0.7s var(--ease) both; }

/* Below-fold reveals: one IntersectionObserver, unobserved after firing. */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible { animation: floatIn 0.6s var(--ease) both; opacity: 1; transform: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  background: rgba(11, 11, 12, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: 34px; display: block; border: 1px solid var(--border-strong); }
.brand-name { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: -0.02em; color: var(--text); }
.brand-name .lead { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 22px; font-family: var(--mono); font-size: 13px; }
.nav a, .nav button {
  color: var(--text-muted); background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer; transition: color 0.2s;
}
.nav a:hover, .nav button:hover { color: var(--text); }
.nav .is-active { color: var(--text); border-bottom: 1px solid var(--accent); padding-bottom: 3px; }
.nav .cta {
  color: #000; background: var(--accent); padding: 9px 16px;
  border-radius: 14px; font-weight: 700;
}
.nav .cta:hover { color: #000; background: var(--accent-hover); }

.mobile-bar { display: none; align-items: center; gap: 10px; }
.mobile-bar .cta {
  display: inline-flex; align-items: center; height: 40px; padding: 0 15px;
  border-radius: 14px; background: var(--accent); color: #000;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border-radius: 14px;
  border: 1px solid var(--border-strong); background: transparent;
  cursor: pointer; transition: border-color 0.25s;
}
.burger:hover { border-color: var(--accent); }
.burger span { display: flex; flex-direction: column; gap: 4px; width: 17px; }
.burger span i { height: 1.5px; background: var(--text); display: block; }

.mobile-menu {
  position: sticky; top: 61px; z-index: 49;
  background: rgba(11, 11, 12, 0.97); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 8px var(--gutter) 18px;
  display: flex; flex-direction: column;
  font-family: var(--mono); font-size: 14px;
}
.mobile-menu a { color: var(--text-muted); padding: 12px 0; border-bottom: 1px solid var(--border); }
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu[hidden] { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .mobile-bar { display: flex; }
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--shell); margin: 0 auto;
  padding: clamp(48px, 8vw, 84px) var(--gutter) 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 48px 56px; align-items: center;
}
.status-pill {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.05em; margin-bottom: 24px;
}
.status-pill::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.hero h1 {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(32px, 7.4vw, 52px); line-height: 1.05; letter-spacing: -0.04em;
  margin: 0 0 20px; text-wrap: pretty;
}
.hero h1 .nowrap { white-space: nowrap; }
.hero-sub {
  margin: 0 0 30px; font-size: 16px; line-height: 1.6;
  color: var(--text-muted); max-width: 34ch; text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px;
  border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700;
  transition: transform 0.25s var(--ease), background 0.2s;
}
.btn-primary:hover { color: var(--bg); background: #fff; transform: translateY(-2px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px;
  border-radius: 12px; border: 1px solid var(--border-strong); color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

/* ---------- code card ---------- */
.code-card {
  position: relative; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); overflow: hidden;
  animation: floatIn 0.8s 0.08s var(--ease) both;
}
.code-chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--text-dimmer);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 8px; height: 8px; background: var(--border-strong); display: block; }
.code-dots i:last-child { background: var(--accent); }
.code-body {
  position: relative; padding: 22px 20px 24px;
  font-family: var(--mono); font-size: 13px; line-height: 1.85;
  color: var(--text); overflow-x: auto;
}
.code-body .line { white-space: pre; }
.code-body .cm { color: var(--text-dimmer); }   /* comment */
.code-body .kw { color: var(--accent-on-light); } /* keyword */
.code-body .fn { color: var(--accent); }          /* function / literal */
.code-body .op { color: var(--text-dim); }        /* operator */
.code-body .st { color: var(--text-muted); }      /* string */
.code-scan {
  position: absolute; inset-inline: 0; top: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(58, 208, 222, 0.05), transparent);
  animation: scan 6s linear infinite; pointer-events: none;
}

/* ---------- stats + stack ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; margin-top: 22px;
}
.stat { background: var(--surface); padding: 26px 24px; transition: background 0.3s; }
.stat:hover { background: #050c0d; }
.stat-value {
  font-family: var(--mono); font-weight: 700; font-size: 38px;
  letter-spacing: -0.04em; line-height: 1;
}
.stat:first-child .stat-value { color: var(--accent); }
.stat-value .suffix { color: var(--accent); }
.stat-label {
  margin-top: 10px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dimmer);
}
.stack { display: flex; align-items: center; gap: 14px; padding: 30px 0 0; margin-top: 12px; flex-wrap: wrap; }
.stack-label {
  font-family: var(--mono); font-size: 10px; color: var(--text-dimmer);
  letter-spacing: 0.18em; text-transform: uppercase; margin-right: 6px;
}
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--text-muted);
  padding: 7px 12px; border-radius: 12px; border: 1px solid var(--border);
  transition: color 0.25s, border-color 0.25s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- work ---------- */
.section { max-width: var(--shell); margin: 0 auto; padding: 68px var(--gutter) 40px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 30px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--mono); font-weight: 700; font-size: 30px;
  letter-spacing: -0.03em; margin: 0;
}
.count-label { font-family: var(--mono); font-size: 12px; color: var(--text-dimmer); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.tab .n { font-size: 11px; opacity: 0.75; }

.panel[hidden] { display: none; }
.grid {
  display: grid; gap: 20px; padding-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.card {
  display: block; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); overflow: hidden; color: var(--text);
  transition: transform 0.35s var(--ease), border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
a.card:hover {
  color: var(--text); transform: translateY(-6px); border-color: var(--accent);
  background: #050c0d; box-shadow: 0 12px 40px -18px rgba(58, 208, 222, 0.55);
}
.card-media {
  position: relative; aspect-ratio: 16 / 9; background-color: #0e0e11;
  background-image: repeating-linear-gradient(135deg, #111116 0 8px, #0c0c10 8px 16px);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .slot {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dimmer);
  border: 1px dashed var(--border-strong); padding: 7px 11px;
}
.card-body { padding: 18px 18px 20px; }
.card-body h3 {
  margin: 0 0 8px; font-family: var(--mono); font-weight: 700;
  font-size: 16px; letter-spacing: -0.02em;
}
.card-body p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 20px; font-family: var(--mono); font-size: 11px; color: var(--text-dim);
}
.card-foot .meta-accent { color: var(--accent); font-size: 14px; font-weight: 700; }
.card-foot .visit { color: var(--accent); }

.empty-state {
  margin-top: 28px; border: 1px dashed var(--border-strong); border-radius: 14px;
  padding: 64px 24px; text-align: center; font-family: var(--mono);
  font-size: 13px; color: var(--text-muted);
}

/* ---------- socials ---------- */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; padding-top: 28px; }
.social-card { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.social-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px;
  border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px;
}
.social-head img { width: 15px; height: 15px; display: block; }
.social-head a { color: var(--text); }
.social-head a:hover { color: var(--accent); }
.social-head .right { margin-left: auto; color: var(--text-dimmer); font-size: 11px; }
.social-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.tweet { border: 1px solid var(--border-strong); border-radius: 14px; padding: 16px; font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.tweet time { display: block; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.yt-lite {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border-strong); cursor: pointer; display: block; background: #000;
}
.yt-lite img { width: 100%; height: 100%; object-fit: cover; }
.yt-lite .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.yt-lite .play::after {
  content: ""; width: 54px; height: 38px; border-radius: 10px;
  background: rgba(11, 11, 12, 0.78); border: 1px solid var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.yt-lite iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- contact ---------- */
.contact-card {
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
  padding: clamp(28px, 5vw, 52px) clamp(22px, 4vw, 44px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(28px, 4vw, 44px); align-items: center;
}
.eyebrow {
  display: flex; align-items: center; gap: 10px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dimmer); margin-bottom: 16px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulseDot 2.4s ease-in-out infinite; }
.contact-card h2 {
  font-family: var(--mono); font-weight: 700; font-size: 34px;
  line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 14px;
}
.contact-card > div > p { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: var(--text-muted); max-width: 38ch; }
.terms {
  display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono);
  font-size: 11.5px; color: var(--text-dimmer); letter-spacing: 0.04em;
}
.terms .sep { color: var(--border-strong); }
.contact-actions { display: flex; flex-direction: column; gap: 14px; }
.email-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border: 1px solid var(--border-strong); border-radius: 14px;
  font-family: var(--mono); font-size: 14px; color: var(--text);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.email-row:hover { color: var(--text); border-color: var(--accent); background: var(--accent-wash); transform: translateY(-2px); }
.email-row .action { color: var(--accent); font-size: 12px; }
.social-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 10px; border: 1px solid var(--border-strong); border-radius: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  transition: border-color 0.25s, transform 0.25s var(--ease), color 0.25s;
}
.tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }
.tile img, .tile svg { width: 22px; height: 22px; display: block; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 44px; align-items: start; }
.about-avatar { width: 92px; height: 92px; display: block; border: 1px solid var(--border-strong); border-radius: 14px; margin-bottom: 20px; }
.about-grid p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.7; color: var(--text); max-width: 46ch; text-wrap: pretty; }
.about-grid p + p { font-size: 15px; color: var(--text-muted); }
.kv {
  display: flex; flex-direction: column; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden; font-family: var(--mono);
}
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; background: var(--surface); font-size: 13px; }
.kv-row .k { color: var(--text-dimmer); }

/* ---------- devlog ---------- */
.devlog-wrap { max-width: 900px; margin: 0 auto; padding: clamp(56px, 9vw, 84px) var(--gutter) 40px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-muted); font-family: var(--mono); font-size: 12px;
  cursor: pointer; transition: border-color 0.22s, color 0.22s; margin-bottom: 34px;
}
.back-btn:hover { border-color: var(--accent); color: var(--text); }
.devlog-wrap h1 {
  font-family: var(--mono); font-weight: 700; font-size: clamp(30px, 7vw, 44px);
  line-height: 1.05; letter-spacing: -0.04em; margin: 0 0 16px;
}
.devlog-intro { margin: 0 0 40px; font-size: 16px; line-height: 1.65; color: var(--text-muted); max-width: 52ch; text-wrap: pretty; }
.post-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.post-row {
  display: flex; flex-direction: column; gap: 7px; padding: 24px 8px;
  border-bottom: 1px solid var(--border); font-family: var(--mono); color: var(--text);
  transition: background 0.25s, padding-left 0.25s var(--ease);
}
.post-row:hover { color: var(--text); background: var(--accent-wash); padding-left: 18px; }
.post-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 11px; color: var(--text-dimmer); letter-spacing: 0.04em; }
.post-row .meta .sep { color: var(--border-strong); }
.post-row .meta .updates { color: var(--accent); }
.post-row .title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }

.post-header { margin-bottom: 34px; }
.post-cover { aspect-ratio: 16/9; width: 100%; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); margin-top: 24px; }
.timeline { border-left: 1px solid var(--border); padding-left: 26px; margin-left: 4px; display: flex; flex-direction: column; gap: 44px; }
.tl-entry { position: relative; }
.tl-entry::before {
  content: ""; position: absolute; left: -30px; top: 6px;
  width: 9px; height: 9px; background: var(--accent);
}
.tl-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dimmer); margin-bottom: 12px; }
.tl-entry h2 { font-family: var(--mono); font-size: 20px; letter-spacing: -0.02em; margin: 0 0 12px; }
.prose { font-size: 15.5px; line-height: 1.75; color: var(--text-muted); }
.prose p { margin: 0 0 16px; text-wrap: pretty; }
.prose h2, .prose h3 { font-family: var(--mono); color: var(--text); letter-spacing: -0.02em; margin: 28px 0 12px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; color: var(--text); }
.prose pre { margin: 0 0 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); overflow: hidden; }
.prose pre .chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--text-dimmer);
}
.prose pre code { display: block; padding: 16px 18px; background: none; border: 0; border-radius: 0; overflow-x: auto; line-height: 1.75; }
.prose img { border-radius: 16px; border: 1px solid var(--border); display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.prose blockquote { margin: 0 0 16px; padding-left: 16px; border-left: 2px solid var(--border-strong); color: var(--text-dim); }
.attachment {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border-strong); border-radius: 14px; margin-bottom: 12px;
  font-family: var(--mono); font-size: 13px; color: var(--text);
  transition: border-color 0.25s, background 0.25s;
}
.attachment:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--text); }
.attachment .badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-wash);
  border: 1px solid var(--border-strong); font-size: 10px;
  text-transform: uppercase; color: var(--accent);
}
.attachment .dl { margin-left: auto; color: var(--accent); font-size: 12px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 40px;
  padding: 28px var(--gutter); display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  max-width: var(--shell); margin-inline: auto;
}

/* ---------- motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  .float-in, .reveal, .reveal.is-visible, .code-card { animation: none !important; opacity: 1 !important; transform: none !important; }
  .caret, .code-scan, .eyebrow .dot { animation: none !important; }
  .code-scan { display: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
