@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*{box-sizing:border-box;margin:0}
:root{--bg:#faf5ec;--surface:#f1eadc;--line:#e5dcc9;--ink:#26221c;--soft:#6b6459;--faint:#a39b8c;--accent:#0f7fb4;--bg-inverse:#1b1915}
html[data-theme="dark"]{--bg:#1b1915;--surface:#26231d;--line:#332e26;--ink:#f0ebe1;--soft:#aba294;--faint:#6f6759;--accent:#6dcff6;--bg-inverse:#faf5ec}
html{background:var(--bg)}
body{background:var(--bg);color:var(--ink);font-family:'Hanken Grotesk',sans-serif;transition:background 240ms,color 240ms}
a{text-decoration:none;color:inherit;transition:color 160ms,background 160ms,border-color 160ms}
img{max-width:100%;display:block}
main{min-height:calc(100vh - 200px)}

nav{display:flex;align-items:center;justify-content:space-between;padding:28px 72px;max-width:1220px;margin:0 auto}
.wordmark{font-weight:700;font-size:17px;letter-spacing:-.01em}
.navctl{display:flex;align-items:center;gap:8px}
nav .links{display:flex;align-items:center;gap:8px}
nav .links a{font-size:14.5px;color:var(--soft);padding:8px 16px;border-radius:999px;cursor:pointer}
nav .links a:hover,nav .links a.on{background:var(--surface);color:var(--ink)}
.navtoggle{display:none;width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:var(--surface);align-items:center;justify-content:center;color:var(--ink);cursor:pointer;padding:0}
.navtoggle svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.minibar{position:fixed;top:0;left:0;right:0;z-index:30;display:flex;justify-content:center;align-items:center;padding:22px 0;background:var(--bg);border-bottom:1px solid var(--line);opacity:0;transform:translateY(-100%);pointer-events:none;transition:opacity 200ms,transform 200ms,background 240ms,border-color 240ms}
.minibar.visible{opacity:1;transform:translateY(0);pointer-events:auto}
.minibar a{font-weight:700;font-size:17px;letter-spacing:-.01em;color:var(--ink)}

.tglslider{display:inline-flex;align-items:center;width:52px;height:28px;border-radius:999px;border:1px solid var(--line);background:var(--surface);cursor:pointer;position:relative;padding:0}
.tglslider .knob{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--ink);display:grid;place-items:center;transition:left 240ms cubic-bezier(.4,0,.2,1),background 240ms}
html[data-theme="dark"] .tglslider .knob{left:27px}
.tglslider svg{width:12px;height:12px;stroke:var(--bg);fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tglslider .moon{display:none}
html[data-theme="dark"] .tglslider .sun{display:none}
html[data-theme="dark"] .tglslider .moon{display:block}

.wrap{max-width:1220px;margin:0 auto;padding:0 72px}

/* home */
.hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:80px;align-items:center;padding:72px 0 96px}
.hero>*{min-width:0}
.hero.no-photo{grid-template-columns:1fr}
.hero h1{font-size:46px;font-weight:700;letter-spacing:-.025em;line-height:1.12;margin-bottom:22px}
.hero p{font-size:17.5px;line-height:1.7;color:var(--soft);max-width:520px;margin-bottom:0}
.hero .divider{border:0;border-top:1px solid var(--line);margin:30px 0 0}
.photo{aspect-ratio:4/4.6;border-radius:24px;overflow:hidden;background:var(--surface);min-width:0}
.photo img{width:100%;height:100%;object-fit:cover}
section{padding-bottom:88px}
.shead{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.shead h2{font-size:22px;font-weight:700;letter-spacing:-.015em}
.shead a{font-size:14px;color:var(--accent);font-weight:600;cursor:pointer}
.rows a{display:grid;grid-template-columns:112px 1fr;gap:32px;align-items:baseline;padding:24px 16px;margin:0 -16px;border-radius:16px;cursor:pointer}
.rows a:hover{background:var(--surface)}
.rows a+a{border-top:1px solid var(--line)}
.rows .dt{font-size:13.5px;color:var(--faint)}
.rows h3{font-size:18px;font-weight:600;letter-spacing:-.01em;margin-bottom:5px}
.rows p{font-size:14.5px;color:var(--soft);line-height:1.6;max-width:620px}

/* writing index */
.pagehead{padding:64px 0 32px;max-width:680px}
.pagehead h1{font-size:38px;font-weight:700;letter-spacing:-.025em;margin-bottom:14px}
.pagehead p{font-size:16.5px;line-height:1.7;color:var(--soft)}
.year{font-size:14px;font-weight:600;color:var(--faint);margin:34px 0 4px}

/* projects */
.proj{background:var(--surface);border-radius:20px;margin-bottom:18px;overflow:hidden;scroll-margin-top:32px}
.proj .head{display:grid;grid-template-columns:1fr auto auto;gap:24px;align-items:center;padding:26px 30px;cursor:pointer;border:0;background:none;width:100%;text-align:left;font-family:inherit;color:inherit}
.proj h3{font-size:19px;font-weight:700;letter-spacing:-.01em;margin-bottom:5px}
.proj .head p{font-size:14.5px;color:var(--soft);line-height:1.6}
.proj .meta{font-size:13px;color:var(--faint);white-space:nowrap}
.proj .chev{width:34px;height:34px;border-radius:50%;border:1px solid var(--line);display:grid;place-items:center;color:var(--soft);transition:transform 240ms}
.proj .chev svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.proj.open .chev{transform:rotate(180deg)}
.proj .plist{display:grid;grid-template-rows:0fr;transition:grid-template-rows 280ms cubic-bezier(.4,0,.2,1)}
.proj.open .plist{grid-template-rows:1fr}
.proj .plist>div{overflow:hidden}
.proj .plist a{display:grid;grid-template-columns:112px 1fr;gap:32px;align-items:baseline;padding:16px 30px;border-top:1px solid var(--line);font-size:15px;cursor:pointer}
.proj .plist a:hover h4{color:var(--accent)}
.proj .plist .dt{font-size:13px;color:var(--faint)}
.proj .plist h4{font-size:15.5px;font-weight:600}

/* post */
.post{max-width:680px;margin:0 auto;padding:64px 0 96px}
.post .pmeta{font-size:14px;color:var(--faint);margin-bottom:16px}
.post h1{font-size:38px;font-weight:700;letter-spacing:-.025em;line-height:1.15;margin-bottom:28px}
.post .lede{font-size:19px;line-height:1.7;color:var(--soft);margin-bottom:36px}
.post .body{font-size:16.5px;line-height:1.8}
.post .body p{margin-bottom:24px}
.post .body h2{font-size:23px;font-weight:700;letter-spacing:-.015em;margin:44px 0 16px}
.post .body ul,.post .body ol{margin:0 0 24px;padding-left:22px}
.post .body li{margin-bottom:8px}
.post .body a{color:var(--accent);font-weight:600}
.post .body code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14.5px;background:var(--surface);padding:2px 6px;border-radius:6px}
.post .body pre{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;background:var(--surface);padding:20px;border-radius:16px;overflow-x:auto;margin-bottom:24px}
.post .body pre code{background:none;padding:0}
.post .body .fq{margin:40px auto;padding:0 8px;max-width:520px;text-align:center;font-size:22px;font-style:italic;font-weight:500;line-height:1.5;color:var(--ink)}
.post .fig{margin:40px 0}
.post .fig img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:18px}
.post .fig figcaption{font-size:13.5px;color:var(--faint);margin-top:12px}
.post .back{font-size:14px;font-weight:600;color:var(--accent);cursor:pointer;display:inline-block;margin-bottom:40px}

/* about */
.about{padding:64px 0 96px}
.about .photo{aspect-ratio:auto;width:280px;height:340px;border:4px solid var(--bg-inverse);border-radius:28px;float:right;margin:6px 0 24px 40px}
.about h1{font-size:38px;font-weight:700;letter-spacing:-.025em;margin-bottom:24px}
.about .prose{font-size:16.5px;line-height:1.8;color:var(--ink)}
.about .prose::after{content:"";display:block;clear:both}
.about .prose p{margin-bottom:22px}
.about .prose p.muted{color:var(--soft)}
.about h2{font-size:20px;font-weight:700;letter-spacing:-.015em;margin:40px 0 14px}
.about .prose h3{font-size:17px;font-weight:600;letter-spacing:-.01em;margin:28px 0 10px}
.about .prose a{color:var(--accent);font-weight:600}
.about .prose ul{margin:0 0 22px;padding-left:22px}
.about .prose li{margin-bottom:8px}

footer{border-top:1px solid var(--line);padding:36px 72px;display:grid;grid-template-columns:1fr auto 1fr;column-gap:16px;align-items:center;font-size:13.5px;color:var(--faint);max-width:1220px;margin:0 auto}
footer .copyright{grid-column:1;justify-self:start}
footer .buildinfo{grid-column:2;justify-self:center;white-space:nowrap}
footer .fl{grid-column:3;justify-self:end;display:flex;gap:10px}
footer a{color:var(--soft);width:36px;height:36px;border-radius:50%;display:grid;place-items:center}
footer a:hover{color:var(--ink);background:var(--surface)}
footer a svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.totop{position:fixed;right:32px;bottom:32px;width:44px;height:44px;border-radius:50%;background:var(--surface);border:1px solid var(--line);color:var(--ink);display:grid;place-items:center;cursor:pointer;opacity:0;pointer-events:none;transform:translateY(8px);transition:opacity 200ms,transform 200ms,background 160ms,border-color 160ms}
.totop:hover{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.totop.visible{opacity:1;pointer-events:auto;transform:translateY(0)}
.totop svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

@media (max-width:760px){
.totop{right:18px;bottom:18px;width:40px;height:40px}
nav{padding:18px 20px;position:relative}
.minibar{padding:16px 0}
.wordmark{font-size:15.5px}
.navtoggle{display:inline-flex}
nav .links{display:none;flex-direction:column;align-items:stretch;gap:2px;position:absolute;top:100%;left:20px;right:20px;margin-top:8px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:16px;z-index:10}
nav .links.open{display:flex}
nav .links a{padding:11px 14px;font-size:15px}
.wrap{padding:0 20px}
.hero{display:flex;flex-direction:column-reverse;gap:28px;padding:32px 0 48px}
.hero h1{font-size:27px}
.hero p{font-size:15.5px}
.hero .photo{aspect-ratio:4/4.2}
.shead h2{font-size:19px}
.rows h3{font-size:16px}
.rows a{grid-template-columns:1fr;gap:6px;padding:20px 12px;margin:0 -12px}
.proj .head{grid-template-columns:1fr auto;padding:22px 22px}
.proj h3{font-size:17px}
.proj .meta{display:none}
.proj .plist a{grid-template-columns:1fr;gap:4px;padding:14px 22px}
.about{padding:32px 0 48px}
.about h1{font-size:27px}
.about h2{font-size:18px}
.about .photo{float:none;width:50%;height:auto;aspect-ratio:4/4.6;margin:0 0 28px}
.pagehead{padding:32px 0 18px}
.pagehead p{font-size:15.5px}
.pagehead h1,.post h1{font-size:27px}
.post{padding:32px 0 48px}
.post .lede{font-size:16.5px}
.post .body h2{font-size:20px}
footer{padding:24px 20px;grid-template-columns:1fr;justify-items:center;text-align:center;gap:14px}
footer .copyright{grid-column:1;justify-self:center;order:3}
footer .buildinfo{grid-column:1;justify-self:center;order:2}
footer .fl{grid-column:1;justify-self:center;order:1}
}
