/* Fiddleden shared theme. Source of truth: fiddleden-mockups/ (canvas.json palette notes).
   Edit this file only; scripts/build.mjs copies it into every app as /assets/theme.css. */
@font-face{font-family:"Bricolage Grotesque";src:url('/assets/fonts/bricolage.woff2') format('woff2');font-weight:200 800;font-display:swap}
@font-face{font-family:Inter;src:url('/assets/fonts/inter.woff2') format('woff2');font-weight:100 900;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url('/assets/fonts/jetbrains-mono.woff2') format('woff2');font-weight:100 800;font-display:swap}

:root{
  /* Palette. Text rule: cream on ink, rose, teal, surface; ink on green, salmon, aqua, cream. Never the other way round. */
  --ink:#0E2219;--cream:#FFF8F0;--green:#BEEF9E;--rose:#C60F7B;--salmon:#FE938C;--aqua:#00E8FC;--teal:#417B5A;--surface:#16352A;
  --placeholder:#3D5A4B;
  --font-display:"Bricolage Grotesque",system-ui,sans-serif;
  --font-body:Inter,system-ui,sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --ease-out:cubic-bezier(.2,.8,.2,1);
  --gutter:clamp(16px,3vw,40px);
  color-scheme:dark;
}

/* Paired grounds: always use these so a background never ships with the wrong text colour. */
.on-ink{background:var(--ink);color:var(--cream)}
.on-surface{background:var(--surface);color:var(--cream)}
.on-teal{background:var(--teal);color:var(--cream)}
.on-rose{background:var(--rose);color:var(--cream)}
.on-green{background:var(--green);color:var(--ink)}
.on-salmon{background:var(--salmon);color:var(--ink)}
.on-aqua{background:var(--aqua);color:var(--ink)}
.on-cream{background:var(--cream);color:var(--ink)}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--ink);color:var(--cream);font-family:var(--font-body);line-height:1.5;-webkit-font-smoothing:antialiased}
body,input,button,select,textarea{font-family:var(--font-body)}
h1,h2,h3,.display{font-family:var(--font-display);font-weight:800;letter-spacing:-.03em}
.mono{font-family:var(--font-mono)}
a{color:var(--green);text-underline-offset:4px}
a:hover{color:var(--aqua)}
button,a,input,label,summary{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{min-height:44px;font:inherit}
:focus-visible{outline:3px solid var(--aqua)!important;outline-offset:3px!important}
::selection{background:var(--green);color:var(--ink)}
::placeholder{color:var(--placeholder);opacity:1}
[hidden]{display:none!important}
img{max-width:100%;height:auto}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{position:absolute;left:16px;top:-80px;z-index:100;padding:12px 18px;border-radius:999px;background:var(--aqua);color:var(--ink);font-weight:700;text-decoration:none}
.skip:focus{top:12px}

/* Labels and pills */
.label{font-family:var(--font-mono);font-weight:700;font-size:14px;letter-spacing:.08em;text-transform:uppercase}
.dot{display:inline-block;flex:none;width:12px;height:12px;border-radius:50%;background:var(--aqua)}
.dot.pulse{animation:fd-pulse 1.6s ease-in-out infinite}
.dot.off{background:var(--placeholder)}
.dot.warn{background:var(--salmon)}
@keyframes fd-pulse{0%,100%{opacity:1}50%{opacity:.35}}
.pill{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:12px 24px;border:0;border-radius:999px;font-weight:700;font-size:17px;line-height:1.1;text-decoration:none;cursor:pointer;transition:transform .2s var(--ease-out)}
.pill:hover{transform:translateY(-2px)}
.pill:active{transform:scale(.97)}
a.pill.on-rose:hover,a.pill.on-rose{color:var(--cream)}
a.pill.on-aqua,a.pill.on-aqua:hover,a.pill.on-green,a.pill.on-green:hover,a.pill.on-salmon,a.pill.on-salmon:hover,a.pill.on-cream,a.pill.on-cream:hover{color:var(--ink)}
a.pill.on-ink,a.pill.on-ink:hover,a.pill.on-surface,a.pill.on-surface:hover{color:var(--cream)}
.pill-outline{background:transparent;color:inherit;border:2px solid currentColor}
a.pill-outline:hover{color:inherit}
.arrow{width:18px;height:18px;flex:none}

/* Page frame */
.frame{max-width:1440px;margin:0 auto;padding:0 var(--gutter) 48px}
.site-header{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;padding:22px 32px;border-radius:0 0 28px 28px;background:var(--cream);color:var(--ink)}
.brand{display:inline-flex;align-items:center;gap:12px;min-height:44px;color:var(--ink);text-decoration:none}
.brand:hover{color:var(--ink)}
.brand svg{width:44px;height:44px;flex:none}
.wordmark{font-family:var(--font-display);font-weight:800;font-size:34px;letter-spacing:-.04em;line-height:1}
.site-nav{display:flex;gap:32px;font-weight:600;font-size:17px}
.site-nav a{color:var(--ink);text-decoration:none;padding:10px 0;border-bottom:3px solid transparent}
.site-nav a:hover,.site-nav a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--rose)}
.menu-btn{display:none;width:48px;height:48px;border-radius:50%;border:0;background:var(--ink);color:var(--cream);align-items:center;justify-content:center;cursor:pointer}
.menu-btn svg{width:22px;height:22px}
.site-footer{margin-top:72px;border-top:2px solid var(--teal);padding-top:32px;display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap}
.site-footer p{margin:0;color:var(--green);font-size:16px}
.site-footer .wordmark{font-size:26px}
a.status-pill{display:inline-flex;align-items:center;gap:10px;min-height:48px;background:var(--surface);color:var(--cream);text-decoration:none;font-weight:600;padding:12px 20px;border-radius:999px}
a.status-pill:hover{color:var(--cream);background:var(--teal)}
a.status-pill .dot{width:10px;height:10px}

@media (max-width:960px){
  .frame{padding-inline:14px}
  .site-header{margin-inline:-14px;padding:16px 18px;border-radius:0 0 22px 22px;gap:12px}
  .brand{gap:8px}.brand svg{width:32px;height:32px}.wordmark{font-size:26px}
  .menu-btn{display:inline-flex}
  .site-header .join-pill{display:none}
  .site-nav{display:none;order:3;width:100%;flex-direction:column;gap:0;font-size:20px}
  .site-nav a{padding:14px 2px;border-bottom:2px solid #0E221922}
  .site-nav a:last-child{border-bottom:0}
  .site-header.open .site-nav{display:flex}
  .site-header.open .join-pill{display:inline-flex;order:4;width:100%}
  .site-footer{margin-top:48px;flex-direction:column;align-items:flex-start;gap:14px;padding-top:22px}
  .site-footer .wordmark{display:none}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Post cards (home "From the workbench" and the Workbench index) */
.posts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.post-card{border-radius:32px;overflow:hidden;text-decoration:none;display:flex;flex-direction:column;transition:transform .28s var(--ease-out)}
.post-card:hover{transform:translateY(-6px) rotate(-1.2deg)}
.post-card:nth-child(2n):hover{transform:translateY(-6px) rotate(1.2deg)}
a.post-card.on-teal,a.post-card.on-teal:hover,a.post-card.on-rose,a.post-card.on-rose:hover{color:var(--cream)}
a.post-card.on-salmon,a.post-card.on-salmon:hover,a.post-card.on-aqua,a.post-card.on-aqua:hover,a.post-card.on-green,a.post-card.on-green:hover,a.post-card.on-cream,a.post-card.on-cream:hover{color:var(--ink)}
.post-body{padding:24px 26px 28px}
.post-kicker{font-size:13px;font-weight:500}
.on-teal .post-kicker,.on-rose .post-kicker{color:var(--cream)}
.on-rose .post-kicker{color:var(--cream)}
.post-title{display:block;margin-top:8px;font-family:var(--font-display);font-weight:800;font-size:30px;letter-spacing:-.03em;line-height:1.05}
.post-art{position:relative;display:block;height:220px;background:var(--surface);overflow:hidden}
.post-art i{position:absolute;display:block}
.art-lift i:nth-child(1){left:32px;bottom:0;width:180px;height:150px;background:var(--salmon);border-radius:16px 16px 0 0}
.art-lift i:nth-child(2){left:56px;top:30px;width:132px;height:60px;background:var(--ink);border-radius:10px;border:5px solid var(--aqua)}
.art-lift i:nth-child(3){right:40px;top:40px;width:70px;height:70px;border-radius:50%;background:var(--green)}
.art-cards{background:var(--rose)}
.art-cards i:nth-child(1){left:40px;top:40px;width:110px;height:140px;border-radius:18px;background:var(--cream)}
.art-cards i:nth-child(2){left:170px;top:60px;width:160px;height:100px;border-radius:14px;background:var(--ink)}
.art-cards i:nth-child(3){left:196px;top:86px;width:48px;height:48px;clip-path:polygon(50% 0,100% 100%,0 100%);background:var(--aqua)}
.art-server{background:var(--ink)}
.art-server i:nth-child(-n+3){left:36px;width:220px;height:40px;border-radius:10px;background:var(--teal)}
.art-server i:nth-child(1){top:36px}.art-server i:nth-child(2){top:90px}.art-server i:nth-child(3){top:144px}
.art-server i:nth-child(-n+3)::after{content:"";position:absolute;left:16px;top:14px;width:12px;height:12px;border-radius:50%;background:var(--green)}
.art-server i:nth-child(3)::after{background:var(--salmon)}
.art-shapes i:nth-child(1){left:36px;top:40px;width:96px;height:96px;border-radius:50%;background:var(--salmon)}
.art-shapes i:nth-child(2){left:150px;top:70px;width:84px;height:84px;border-radius:16px;background:var(--aqua);transform:rotate(12deg)}
.art-shapes i:nth-child(3){left:250px;bottom:0;width:120px;height:60px;border-radius:120px 120px 0 0;background:var(--rose)}
.art-on-green.art-shapes,.art-on-salmon.art-shapes{background:var(--ink)}
.post-art i:nth-child(4){display:none}

/* Static pages (Workbench, guides, About, status) */
.page{display:flex;flex-direction:column;gap:24px;padding-top:40px}
.page-hero{border-radius:36px;padding:34px 40px 30px;min-height:200px;display:flex;align-items:flex-end}
.page-hero h1{margin:0;font-size:clamp(52px,8vw,112px);line-height:.88;letter-spacing:-.045em}
.lede{margin:0 0 16px;max-width:60ch;font-size:19px;color:var(--green)}
.crumb{margin:0;font-weight:700}
.article{display:flex;flex-direction:column;gap:24px}
.article-head{border-radius:36px;padding:34px 40px 36px;display:flex;flex-direction:column;gap:14px}
.article-head .label{margin:0;font-size:13px;font-weight:500}
.article-head h1{margin:0;font-size:clamp(44px,6.4vw,96px);line-height:.9;letter-spacing:-.045em;max-width:16ch}
.dek{margin:0;font-size:20px;font-weight:500;max-width:48ch}
.prose{max-width:70ch;font-size:18px;line-height:1.65}
.prose h2{font-size:clamp(28px,3.4vw,40px);line-height:1;letter-spacing:-.035em;margin:48px 0 14px}
.prose h3{font-size:24px;margin:32px 0 10px}
.prose p,.prose ul,.prose ol{margin:0 0 20px}
.prose li{margin:6px 0}
.prose li::marker{color:var(--green);font-weight:700}
.prose strong{color:var(--cream)}
.prose em{color:var(--green)}
.prose code{font-family:var(--font-mono);font-size:.9em;background:var(--surface);border-radius:6px;padding:2px 6px;overflow-wrap:anywhere}
.prose img{display:block;max-width:100%;max-height:650px;width:auto;height:auto;margin:32px 0;border-radius:24px;background:var(--cream)}
.prose a{color:var(--green)}
.prose a:hover{color:var(--aqua)}

@media (max-width:960px){
  .posts{grid-template-columns:1fr;gap:12px}
  .post-card{flex-direction:row;align-items:center;gap:14px;padding:12px;border-radius:24px}
  .post-card:hover,.post-card:nth-child(2n):hover{transform:none}
  .post-body{padding:0}
  .post-kicker{font-size:11px}
  .post-title{margin-top:4px;font-size:22px}
  .post-art{flex:none;width:84px;height:84px;border-radius:16px}
  .art-lift i:nth-child(1){left:14px;width:56px;height:48px;border-radius:8px 8px 0 0}
  .art-lift i:nth-child(2){left:20px;top:12px;width:44px;height:20px;border-width:3px;border-radius:5px}
  .art-cards i:nth-child(1){left:12px;top:14px;width:30px;height:50px;border-radius:8px}
  .art-cards i:nth-child(3){left:48px;top:26px;width:26px;height:26px}
  .art-server i:nth-child(-n+3){left:12px;width:60px;height:14px;border-radius:4px}
  .art-server i:nth-child(1){top:14px}.art-server i:nth-child(2){top:35px}.art-server i:nth-child(3){top:56px}
  .art-server i::after,.art-lift i:nth-child(3),.art-cards i:nth-child(2){display:none}
  .art-shapes i:nth-child(1){left:10px;top:12px;width:34px;height:34px}
  .art-shapes i:nth-child(2){left:40px;top:34px;width:30px;height:30px;border-radius:8px}
  .art-shapes i:nth-child(3){display:none}
  .page{padding-top:14px;gap:16px}
  .page-hero,.article-head{border-radius:28px;padding:22px 22px 20px;min-height:0}
  .prose{font-size:17px}
}
@media (min-width:600px) and (max-width:960px){
  .posts{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Status page */
.services{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.service{background:var(--surface);border-radius:28px;padding:24px 26px;display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:12px;row-gap:6px}
.service h2{margin:0;font-size:26px;letter-spacing:-.02em;line-height:1.1}
.service p{grid-column:2;margin:0;color:var(--green);font-family:var(--font-mono);font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.status-note{margin:8px 0 0;color:var(--green);font-size:15px}
