/* ---------- tokens ---------- */
:root {
  --bg: #f4f1ea; --bg2: #ebe6db; --ink: #16181d; --dim: #5d5f66; --line: #d6d0c3;
  --beam: #e5531f;            /* warm accent: links, buttons, focus */
  --beam-2: #0b8fc4;          /* cool accent: the link beam in the hero art */
  --card: #fbf9f4;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 14px; --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f14; --bg2: #141720; --ink: #e8e6e1; --dim: #8b8e98; --line: #262a35;
    --beam: #ff6b3d; --beam-2: #38bdf8; --card: #12151c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f14; --bg2: #141720; --ink: #e8e6e1; --dim: #8b8e98; --line: #262a35;
  --beam: #ff6b3d; --beam-2: #38bdf8; --card: #12151c; color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--beam); text-underline-offset: 3px; }
a:hover { color: var(--beam); }
::selection { background: color-mix(in srgb, var(--beam) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 750; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.dim { color: var(--dim); }
.small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--beam); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- header / footer ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  max-width: var(--max); margin: 0 auto; padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
}
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--beam); box-shadow: 0 0 12px var(--beam); }
#nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
#nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .94rem; color: var(--dim); white-space: nowrap; }
#nav a:hover, #nav a.active { color: var(--ink); background: var(--bg2); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; flex: none; }
.icon-btn:hover { border-color: var(--beam); color: var(--beam); }

main { max-width: var(--max); margin: 0 auto; padding: 0 24px 80px; outline: none; }
.foot { max-width: var(--max); margin: 0 auto; padding: 32px 24px 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; color: var(--dim); }
.foot a { color: var(--dim); }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; min-height: 72vh; padding: 48px 0 32px; }
.hero::before { content: ""; position: absolute; inset: -8% -18% 0; z-index: 0; pointer-events: none;
  background: radial-gradient(52% 48% at 74% 40%, color-mix(in srgb, var(--beam-2) 17%, transparent), transparent 72%); }
.beam { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .95; }
.hero-text, .portrait { position: relative; z-index: 1; }
.kicker { color: var(--beam); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.lede { font-size: 1.22rem; color: var(--dim); max-width: 34ch; }
.row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); padding: 12px 22px; border-radius: 999px; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600;
  box-shadow: 0 12px 26px -16px rgba(0,0,0,.7);
  transition: transform .16s, background .16s, border-color .16s, box-shadow .16s, color .16s; }
.btn:hover { background: var(--beam); border-color: var(--beam); color: #fff; transform: translateY(-1px);
  box-shadow: 0 18px 32px -16px color-mix(in srgb, var(--beam) 50%, transparent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.portrait { margin: 0; justify-self: end; max-width: 380px; position: relative; }
.portrait::before { content: ""; position: absolute; inset: -14% -12%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--beam-2) 30%, transparent), transparent 78%); filter: blur(16px); }
.portrait img { border-radius: var(--r); aspect-ratio: 4/5; object-fit: cover; object-position: 50% 0; width: 100%; filter: saturate(.93) contrast(1.04);
  box-shadow: 0 40px 80px -44px rgba(0,0,0,.8), 0 0 0 1px var(--line);
  transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.portrait:hover img { transform: translateY(-4px); }
.portrait figcaption { margin-top: 8px; color: var(--dim); text-align: right; }

/* ---------- sections ---------- */
.band { padding: 48px 0 8px; border-top: 1px solid var(--line); margin-top: 32px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.band-head a { font-size: .9rem; color: var(--dim); }
.label { color: var(--dim); text-transform: uppercase; letter-spacing: .14em; font-weight: 500; margin-bottom: 24px; }
.now { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.now li { padding-left: 22px; position: relative; font-size: 1.08rem; }
.now li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--beam); }
.grid { display: grid; gap: 20px; }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pillar { padding-top: 14px; border-top: 2px solid var(--ink); }
.pillar p { color: var(--dim); font-size: .96rem; }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; text-decoration: none; overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), border-color .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); border-color: var(--beam); color: inherit;
  box-shadow: 0 26px 50px -32px color-mix(in srgb, var(--beam) 60%, transparent); }
.card p { color: var(--dim); font-size: .96rem; }
.card .mono { margin-bottom: 6px; }
.project img, .ph-cover { margin: -20px -20px 16px; width: calc(100% + 40px); max-width: none; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r) var(--r) 0 0;
  transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.project:hover img { transform: scale(1.04); }
.ph-cover {
  display: grid; place-items: center; color: var(--dim); text-transform: uppercase; letter-spacing: .2em;
  background:
    linear-gradient(135deg, transparent 49.5%, color-mix(in srgb, var(--beam) 60%, transparent) 50%, transparent 50.5%),
    repeating-linear-gradient(0deg, var(--bg2) 0 23px, var(--line) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, var(--line) 23px 24px);
}
.site h3 { display: flex; justify-content: space-between; }
.arrow { color: var(--beam); }

.page-head { padding: 56px 0 24px; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 28px; }
.chip { font: inherit; font-size: .88rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--dim); cursor: pointer; }
.chip.on, .chip:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.career { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.career li { padding: 6px 0 14px 22px; position: relative; }
.career li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--dim); }
.career .when { display: block; font-size: .8rem; margin-top: 2px; }
.career li p { margin: 6px 0 0; max-width: 64ch; line-height: 1.55; }
.career li:first-child::before { border-color: var(--beam); background: var(--beam); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li a { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; align-items: baseline; }
.post-list .t { font-weight: 600; transition: color .15s; }
.post-list li a:hover .t { color: var(--beam); }
.search { width: 100%; max-width: 420px; font: inherit; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin-bottom: 20px; }

/* ---------- articles ---------- */
.article { max-width: 720px; margin: 0 auto; padding-top: 40px; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); }
.back { display: inline-block; margin-bottom: 24px; color: var(--dim); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.tags span { font-family: var(--mono); font-size: .75rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); }
.cover { border-radius: var(--r); margin-bottom: 28px; }
.prose { font-size: 1.06rem; }
.prose > p:first-child { font-size: 1.1em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose img { border-radius: 10px; margin: 1.2em 0; height: auto; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--beam); color: var(--dim); }
.prose pre { background: var(--bg2); padding: 16px; border-radius: 10px; overflow-x: auto; font-size: .88rem; }
.prose code { font-family: var(--mono); font-size: .9em; }
.prose figure { margin: 1.2em 0; }
.prose .wp-block-gallery, .prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.note { font-size: .9rem; color: var(--dim); border: 1px dashed var(--line); padding: 12px 16px; border-radius: 10px; }
.video { position: relative; aspect-ratio: 16/9; margin: 1.4em 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }

/* ---------- gallery ---------- */
.masonry { columns: 3 280px; column-gap: 12px; }
.ph { display: block; width: 100%; padding: 0; border: 0; background: none; margin: 0 0 12px; cursor: zoom-in; break-inside: avoid; border-radius: 10px; overflow: hidden; }
.ph img { width: 100%; transition: transform .3s; }
.ph:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,9,.94); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); }
.lightbox img { max-height: 82vh; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: #bbb; text-align: center; font-family: var(--mono); font-size: .8rem; margin-top: 10px; }
.lightbox .icon-btn { color: #eee; border-color: #444; background: rgba(0,0,0,.4); }
.lb-close { position: absolute; top: 16px; right: 16px; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; align-items: start; }
.contact label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.contact input, .contact textarea { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.links { list-style: none; padding: 0; margin: 0; font-size: 1.4rem; font-weight: 650; }
.links li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.links a { text-decoration: none; }

/* ---------- route transition ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
main > * { animation: rise .42s cubic-bezier(.2,.7,.3,1) both; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  #nav { order: 3; width: 100%; margin: 0 -4px; }
  #theme { margin-left: auto; }
  main { padding: 0 16px 64px; }
  .foot { padding: 28px 16px 40px; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 24px; }
  .portrait { justify-self: start; max-width: 240px; order: -1; }
  .post-list li a { grid-template-columns: 1fr; gap: 2px; }
  .lb-prev, .lb-next { position: absolute; bottom: 20px; }
  .lb-prev { left: 30%; } .lb-next { right: 30%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
