:root {
  --bg: #f7f8fb;
  --ink: #14161c;
  --muted: #667085;
  --line: rgba(20, 22, 40, .1);
  --glass: rgba(255, 255, 255, .8);
  --accent: #2f5bff;
  --accent-ink: var(--accent);
  --panel: rgba(255, 255, 255, .75);
  --field: #fff;
  --chip: rgba(20, 22, 40, .05);
  --dot: rgba(20, 22, 40, .09);
  --serif: "Bricolage Grotesque", system-ui, sans-serif; /* display (name kept for admin.js) */
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --peach: #ffd9c7; --mint: #c6f0da; --sky: #cde3ff; --lilac: #e0d4ff; --lemon: #fff0b3; --rose: #ffd1e1;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014; --ink: #eef0f5; --muted: #9aa1b2; --line: rgba(255, 255, 255, .12);
  --glass: rgba(28, 31, 40, .78);
  --accent-ink: color-mix(in srgb, var(--accent) 55%, #fff);
  --panel: rgba(20, 22, 30, .8); --field: #1b1e27; --chip: rgba(255, 255, 255, .08); --dot: rgba(255, 255, 255, .07);
  --peach: #5c3a2c; --mint: #234a39; --sky: #243f63; --lilac: #3d3465; --lemon: #5a5124; --rose: #5c2e43;
}
body, .card, .glass, .top { transition: background-color .25s, border-color .25s, color .25s; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
.mono { font-family: var(--mono); font-size: .72rem; letter-spacing: .01em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 30px -18px rgba(30, 40, 90, .25); padding: 24px; }

.top { position: sticky; top: 12px; z-index: 10; max-width: 1120px; margin: 12px auto 0; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px 10px 20px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); box-shadow: 0 8px 30px -16px rgba(30, 40, 90, .3); width: calc(100% - 32px); }
.brand { font-weight: 700; letter-spacing: -.02em; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { padding: 7px 14px; border-radius: 999px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: .2s; }
.top nav a:hover { color: var(--ink); background: var(--chip); }
.top nav a.btn { background: var(--ink); color: var(--bg); }
.theme { width: 34px; height: 34px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--field); color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer; transition: transform .3s, background .2s; }
.theme:hover { transform: rotate(25deg); }
.top nav a.btn:hover { background: var(--accent); }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.hero { padding: clamp(60px, 11vw, 120px) 0 clamp(44px, 7vw, 70px); text-align: center; display: flex; flex-direction: column; align-items: center; }
h1 { font: 800 clamp(2.8rem, 9vw, 6.4rem)/.98 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.role { color: var(--accent-ink); margin-top: 18px; text-transform: uppercase; letter-spacing: .06em; }
.tagline { max-width: 36ch; font-size: clamp(1.15rem, 2.4vw, 1.55rem); line-height: 1.35; margin-top: 14px; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.hero-links a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 15px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); font-weight: 500; font-size: .92rem; transition: .2s; }
.hero-links a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translateY(-2px); }

/* skills strip */
.skills { margin: 0 -16px; border-block: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow: hidden; }
.skills[hidden] { display: none; }
.marquee ul { display: flex; width: max-content; animation: slide 34s linear infinite; }
.marquee:hover ul { animation-play-state: paused; }
.marquee li { font: 700 clamp(1.1rem, 2.4vw, 1.5rem)/1 var(--serif); letter-spacing: -.02em; padding: 18px 0; white-space: nowrap; }
.marquee li::after { content: ""; display: inline-block; width: .38em; height: .38em; border-radius: 50%; background: var(--accent-ink); margin: 0 1.4em; vertical-align: .12em; }
@keyframes slide { to { transform: translateX(-50%); } }

.block { padding: 80px 0 10px; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
h2 { font: 800 clamp(1.8rem, 4vw, 2.6rem)/1.05 var(--serif); letter-spacing: -.035em; }
.count { color: var(--muted); font-weight: 400; vertical-align: .6em; margin-left: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: 500 .85rem var(--sans); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--muted); cursor: pointer; transition: .2s; }
.filters button:hover { color: var(--ink); border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.enter .card { animation: pop .55s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.card { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: 22px; background: var(--field); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 2px 0 rgba(20, 22, 40, .03); transition: transform .3s cubic-bezier(.2, .9, .3, 1.3), box-shadow .3s; }
.card.go:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 22px 40px -22px rgba(30, 40, 90, .4); }
.thumb { position: relative; height: 160px; background: var(--c); overflow: hidden; }
.thumb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 16px 16px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live { z-index: 1; position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #14161c; font: 500 .62rem var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #26c281; }
.year { z-index: 1; position: absolute; top: 14px; right: 14px; font: 500 .66rem var(--mono); color: var(--ink); opacity: .6; }
.body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font: 700 1.3rem/1.15 var(--serif); letter-spacing: -.025em; display: flex; justify-content: space-between; gap: 10px; }
.card p { color: var(--muted); margin-top: 8px; font-size: .95rem; line-height: 1.45; }
.arrow { color: var(--accent-ink); display: inline-block; transition: transform .3s; }
.socials a:hover .arrow { transform: translate(3px, -3px); }
.plinks { display: flex; gap: 8px; margin-top: 16px; }
.pbtn { position: relative; z-index: 2; font: 600 .82rem var(--sans); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); transition: .2s; }
.pbtn:hover { border-color: var(--ink); }
.pbtn.visit { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pbtn.visit:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pbtn.visit::after { content: ""; position: absolute; inset: -9999px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.tags li, .chips li { font: 400 .62rem var(--mono); padding: 4px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.empty { color: var(--muted); grid-column: 1 / -1; }
[data-c="peach"] { --c: var(--peach); } [data-c="mint"] { --c: var(--mint); } [data-c="sky"] { --c: var(--sky); }
[data-c="lilac"] { --c: var(--lilac); } [data-c="lemon"] { --c: var(--lemon); } [data-c="rose"] { --c: var(--rose); }

.label { color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 14px; margin-bottom: 24px; font-size: .72rem; }
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.about-text p:first-child { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.4; white-space: pre-line; letter-spacing: -.015em; }
.loc { color: var(--accent-ink); margin-top: 22px; }
.side { display: grid; gap: 16px; }
.mini { color: var(--muted); font-weight: 500; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + .chips { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chips[hidden] { display: none; }
.chips li { font-size: .72rem; padding: 7px 12px; background: var(--field); border: 1px solid var(--line); color: var(--ink); transition: .2s; }
.chips li:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.glass[hidden] { display: none; }
.socials li + li { border-top: 1px solid var(--line); }
.socials a { display: flex; justify-content: space-between; padding: 11px 0; font-weight: 500; transition: color .2s, padding .2s; }
.socials a:hover { color: var(--accent-ink); padding-left: 6px; }

.contact { padding-bottom: 60px; }
.big-mail { font: 800 clamp(1.7rem, 6.4vw, 4.6rem)/1.05 var(--serif); letter-spacing: -.045em; word-break: break-all; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 5px no-repeat; transition: background-size .4s, color .3s; padding-bottom: 6px; }
.big-mail:hover { background-size: 100% 5px; color: var(--accent-ink); }

.foot { max-width: 1120px; margin: 0 auto; padding: 24px 16px 36px; display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); }
#mark { background: none; border: 0; color: var(--muted); font: inherit; cursor: default; padding: 0 8px; opacity: .5; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .about-grid { grid-template-columns: 1fr; }
  .top nav a:not(.btn) { display: none; }
  .projects { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee ul, .enter .card { animation: none; }
  .marquee ul { flex-wrap: wrap; width: auto; padding: 0 16px; }
  .marquee li[aria-hidden] { display: none; }
  html { scroll-behavior: auto; }
}
