:root {
  --bg: #07080a; --fg: #ece9e2; --muted: #8b8984; --line: rgba(255,255,255,.09); --card: rgba(22,23,26,.72);
  --glass: rgba(14,15,18,.66); --accent: #d6ff74;
  --font-display: "Geist", system-ui, sans-serif; --font-body: "Geist", system-ui, sans-serif; --font-mono: "Geist Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --radius: 14px; --maxw: 1240px; --live: #9bd16a;
  color-scheme: dark;
  /* theme channels (r,g,b) used across the aquarium CSS */
  --bg-c: 7,8,10; --surf-c: 11,12,15; --surf2-c: 42,43,47; --ink-c: 255,255,255;
  --acc-c: 214,255,116; --cli-c: 185,196,221; --figma: #c99bff; --fg2: #cfccc5; --fg-hi: #fff;
}
:root[data-theme="light"] {
  --bg: #f6f4ef; --fg: #17181b; --fg2: #45464a; --muted: #6d6b66; --line: rgba(20,20,24,.1); --card: rgba(255,255,255,.75);
  --glass: rgba(255,255,255,.7); --accent: #4d7c0f; --live: #3f7d1c;
  --bg-c: 246,244,239; --surf-c: 255,255,255; --surf2-c: 226,223,216; --ink-c: 20,20,24;
  --acc-c: 77,124,15; --cli-c: 70,86,124; --figma: #7c3aed; --fg-hi: #000;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
#tank { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: opacity .8s; }
main, #case, .bar, #contact { position: relative; z-index: 1; }
::selection { background: #ff7a2f; color: #000; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 12px 16px; }
@media (min-width: 720px) { .bar { padding: 14px 28px; } }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 14px var(--font-mono); }
.logo-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--fg); color: var(--bg); font: 600 17px var(--font-display); }
.tank-picker { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tank-picker button { display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font: 500 12px var(--font-mono); padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tank-picker button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .5; transition: opacity .2s, box-shadow .2s; }
.tank-picker button:hover { color: var(--fg); }
.tank-picker button[aria-pressed="true"] { background: rgba(var(--ink-c),.08); color: var(--fg); }
.tank-picker button[aria-pressed="true"] i { opacity: 1; box-shadow: 0 0 10px var(--c); }
.links { display: flex; gap: 4px; align-items: center; }
.links a { text-decoration: none; font: 500 14px var(--font-body); padding: 8px 12px; border-radius: 10px; color: var(--muted); }
.links a:hover { color: var(--fg); }
.links .cta { background: var(--fg); color: var(--bg); }
.links .cta:hover { color: var(--bg); background: var(--fg-hi); }
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; }
  .tank-picker { order: 3; width: 100%; justify-content: space-between; }
  .links a:not(.cta) { display: none; }
}

/* hero */
.hero { max-width: 980px; margin: 0 auto; padding: clamp(56px, 14vh, 150px) 16px 72px; text-align: center; display: grid; justify-items: center; gap: 22px; min-height: calc(100vh - 70px); align-content: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 0 6px rgba(var(--ink-c),.03), 0 0 60px rgba(var(--acc-c),.25); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.greet { margin: 0; font: 500 13px var(--font-mono); color: var(--muted); letter-spacing: .02em; }
.hero h1 { margin: 0; font: 400 clamp(40px, 7vw, 92px)/1.0 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--fg-hi); }
.lede { margin: 0; max-width: 56ch; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); text-wrap: balance; }
.ask { margin-top: 18px; width: min(640px, 100%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-radius: 16px; background: var(--glass); border: 1px solid rgba(var(--ink-c),.12); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(var(--ink-c),.06); transition: border-color .2s, box-shadow .2s; }
.ask:focus-within { border-color: rgba(var(--ink-c),.28); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 4px rgba(var(--ink-c),.04); }
.ask-icon { color: var(--muted); font-size: 18px; }
.ask input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg); font: 400 16px var(--font-body); padding: 12px 0; }
.ask input::placeholder { color: var(--muted); }
.ask kbd { font: 500 12px var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
@media (max-width: 600px) { .ask kbd { display: none; } }
.ask-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ask-hints button { font: 500 12px var(--font-mono); color: var(--muted); background: rgba(var(--ink-c),.03); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; backdrop-filter: blur(8px); }
.ask-hints button:hover, .ask-hints button.on { color: var(--fg); border-color: rgba(var(--ink-c),.25); }

/* work */
.work { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .work { padding: 0 28px; } }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin: 72px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sec-head h2 { margin: 0; font: 500 13px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.sec-head p { margin: 0; color: var(--muted); font-size: 14px; }
.card { position: relative; display: grid; text-decoration: none; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: rgba(var(--ink-c),.2); }
.card:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.card-img { aspect-ratio: 16/10; overflow: hidden; background: var(--p-accent); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card h3 { margin: 0; font: 600 22px/1.15 var(--font-display); letter-spacing: -.02em; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--font-mono); padding: 6px 9px; border-radius: 8px; background: rgba(var(--bg-c),.72); backdrop-filter: blur(10px); color: var(--accent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.grid-new { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-new { grid-template-columns: 1fr 1fr; } .grid-new .card:first-child { grid-column: 1 / -1; } .grid-new .card:first-child .card-img { aspect-ratio: 21/9; } .grid-new .card:first-child h3 { font-size: 30px; } }
.grid-new .card-img img[src*="groupama"] { object-fit: cover; object-position: 50% 0; }
.grid-work { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.list-archive { display: grid; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .25s, background .25s; }
.row:hover { padding-left: 14px; background: rgba(var(--ink-c),.025); }
.row b { font: 500 18px var(--font-display); }
.row span { color: var(--muted); font-size: 14px; }
.row small { font: 500 12px var(--font-mono); color: var(--muted); grid-row: span 2; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
.empty button { background: none; border: 0; color: var(--fg); text-decoration: underline; cursor: pointer; font: inherit; }
[data-hide] { display: none !important; }

/* about */
.about { max-width: var(--maxw); margin: 120px auto 0; padding: 0 16px; display: grid; gap: 40px; }
@media (min-width: 720px) { .about { padding: 0 28px; } }
@media (min-width: 980px) { .about { grid-template-columns: 1fr 1fr; gap: 64px; } }
.about-panel { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 36px); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.about h2 { margin: 0 0 18px; font: 400 clamp(34px, 4.4vw, 56px)/1.02 var(--serif); letter-spacing: -.01em; }
.about p { color: var(--fg2); font-size: 16.5px; line-height: 1.7; margin: 0 0 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-top: 20px; }
.facts div { border-top: 1px solid var(--line); padding: 10px 0; }
.facts dt { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 14px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 76px 1fr; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.tl time { font: 500 12px var(--font-mono); color: var(--muted); padding-top: 3px; }
.tl b { font-weight: 600; } .tl span { grid-column: 2; color: var(--muted); font-size: 14px; }
.skills { display: grid; gap: 14px; margin-top: 26px; }
.skills h3 { margin: 0 0 8px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: rgba(var(--ink-c),.05); border: 1px solid var(--line); }

/* contact */
.contact { max-width: var(--maxw); margin: 140px auto 0; padding: 0 16px 48px; text-align: center; display: grid; justify-items: center; gap: 18px; }
.contact h2 { margin: 0; font: 400 clamp(48px, 9vw, 128px)/.95 var(--serif); letter-spacing: -.02em; }
.contact h2 em { font-style: italic; }
.contact p { color: var(--muted); margin: 0; max-width: 46ch; }
.contact .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.btn { text-decoration: none; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); font-weight: 500; }
.btn.primary { background: var(--fg); color: var(--bg); border-color: transparent; }
.btn:hover { border-color: rgba(var(--ink-c),.3); }
.foot { margin-top: 60px; font: 500 12px var(--font-mono); color: var(--muted); }

/* case-study skin */
#case { padding-top: 8px; }
#case .cs { background: linear-gradient(rgba(var(--bg-c),.0), rgba(var(--bg-c),.0)); }
.cs-hero, .cs-sec-text { position: relative; }
.cs-title { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }
.cs-sec-text h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 42px); letter-spacing: -.01em; }
.cs-sec-text, .cs-hero { background: rgba(var(--bg-c),.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 18px; padding: 18px; margin: 0 -18px; }
.cs-demo, .cs-demo-row { --demo-bg: rgba(var(--bg-c),.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.cs-pager b { font-family: var(--serif); font-weight: 400; }
.cs-live { color: var(--accent); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
.hero h1, .lede, .greet, .sec-head, .row, .contact h2, .contact p { text-shadow: 0 0 18px rgb(var(--bg-c)), 0 0 6px rgb(var(--bg-c)), 0 0 2px rgb(var(--bg-c)); }
.bar::before { content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(rgb(var(--bg-c)) 45%, rgba(var(--bg-c),0)); pointer-events: none; }

/* ask panel */
.ask-hints button.q { border-style: dashed; color: var(--fg2); }
.ask-group { position: relative; width: min(640px, 100%); display: grid; justify-items: center; gap: 22px; margin-top: 18px; }
.ask-group .ask { margin-top: 0; }
.ans { position: absolute; z-index: 30; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; text-align: left; border-radius: 18px; background: rgba(var(--bg-c),.86); border: 1px solid rgba(var(--ink-c),.14); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 40px 90px -40px #000; padding: 14px; display: grid; gap: 12px; animation: ansIn .35s cubic-bezier(.2,.7,.2,1); }
@keyframes ansIn { from { opacity: 0; transform: translateY(-6px); } }
.ans-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ans-you { align-self: flex-end; margin-left: auto; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--fg); color: rgb(var(--bg-c)); font-size: 14px; max-width: 80%; }
.ans-x { order: -1; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.ans-x:hover { color: var(--fg-hi); border-color: rgba(var(--ink-c),.3); }
.ans-a { display: flex; gap: 10px; align-items: flex-start; }
.ans-a img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; }
.ans-text { margin: 0; padding: 10px 13px; border-radius: 4px 14px 14px 14px; background: rgb(var(--surf-c)); color: var(--fg); font-size: 15px; line-height: 1.55; min-height: 1.55em; }
.ans-k { font: 500 12px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ans-k b { color: var(--accent); font-weight: 500; }
.ans-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ans-card { position: relative; display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--ink-c),.02); text-decoration: none; transition: border-color .2s, background .2s; }
.ans-card:hover { border-color: rgba(var(--ink-c),.28); background: rgba(var(--ink-c),.05); }
.ans-thumb { width: 64px; aspect-ratio: 16/10; border-radius: 7px; overflow: hidden; flex: none; background: var(--p-accent); }
.ans-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ans-t { min-width: 0; display: grid; } .ans-t b { font-weight: 600; font-size: 14px; } .ans-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ans-card em { position: absolute; top: 6px; right: 8px; font: 500 10px var(--font-mono); font-style: normal; color: var(--accent); }
.ans-more, .ans-none { font-size: 14px; color: var(--muted); }
.ans-none button { font: 500 12px var(--font-mono); background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 4px 9px; cursor: pointer; margin: 2px; }
.ans-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.ans-foot a { font: 500 13px var(--font-mono); text-decoration: none; color: var(--muted); }
.ans-foot a:hover { color: var(--fg-hi); }
.ans-cta { color: rgb(var(--bg-c)) !important; background: var(--accent); padding: 6px 10px; border-radius: 8px; }
.ans-foot .ans-all { margin-left: auto; }
.ans.up { top: auto; bottom: calc(100% + 12px); animation-name: ansUp; }
@keyframes ansUp { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ansIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ans-more { justify-self: start; font: 500 13px var(--font-mono); color: var(--fg); background: rgba(var(--ink-c),.05); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.ans-more:hover { border-color: rgba(var(--ink-c),.3); }
.ans.up .ans-a, .ans.up .ans-top { }

/* creature toggle */
.tank-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: pointer; font: 500 12px var(--font-mono); color: var(--muted); }
.tank-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tt-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 8px; background: rgba(var(--ink-c),.09); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.tank-toggle[aria-checked="true"] .tt-thumb { transform: translateX(100%); }
.tt-opt { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; transition: color .25s; }
.tt-opt i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .45; transition: opacity .25s, box-shadow .25s; }
.tank-toggle[aria-checked="false"] .tt-opt[data-mode="koi"], .tank-toggle[aria-checked="true"] .tt-opt[data-mode="jellies"] { color: var(--fg); }
.tank-toggle[aria-checked="false"] .tt-opt[data-mode="koi"] i, .tank-toggle[aria-checked="true"] .tt-opt[data-mode="jellies"] i { opacity: 1; box-shadow: 0 0 10px var(--c); }
@media (max-width: 860px) { .bar { flex-wrap: nowrap; } .tank-toggle { order: 0; } .tt-opt { padding: 7px 9px; } }
@media (max-width: 400px) { .logo span:not(.logo-mark) { display: none; } }

.ans[hidden] { display: none !important; }

/* theme toggle (sun/moon) */
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; margin-right: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); cursor: pointer; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.theme-toggle:hover { color: var(--fg); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
.links .cta { white-space: nowrap; }
@media (max-width: 420px) { .theme-toggle { width: 32px; height: 32px; margin-right: 0; } .links a.cta { padding: 8px 10px; } }

/* Work and About stay visible on phones; tighten the bar instead */
@media (max-width: 860px) { .links a:not(.cta) { display: inline-block; } }
@media (max-width: 720px) {
  .links a:not(.cta) { padding: 8px 8px; font-size: 13.5px; }
  .logo span:not(.logo-mark) { display: none; }
}
@media (max-width: 360px) { .links a:not(.cta) { padding: 8px 6px; } .links { gap: 2px; } }
