/* labs.telimbectar.net – doodle line-art, svartvitt.
   Tema: ljust standard. data-theme="dark" på <html> inverterar (vitt bläck på svart).
   Kokande linjer: klassen .boil på SVG/ramar. Stängs av med class="no-boil" på <html>
   eller automatiskt vid prefers-reduced-motion. */

/* Typsnitten ligger här (fonts/, latin-delen ur Google Fonts, SIL OFL), så sidan gör inga anrop utåt. */
@font-face { font-family: "Patrick Hand"; font-weight: 400; font-display: swap; src: url(fonts/patrick-hand-400.woff2) format("woff2"); }
@font-face { font-family: "Rubik Doodle Shadow"; font-weight: 400; font-display: swap; src: url(fonts/rubik-doodle-shadow-400.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url(fonts/space-mono-400.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 700; font-display: swap; src: url(fonts/space-mono-700.woff2) format("woff2"); }

:root {
  --ink: #111111;
  --paper: #FFFFFF;
  --grid: rgba(17, 17, 17, 0.06);
  --font-display: "Rubik Doodle Shadow", "Patrick Hand", cursive;
  --font-hand: "Patrick Hand", "Comic Neue", cursive;
  --font-mono: "Space Mono", ui-monospace, monospace;
  /* Oregelbundna radier = handritade ramar */
  --wobble-a: 255px 18px 225px 16px / 16px 225px 18px 255px;
  --wobble-b: 18px 225px 16px 255px / 225px 16px 255px 18px;
}
[data-theme="dark"] {
  --ink: #F5F5F0;
  --paper: #111111;
  --grid: rgba(245, 245, 240, 0.07);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }

.page {
  min-height: 100vh; position: relative; overflow: hidden;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink); font-family: var(--font-hand); font-size: 22px; line-height: 1.35;
}
.wrap { position: relative; max-width: 1080px; margin: 0 auto; padding: 32px 32px 80px; display: flex; flex-direction: column; gap: 56px; }

/* Kokande linjer */
.boil { filter: url(#wob); }
.no-boil .boil { filter: url(#wob-still); }
@media (prefers-reduced-motion: reduce) { .boil { filter: url(#wob-still); } }

/* Strödoodles */
.scatter { position: absolute; color: var(--ink); pointer-events: none; }

/* Toppnav */
.topnav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 14px; }
.backlink { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; border-bottom: 2px solid currentColor; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.hero__text { flex: 999 1 520px; min-width: 0; }
.hero__art { flex: 1 1 300px; min-width: 0; position: relative; display: flex; justify-content: center; }
.hero__art > svg { width: 100%; max-width: 340px; height: auto; }
.title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(110px, 17vw, 210px); line-height: 0.9; letter-spacing: -0.02em; }
.underline { width: min(520px, 100%); height: auto; display: block; margin-top: 4px; }
.lead { margin: 20px 0 0; max-width: 30ch; font-size: 28px; line-height: 1.25; }
.note { position: absolute; left: -6px; bottom: 10px; transform: rotate(-9deg); font-size: 20px; display: flex; align-items: center; gap: 6px; }

/* Lista */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.list-head h2 { margin: 0; font-size: 46px; font-weight: 400; display: flex; align-items: flex-end; gap: 12px; }
.meta { font-family: var(--font-mono); font-size: 14px; }
.experiments { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }

.exp { display: block; text-decoration: none; color: inherit; }
.exp:focus-visible { outline: 3px dashed currentColor; outline-offset: 6px; }
.exp__box {
  position: relative; padding: 22px 26px; background: var(--paper);
  display: grid; grid-template-columns: 64px 76px minmax(0, 1fr) auto 48px; gap: 18px; align-items: center;
  transform: rotate(var(--tilt, 0deg)); transition: transform 0.15s;
}
.exp:hover .exp__box, .exp:focus-visible .exp__box { transform: rotate(0deg) scale(1.01); }
.exp__frame { position: absolute; inset: 0; border: 3px solid var(--ink); border-radius: var(--wobble-a); pointer-events: none; }
.exp__shadow { position: absolute; inset: 7px -7px -7px 7px; border: 2px solid var(--ink); border-radius: var(--wobble-b); pointer-events: none; opacity: 0.55; z-index: -1; }
.exp__num { font-family: var(--font-display); font-size: 48px; line-height: 1; }
.exp__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exp__title { font-size: 34px; line-height: 1.1; }
.exp__desc { font-size: 21px; }
.exp__url { font-family: var(--font-mono); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.exp__arrow { transition: transform 0.15s; }
.exp:hover .exp__arrow { transform: translateX(8px) rotate(-8deg); }

/* Ett experiment som inte finns än (ingen port i door_sites): samma ruta, men ingen länk. */
div.exp:hover .exp__box { transform: rotate(var(--tilt, 0deg)); }

/* Stämplar: form skiljer dem åt, inte bara text */
.stamp { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; padding: 6px 10px;
  border: 2.5px solid var(--ink); white-space: nowrap; transform: rotate(var(--stamp-tilt, 4deg)); }
.stamp--live  { background: var(--ink); color: var(--paper); }   /* LEVER */
.stamp--wip   { border-style: dashed; }                          /* BYGGS */
.stamp--bench { border-style: double; border-width: 4px; }       /* PÅ BÄNKEN */
.stamp--idea  { border-style: dotted; }                          /* IDÉ */

.exp-empty { position: relative; padding: 26px; display: flex; align-items: center; gap: 18px; transform: rotate(0.8deg); }
.exp-empty__frame { position: absolute; inset: 0; border: 3px dashed var(--ink); border-radius: var(--wobble-b); opacity: 0.6; }
.exp-empty span { font-size: 26px; opacity: 0.75; }

/* Fot */
.foot { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.foot svg { width: min(600px, 100%); height: auto; }
.foot p { margin: 0; }

/* Tema-växlare (valfri) */
.theme-toggle { font: inherit; font-family: var(--font-mono); font-size: 13px; min-height: 44px; padding: 0 12px;
  background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: var(--wobble-a); cursor: pointer; }

@media (max-width: 640px) {
  .wrap { padding: 20px 18px 56px; gap: 40px; }
  .exp__box { grid-template-columns: 52px minmax(0, 1fr); padding: 18px; }
  .exp__icon, .exp__arrow { display: none; }
  .stamp { grid-column: 2; justify-self: start; }
  .list-head h2 { font-size: 38px; }
  .lead { font-size: 24px; }
}
