/* Shared styles for project detail pages */
:root{
  --paper:#F5F7F9; --surface:#FFFFFF; --surface-2:#EDF1F4;
  --ink:#0C1420; --ink-soft:#26313F; --muted:#59636F;
  --line:#E1E6EB; --line-strong:#CBD3DB;
  --accent:#0E7C86; --accent-strong:#0A5A62; --accent-wash:#E4F1F1;
  --shadow:0 1px 2px rgba(12,20,32,.04), 0 12px 32px -18px rgba(12,20,32,.28);
  --shadow-sm:0 1px 2px rgba(12,20,32,.05), 0 6px 18px -14px rgba(12,20,32,.30);
}
:root:not([data-theme="light"]){ @media (prefers-color-scheme:dark){
  --paper:#090E15; --surface:#101A24; --surface-2:#17232F;
  --ink:#E8EDF2; --ink-soft:#C4CDD7; --muted:#93A0AE;
  --line:#213040; --line-strong:#324456;
  --accent:#2DC6C0; --accent-strong:#5BD8D1; --accent-wash:#0F2A2C;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.7);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4), 0 10px 24px -16px rgba(0,0,0,.6);
}}
:root[data-theme="dark"]{
  --paper:#090E15; --surface:#101A24; --surface-2:#17232F;
  --ink:#E8EDF2; --ink-soft:#C4CDD7; --muted:#93A0AE;
  --line:#213040; --line-strong:#324456;
  --accent:#2DC6C0; --accent-strong:#5BD8D1; --accent-wash:#0F2A2C;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.7);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4), 0 10px 24px -16px rgba(0,0,0,.6);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0; background:var(--paper); color:var(--ink);
  font-family:"IBM Plex Sans",system-ui,-apple-system,sans-serif; font-size:17px; line-height:1.62; -webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:"Fraunces",Georgia,serif; margin:0; font-weight:600; letter-spacing:-.01em; line-height:1.12; text-wrap:balance}
p{margin:0}
a{color:inherit; text-decoration:none}
:focus-visible{outline:2.5px solid var(--accent); outline-offset:3px; border-radius:4px}
.pwrap{max-width:820px; margin:0 auto; padding:0 24px}
.eyebrow{font-family:"IBM Plex Mono",monospace; font-size:12px; letter-spacing:.13em; text-transform:uppercase; color:var(--accent-strong); font-weight:500}

/* nav */
.pnav{position:sticky; top:0; z-index:20; backdrop-filter:saturate(1.4) blur(10px); background:color-mix(in srgb, var(--paper) 82%, transparent); border-bottom:1px solid var(--line)}
.pnav-in{max-width:820px; margin:0 auto; padding:12px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px}
.back{display:inline-flex; align-items:center; gap:9px; font-family:"Fraunces",serif; font-weight:600; font-size:17px}
.back span{color:var(--accent-strong)}
.back svg{width:17px; height:17px; color:var(--muted)}
.ttoggle{display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:9px; border:1px solid var(--line); background:var(--surface); color:var(--ink-soft); cursor:pointer}
.ttoggle:hover{border-color:var(--line-strong); color:var(--ink)}
.ttoggle svg{width:18px; height:18px}
.ttoggle .moon{display:none}
:root[data-theme="dark"] .ttoggle .moon{display:block}
:root[data-theme="dark"] .ttoggle .sun{display:none}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .ttoggle .moon{display:block} :root:not([data-theme="light"]) .ttoggle .sun{display:none} }

/* hero */
.phero{padding:52px 0 8px}
.phero h1{font-size:clamp(32px,5.5vw,50px); margin:14px 0 0}
.phero .lead{font-size:clamp(17.5px,2.1vw,20px); color:var(--ink-soft); margin-top:16px; max-width:62ch}
.chips{display:flex; flex-wrap:wrap; gap:7px; margin-top:22px}
.chip{font-family:"IBM Plex Mono",monospace; font-size:11.5px; padding:5px 10px; border-radius:7px; border:1px solid var(--line); color:var(--muted); background:var(--surface)}
.cta{display:flex; flex-wrap:wrap; gap:11px; margin-top:26px}
.btn{display:inline-flex; align-items:center; gap:9px; font-weight:600; font-size:15px; padding:12px 18px; border-radius:11px; border:1px solid transparent; cursor:pointer; transition:transform .12s ease, box-shadow .15s, border-color .15s, color .15s}
.btn svg{width:17px; height:17px}
.btn-primary{background:var(--accent); color:#fff; box-shadow:var(--shadow-sm)}
.btn-primary:hover{transform:translateY(-2px); box-shadow:var(--shadow)}
.btn-ghost{background:var(--surface); color:var(--ink); border-color:var(--line-strong)}
.btn-ghost:hover{transform:translateY(-2px); border-color:var(--accent); color:var(--accent-strong)}
@media (prefers-reduced-motion:reduce){ .btn:hover{transform:none} }

/* metrics */
.pmetrics{margin:34px auto 0; max-width:820px; padding:0 24px}
.pmetrics-in{display:grid; grid-template-columns:repeat(3,1fr); gap:14px}
@media (max-width:620px){ .pmetrics-in{grid-template-columns:1fr} }
.pmetric{background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:18px 20px; box-shadow:var(--shadow-sm)}
.pmetric .n{font-family:"Fraunces",serif; font-size:26px; font-weight:600; letter-spacing:-.02em; line-height:1}
.pmetric .l{font-size:13px; color:var(--muted); margin-top:7px; line-height:1.35}

/* sections */
main.pwrap{padding-top:8px; padding-bottom:20px}
.psec{padding:34px 0 0}
.psec h2{font-size:24px; margin-bottom:14px; display:flex; align-items:baseline; gap:12px}
.psec h2 .k{font-family:"IBM Plex Mono",monospace; font-size:12px; color:var(--muted); font-weight:500}
.psec p{color:var(--ink-soft); font-size:16.5px; max-width:66ch}
.psec p + p{margin-top:13px}
.psec b{color:var(--ink); font-weight:600}
.steps{list-style:none; margin:6px 0 0; padding:0; counter-reset:s}
.steps li{position:relative; padding:0 0 18px 44px; counter-increment:s}
.steps li:last-child{padding-bottom:0}
.steps li::before{content:counter(s); position:absolute; left:0; top:-2px; width:28px; height:28px; border-radius:8px; background:var(--accent-wash); color:var(--accent-strong); font-family:"Fraunces",serif; font-weight:600; font-size:14px; display:flex; align-items:center; justify-content:center}
.steps li b{color:var(--ink)}
.steps li{color:var(--ink-soft); font-size:16px; max-width:64ch}
.rtable{margin-top:16px; overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:var(--surface)}
.rtable table{width:100%; border-collapse:collapse; font-size:15px}
.rtable th,.rtable td{text-align:left; padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:top}
.rtable th{font-family:"IBM Plex Mono",monospace; font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:500}
.rtable tr:last-child td{border-bottom:0}
.rtable + p{margin-top:16px}
.rtable td:last-child{color:var(--ink); font-variant-numeric:tabular-nums}
.callout{background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--accent); border-radius:10px; padding:15px 18px; margin-top:16px; color:var(--ink-soft); font-size:15.5px; max-width:66ch}
.callout b{color:var(--ink)}
.stacklist{display:flex; flex-wrap:wrap; gap:7px; margin-top:4px}
.sk{font-size:13.5px; padding:5px 11px; border-radius:8px; background:var(--surface-2); color:var(--ink-soft)}

/* footer */
.pfoot{border-top:1px solid var(--line); margin-top:48px; padding:26px 0 44px}
.pfoot .pwrap{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between}
.pfoot .back{font-family:"IBM Plex Sans",sans-serif; font-weight:600; font-size:15px; color:var(--accent-strong)}
.pfoot span{color:var(--muted); font-size:13.5px}
.link{font-weight:600; font-size:14.5px; color:var(--accent-strong); display:inline-flex; align-items:center; gap:6px}

/* Desktop: same page width as the home page, so the name in the nav sits in the same place on every page */
@media (min-width:1100px){
  .pwrap, .pnav-in, .pmetrics{max-width:1080px}
  .callout, .pfig-tour{max-width:820px}
}

/* Reading progress on project pages: a thin bar under the nav that fills as you scroll.
   CSS only; browsers without scroll-driven animations simply do not show it. */
@supports (animation-timeline: scroll()){
  .pnav::after{content:""; position:absolute; left:0; right:0; bottom:-2px; height:2px; background:var(--accent); transform-origin:0 50%; transform:scaleX(0); animation:preadbar linear both; animation-timeline:scroll(root block)}
  @keyframes preadbar{to{transform:scaleX(1)}}
}
