/* ============================================================
   wall.css — "The Dorm Wall" design system (site-v2 experiment)
   World: a student's dorm wall at night. Every section is a real
   paper artifact taped or pinned to it. Dark wall, bright paper,
   warm lamp light. Shared by all pages in experiments/site-v2.
   Do not fork per-page; extend in a page css file.
   ============================================================ */

/* ---------- fonts ---------- */
@font-face { font-family: "Anton"; src: url("fonts/anton-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courier-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  /* the wall */
  --wall: #241c15;
  --wall-deep: #1a140f;
  --lamp: rgba(255, 196, 110, 0.16);

  /* papers */
  --paper: #f7f0dd;
  --paper-white: #fdfaf1;
  --paper-cream: #efe4c8;
  --kraft: #c9a06b;
  --manila: #e3c98f;
  --sticky-yellow: #fff1a8;
  --sticky-pink: #ffc6d9;
  --sticky-blue: #bfe0f7;
  --sticky-green: #cdeec0;

  /* inks & accents */
  --ink: #241c12;
  --ink-soft: #4d4132;
  --red-ink: #b3402f;
  --highlighter: #f2e14c;
  --marker-blue: #2f56b3;
  --tape: rgba(226, 202, 152, 0.92);
  --string-red: #a8362a;

  /* type */
  --f-display: "Anton", "Arial Narrow", sans-serif;
  --f-hand: "Caveat", cursive;
  --f-type: "Courier Prime", "Courier New", monospace;
  --f-body: "Nunito", system-ui, sans-serif;

  /* depth recipe: offset + soft blur, wall-side ambient */
  --shadow-art: 0 2px 3px rgba(0,0,0,.28), 0 14px 28px -6px rgba(0,0,0,.45);
  --shadow-lift: 0 4px 6px rgba(0,0,0,.3), 0 22px 40px -8px rgba(0,0,0,.55);

  --maxw: 1180px;
  --radius-paper: 3px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 112.5%; } /* 18px root — everything in rem scales up */
body {
  margin: 0;
  overflow-x: clip; /* wall stickers bleed off the viewport edge without a scrollbar */
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--paper);
  background-color: var(--wall);
  /* night wall: warm lamp pool top-left, deep vignette, faint plaster noise */
  background-image:
    radial-gradient(1100px 700px at 18% -6%, var(--lamp), transparent 60%),
    radial-gradient(140% 100% at 50% 40%, transparent 55%, rgba(0,0,0,.42) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--highlighter); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--highlighter); color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- type voices ---------- */
.anton {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: balance;
  margin: 0 0 0.35em;
}
.hand { font-family: var(--f-hand); font-weight: 700; line-height: 1.25; }
.type { font-family: var(--f-type); letter-spacing: 0.02em; }

/* on-paper text */
.on-paper { color: var(--ink); }
.on-paper p, .on-paper li { color: var(--ink-soft); }
.on-paper .anton { color: var(--ink); }

/* ---------- the artifacts ---------- */

/* generic paper sheet, slight tilt via --tilt */
.paper {
  --tilt: 0deg;
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-art);
  transform: rotate(var(--tilt));
  padding: 28px 30px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.paper:hover { transform: rotate(calc(var(--tilt) * 0.35)) translateY(-3px); box-shadow: var(--shadow-lift); }

/* masking tape strip — place at top of an artifact */
.tape {
  position: absolute;
  top: -14px; left: 50%;
  width: 130px; height: 30px;
  transform: translateX(-50%) rotate(var(--tape-tilt, -2deg));
  background: var(--tape);
  /* torn ends + slight sheen */
  clip-path: polygon(2% 8%, 98% 0%, 100% 88%, 97% 100%, 3% 96%, 0% 90%);
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
  opacity: .96;
  pointer-events: none;
}
.tape::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 6px, transparent 6px 12px);
}
.tape.tape-left { left: 8%; transform: rotate(-38deg); }
.tape.tape-right { left: auto; right: 6%; transform: rotate(34deg); }

/* push pin */
.pin {
  position: absolute; top: -9px; left: 50%;
  width: 18px; height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a75, #c22e1f 60%, #7e1a10);
  box-shadow: 0 3px 5px rgba(0,0,0,.45), inset 0 -2px 3px rgba(0,0,0,.35);
}
.pin.pin-blue { background: radial-gradient(circle at 35% 30%, #8fb7ff, #2f56b3 60%, #1a3268); }

/* sticky note with folded corner */
.sticky {
  --tilt: 0deg;
  position: relative;
  background: var(--sticky-yellow);
  color: var(--ink);
  padding: 18px 20px 24px;
  transform: rotate(var(--tilt));
  box-shadow: var(--shadow-art);
  font-family: var(--f-hand);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.25;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.sticky::after { /* peeled bottom-right corner */
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 26px; height: 26px;
  background: linear-gradient(315deg, var(--wall) 0 47%, rgba(0,0,0,.18) 48% 52%, rgba(255,255,255,.35) 53%, transparent 60%);
  border-radius: 0 0 0 6px;
}
.sticky:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: var(--shadow-lift); z-index: 3; }
.sticky.pink { background: var(--sticky-pink); }
.sticky.blue { background: var(--sticky-blue); }
.sticky.green { background: var(--sticky-green); }
.sticky small { display: block; font-family: var(--f-body); font-weight: 600; font-size: 0.85rem; line-height: 1.5; color: var(--ink-soft); margin-top: 6px; }

/* polaroid */
.polaroid {
  --tilt: 0deg;
  background: var(--paper-white);
  padding: 12px 12px 14px;
  transform: rotate(var(--tilt));
  box-shadow: var(--shadow-art);
  border-radius: 2px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.polaroid:hover { transform: rotate(0deg) scale(1.03); box-shadow: var(--shadow-lift); z-index: 3; }
.polaroid .ph { background: var(--paper-cream); border-radius: 1px; overflow: hidden; }
.polaroid figcaption, .polaroid .cap {
  font-family: var(--f-hand); font-weight: 700; font-size: 1.25rem;
  color: var(--ink-soft); text-align: center; padding-top: 10px; line-height: 1.2;
}

/* corkboard region */
.corkboard {
  position: relative;
  border-radius: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='0.35'/%3E%3C/svg%3E"),
    #8a6844;
  border: 14px solid #6b4e2e;
  box-shadow: var(--shadow-art), inset 0 0 60px rgba(0,0,0,.35);
}

/* the flyer with tear-off tabs */
.flyer {
  --tilt: -0.6deg;
  position: relative;
  background: var(--paper-white);
  color: var(--ink);
  border-radius: 2px;
  box-shadow: var(--shadow-art);
  transform: rotate(var(--tilt));
  padding: 44px 48px 0;
}
.flyer .tabs {
  display: flex; gap: 4px;
  margin: 30px -48px 0;
  padding: 0 18px;
  justify-content: center;
  text-decoration: none;
}
.flyer .tab {
  position: relative;
  writing-mode: vertical-rl;
  background: var(--paper-white);
  color: var(--ink-soft);
  font-family: var(--f-type); font-size: 0.72rem;
  padding: 14px 7px 10px;
  border-top: 2px dashed rgba(36,28,18,.4);
  box-shadow: 0 8px 14px -4px rgba(0,0,0,.35);
  transform: rotate(var(--tt, 0deg));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
}
.flyer .tab:hover {
  transform: translateY(7px) rotate(var(--tt, 0deg));
  background: var(--highlighter);
  color: var(--ink);
}
.flyer .tab::before { /* torn notch */
  content: ""; position: absolute; top: -5px; left: 50%;
  width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg);
  background: var(--wall);
}

/* manila folder */
.folder {
  --tilt: 0deg;
  position: relative;
  background: var(--manila);
  color: var(--ink);
  border-radius: 4px 10px 6px 6px;
  box-shadow: var(--shadow-art);
  transform: rotate(var(--tilt));
  padding: 30px 32px;
}
.folder::before { /* the tab */
  content: attr(data-tab);
  position: absolute; top: -26px; left: 22px;
  background: var(--manila);
  font-family: var(--f-type); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 7px 16px 4px;
  border-radius: 6px 10px 0 0;
  box-shadow: 0 -3px 6px rgba(0,0,0,.12);
}
.folder .paper-in { /* white sheet sticking out of folder */
  background: var(--paper-white);
  border-radius: 2px;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  padding: 20px 24px;
  margin-top: 8px;
}

/* ruled notebook page with red margin */
.notebook {
  background:
    linear-gradient(90deg, transparent 0 44px, rgba(179,64,47,.55) 44px 45.5px, transparent 45.5px),
    repeating-linear-gradient(transparent 0 30px, rgba(47,86,179,.22) 30px 31px),
    var(--paper-white);
  color: var(--ink);
  border-radius: 2px;
  box-shadow: var(--shadow-art);
  padding: 26px 30px 26px 64px;
}

/* ruled index card */
.indexcard {
  background:
    repeating-linear-gradient(transparent 0 27px, rgba(47,86,179,.25) 27px 28px),
    var(--paper-white);
  color: var(--ink);
  border-radius: 4px;
  box-shadow: var(--shadow-art);
  padding: 24px 30px;
}
.indexcard::before { /* the red top rule of a real index card */
  content: ""; display: block; height: 2px; margin: -24px -30px 18px;
  background: rgba(179,64,47,.6);
}

/* tear-off planner day page */
.planner {
  --tilt: 0deg;
  position: relative;
  background: var(--paper-white);
  color: var(--ink);
  transform: rotate(var(--tilt));
  box-shadow: var(--shadow-art);
  border-radius: 2px;
  padding: 0 0 20px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.planner:hover { transform: rotate(0deg) translateY(-5px); box-shadow: var(--shadow-lift); z-index: 2; }
.planner .dayhead {
  font-family: var(--f-type); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em;
  color: var(--paper-white); background: var(--red-ink);
  padding: 8px 14px; margin-bottom: 14px;
  display: flex; justify-content: space-between; gap: 8px;
}
.planner .body { padding: 0 16px; }

/* sticker (memes etc.) */
.sticker {
  --tilt: 0deg;
  background: #fff;
  padding: 7px;
  border-radius: 6px;
  transform: rotate(var(--tilt));
  box-shadow: var(--shadow-art);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sticker:hover { transform: rotate(0deg) scale(1.06); z-index: 3; }
.sticker img { border-radius: 3px; }
.sticker .cap { font-family: var(--f-hand); font-weight: 700; text-align: center; color: var(--ink-soft); font-size: 1.1rem; padding-top: 4px; }

/* pixel sprites */
.sprite { image-rendering: pixelated; }

/* ---------- paper laptop + chat ---------- */
.laptop {
  --tilt: 0deg;
  background: var(--paper-white);
  border: 3px solid var(--ink);
  border-radius: 10px 10px 4px 4px;
  box-shadow: var(--shadow-art);
  transform: rotate(var(--tilt));
  overflow: hidden;
  color: var(--ink);
}
.laptop .screen { padding: 18px 20px 20px; }
.laptop .base { /* the keyboard deck lip */
  height: 14px; margin: 0 -3px -3px;
  background: var(--paper-cream);
  border-top: 3px solid var(--ink);
  /* no radius of its own: the parent .laptop clips the bottom corners */
}
.chat { display: flex; flex-direction: column; gap: 10px; font-size: 0.95rem; }
.chat .msg {
  max-width: 82%;
  padding: 9px 14px;
  border-radius: 14px;
  line-height: 1.45;
}
.chat .from-user {
  align-self: flex-end;
  background: var(--marker-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat .from-clanker {
  align-self: flex-start;
  background: var(--paper-cream);
  color: var(--ink);
  border: 1.5px solid rgba(36,28,18,.18);
  border-bottom-left-radius: 4px;
}
.chat .proposal {
  align-self: stretch;
  background: var(--paper-white);
  border: 2px dashed rgba(36,28,18,.45);
  border-radius: 8px;
  padding: 12px 16px;
}
.chat .proposal .actions { display: flex; gap: 10px; margin-top: 10px; }
.chat .proposal button, .chat .proposal .pbtn {
  font-family: var(--f-body); font-weight: 800; font-size: 0.85rem;
  border: 2px solid var(--ink); border-radius: 6px;
  padding: 5px 16px; cursor: pointer;
  background: var(--highlighter); color: var(--ink);
}
.chat .proposal .pbtn.ghost { background: transparent; color: var(--ink-soft); }
.chat .capnote { /* capture banner */
  font-family: var(--f-type); font-size: 0.78rem;
  color: var(--ink-soft);
  border: 1.5px dashed rgba(36,28,18,.4);
  border-radius: 6px; padding: 6px 12px;
  align-self: center;
}

/* ---------- buttons & CTAs ---------- */
.btn-buy {
  display: inline-block;
  font-family: var(--f-display);
  text-transform: uppercase;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  background: var(--highlighter);
  color: var(--ink);
  text-decoration: none;
  padding: 16px 34px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--ink), var(--shadow-art);
  transform: rotate(-1deg);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-buy:hover { transform: rotate(0deg) translateY(3px); box-shadow: 0 1px 0 var(--ink), var(--shadow-art); background: #ffe95e; }
.btn-buy:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }

/* nav rail — the wooden desk edge */
.rail {
  position: sticky; top: 0; z-index: 50;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 40%),
    repeating-linear-gradient(93deg, rgba(0,0,0,.12) 0 2px, transparent 2px 90px),
    #4c3823;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  border-bottom: 3px solid #332413;
}
.rail .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding-top: 10px; padding-bottom: 10px; }
.rail .brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-family: var(--f-display); font-size: 1.3rem; letter-spacing: 0.03em;
  color: var(--paper); text-decoration: none; text-transform: uppercase;
}
.rail .brand img { height: 40px; width: auto; }
.rail nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.rail nav a {
  font-family: var(--f-hand); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none;
  background: var(--tape);
  padding: 2px 12px;
  clip-path: polygon(3% 12%, 98% 2%, 100% 86%, 96% 100%, 4% 94%, 0% 88%);
  transform: rotate(var(--rt, -1.5deg));
  transition: transform 0.25s, background 0.25s;
}
.rail nav a:hover { transform: rotate(0deg) scale(1.06); background: var(--highlighter); }
.rail nav a.cta { background: var(--sticky-yellow); font-size: 1.2rem; }

/* footer strip */
.footstrip {
  margin-top: 90px;
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.08) 0 2px, transparent 2px 110px),
    var(--kraft);
  color: var(--ink);
  border-top: 4px solid rgba(0,0,0,.35);
  box-shadow: 0 -6px 18px rgba(0,0,0,.35);
  padding: 44px 0 30px;
}
.footstrip a { color: var(--ink); }
.footstrip .cols { display: flex; gap: 60px; flex-wrap: wrap; margin: 18px 0 26px; }
.footstrip .cols h4 { font-family: var(--f-type); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 10px; }
.footstrip ul { list-style: none; margin: 0; padding: 0; }
.footstrip li { margin-bottom: 6px; }
.footstrip .fineline { border-top: 2px dashed rgba(36,28,18,.35); padding-top: 16px; font-size: 0.85rem; color: var(--ink-soft); }

/* section rhythm on the wall */
.wallsec { position: relative; padding: 90px 0 30px; }
.sec-head { max-width: 760px; margin-bottom: 44px; }
.sec-head .anton { font-size: clamp(2.2rem, 5.2vw, 3.6rem); color: var(--paper); text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.sec-head .lede { color: rgba(247,240,221,.82); font-size: 1.08rem; max-width: 62ch; }
/* when the heading itself sits on paper, override: */
.on-paper .sec-head .anton, .paper .anton { color: var(--ink); text-shadow: none; }

/* the walking clanker along the desk edge */
.deskedge { position: relative; height: 0; }
.clanker-walk {
  position: absolute; bottom: 0; left: 0;
  width: 84px; height: auto;
  animation: patrol 26s linear infinite;
  pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.4));
}
@keyframes patrol {
  0%   { transform: translateX(-10vw) scaleX(1); }
  49%  { transform: translateX(96vw) scaleX(1); }
  50%  { transform: translateX(96vw) scaleX(-1); }
  99%  { transform: translateX(-10vw) scaleX(-1); }
  100% { transform: translateX(-10vw) scaleX(1); }
}

/* hero entrance: artifacts settle onto the wall once */
.settle { animation: settle 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.settle.d1 { animation-delay: 0.08s; } .settle.d2 { animation-delay: 0.18s; }
.settle.d3 { animation-delay: 0.28s; } .settle.d4 { animation-delay: 0.38s; }
@keyframes settle {
  from { opacity: 0; transform: rotate(calc(var(--tilt, 0deg) * 3)) translateY(-26px) scale(1.04); }
  to   { opacity: 1; transform: rotate(var(--tilt, 0deg)) translateY(0) scale(1); }
}

/* highlight swipe for emphasis in ink copy */
.hl { background: linear-gradient(transparent 55%, var(--highlighter) 55% 92%, transparent 92%); color: var(--ink); padding: 0 2px; }
.redink { color: var(--red-ink); font-weight: 800; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  body { background-attachment: scroll; }
  .wrap { padding: 0 16px; }
  .wallsec { padding: 60px 0 20px; }
  .flyer { padding: 30px 22px 0; }
  .flyer .tabs { margin: 22px -22px 0; }
  .rail nav a { font-size: 1rem; padding: 2px 9px; }
  .paper, .folder, .notebook, .indexcard { padding-left: 20px; padding-right: 20px; }
  .notebook { padding-left: 52px; }
  .paper:hover, .sticky:hover, .polaroid:hover, .planner:hover { transform: none; }
  .clanker-walk { width: 60px; animation-duration: 20s; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .settle, .clanker-walk, .graphite::after { animation: none; }
  .redpen { animation: none; clip-path: none; opacity: 1; } /* annotation stays, static */
  .chat .anim-typing::after { animation: none; }
  .paper, .sticky, .polaroid, .planner, .sticker, .flyer .tab, .btn-buy, .rail nav a { transition: none; }
}
