:root, [data-theme="dark"] {
  --bg: #0e1420; --surface: #151d2e; --surface-2: #1c2639; --line: #263249;
  --text: #e8ecf4; --muted: #98a5bf; --on-accent: #0e1420;
  --blue: #7ea4e8; --amber: #e3bb74; --teal: #68c7b2; --lav: #a99fe6; --coral: #ea9d8a;
  --blue-bg: #16233b; --amber-bg: #29241a; --teal-bg: #12292a; --lav-bg: #1f1d37; --coral-bg: #2c2020;
  --brand: #3a5a94;
}
[data-theme="light"] {
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #eaedf4; --line: #dde2ec;
  --text: #18213a; --muted: #5d6985; --on-accent: #ffffff;
  --blue: #3a5a94; --amber: #8a6212; --teal: #1d7566; --lav: #5a4fb0; --coral: #b0503c;
  --blue-bg: #e5ecf8; --amber-bg: #f7eedb; --teal-bg: #def0ed; --lav-bg: #eae7f9; --coral-bg: #f8e5e0;
}
:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px; --gut: clamp(18px, 4vw, 36px);
  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background 0.2s, color 0.2s; }
a { color: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
[data-accent="blue"] { --a: var(--blue); --a-bg: var(--blue-bg); }
[data-accent="amber"] { --a: var(--amber); --a-bg: var(--amber-bg); }
[data-accent="teal"] { --a: var(--teal); --a-bg: var(--teal-bg); }
[data-accent="lav"] { --a: var(--lav); --a-bg: var(--lav-bg); }
[data-accent="coral"] { --a: var(--coral); --a-bg: var(--coral-bg); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 30; padding-top: 14px; }
.bar-in { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 10px; display: block; }
.bar nav { display: flex; align-items: center; gap: 4px; }
.bar nav a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--muted); padding: 9px 14px; border-radius: 999px; transition: background 0.15s, color 0.15s; }
.bar nav a:hover { background: var(--surface-2); color: var(--text); }
.bar nav a.on { color: var(--text); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background 0.15s; }
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 26px; border: 0; border-radius: 999px; font: 700 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: filter 0.15s, background 0.15s, transform 0.15s; }
.btn-fill { background: var(--a, var(--blue)); color: var(--on-accent); }
.btn-fill:hover { filter: brightness(1.08); }
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-soft:hover { background: var(--line); }
.btn.is-off { opacity: 0.45; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--a-bg, var(--surface)); color: var(--a, var(--muted)); font: 700 13px/1 var(--sans); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
h1 { margin: 22px 0 22px; font-weight: 800; font-size: clamp(52px, 10vw, 124px); line-height: 0.96; letter-spacing: -0.05em; }
h1 .cur { color: var(--amber); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 0 0 32px; max-width: 540px; font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--muted); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 40px; aspect-ratio: 1; width: 100%; max-width: 400px; justify-self: end; display: grid; place-items: center; padding: 8%; }
.mark { width: 100%; height: auto; display: block; }
.mark .j { fill: var(--blue); }
.mark .u { fill: var(--amber); }
.hero.sub h1 { font-size: clamp(44px, 8vw, 96px); }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.back:hover { color: var(--text); }

/* sections */
.block { padding: clamp(36px, 6vw, 72px) 0; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: clamp(22px, 3.4vw, 36px); }
h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; }
.head p { margin: 0; color: var(--muted); }
h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }

/* project cards */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 250px; padding: clamp(22px, 3vw, 32px); background: var(--a-bg); border: 1px solid transparent; border-radius: var(--r-lg); text-decoration: none; color: var(--text); transition: transform 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-3px); border-color: var(--a); }
.card .name { margin: 16px 0 6px; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; }
.card p { margin: 0; color: var(--muted); max-width: 440px; }
.card .go { position: absolute; right: clamp(18px, 2.4vw, 26px); bottom: clamp(18px, 2.4vw, 26px); width: 46px; height: 46px; border-radius: 50%; background: var(--a); color: var(--on-accent); display: grid; place-items: center; font-size: 22px; line-height: 1; transform: rotate(-45deg); transition: transform 0.2s; }
.card:hover .go { transform: rotate(0); }
.c1 { grid-column: span 4; flex-direction: row; align-items: stretch; gap: 24px; }
.c1 .txt { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-width: 0; padding-bottom: 54px; }
.c1 .shot { flex: 1.05; min-width: 0; align-self: center; border-radius: var(--r-md); border: 1px solid var(--line); width: 100%; height: auto; }
.c2 { grid-column: span 2; }
.c3, .c4, .c5 { grid-column: span 2; }
.card .tag { margin-left: 10px; padding: 3px 9px; border-radius: 999px; background: var(--a); color: var(--on-accent); font: 800 11px/1 var(--sans); letter-spacing: 0.06em; vertical-align: middle; position: relative; top: -3px; }

.tg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(26px, 4vw, 48px); background: var(--blue-bg); border-radius: var(--r-lg); }
.tg h2 { margin-bottom: 8px; }
.tg p { margin: 0; color: var(--muted); max-width: 460px; }
.tg .link { display: block; margin-top: 18px; font-size: clamp(20px, 3vw, 30px); font-weight: 800; letter-spacing: -0.03em; color: var(--blue); text-decoration: none; }
.tg .link:hover { text-decoration: underline; text-underline-offset: 6px; }

/* download page */
.dl { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.panel { display: flex; flex-direction: column; gap: 18px; padding: clamp(24px, 3vw, 34px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.panel.tinted { background: var(--a-bg); border-color: transparent; }
.panel h3 { font-size: 26px; }
.panel p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font: 500 13px/1 var(--mono); color: var(--text); }
.note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li { padding: 26px 24px 28px; border-radius: var(--r-md); background: var(--a-bg); }
.steps .big { display: block; font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; color: var(--a); margin-bottom: 18px; }
.steps p { margin: 0; font-size: 16px; }
.feat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.feat li { padding: 24px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.feat li::before { content: ""; display: block; width: 12px; height: 12px; margin-bottom: 18px; border-radius: 50%; background: var(--a); }
.feat h3 { font-size: 18px; margin-bottom: 8px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.keys { margin: 0; padding: 8px 8px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.keys li { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: center; padding: 16px 20px; }
.keys li + li { border-top: 1px solid var(--line); }
kbd { display: inline-block; margin-right: 4px; padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font: 500 13px/1.4 var(--mono); color: var(--text); }
.shot-hero { width: 100%; height: auto; display: block; border-radius: var(--r-lg); border: 1px solid var(--line); }
.shot-wide { display: block; width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); }
.caption { margin: 12px 4px 0; font-size: 14px; color: var(--muted); }

.foot { margin-top: clamp(32px, 6vw, 72px); border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 28px; padding-bottom: 36px; font-size: 15px; color: var(--muted); }
.foot .brand { color: var(--text); font-size: 16px; margin-right: 0; }
.foot .brand img { width: 28px; height: 28px; border-radius: 8px; }
.foot .sp { margin-left: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
img.emoji { width: 1.15em; height: 1.15em; margin: 0 0.04em; vertical-align: -0.2em; display: inline-block; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .tile { justify-self: start; max-width: 260px; order: -1; }
  .bento { grid-template-columns: 1fr 1fr; }
  .c1 { grid-column: span 2; flex-direction: column; }
  .c1 .txt { padding-bottom: 0; }
  .c2, .c3, .c4, .c5 { grid-column: span 1; }
  .dl { grid-template-columns: 1fr; }
  .steps, .feat { grid-template-columns: 1fr 1fr; }
  .keys li { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .c1, .c2, .c3, .c4, .c5 { grid-column: span 1; }
  .card { min-height: 210px; }
  .steps, .feat { grid-template-columns: 1fr; }
  .bar nav a:not(.keep) { display: none; }
}
@media (prefers-reduced-motion: reduce) { h1 .cur { animation: none; } * { transition: none !important; scroll-behavior: auto !important; } }
