:root {
  --paper: #F6EEDF;
  --paper-deep: #EADCC4;
  --ink: #1E2240;
  --tomato: #E5583B;
  --mustard: #F2B134;
  --teal: #1F8A84;
  --sky: #9DCBE1;
  --pink: #F2B2A6;
  --plum: #5A3B66;
  --leaf: #7FA86A;
  --peach: #F6CDA8;

  --shadow: 3px 5px 0 rgba(30, 34, 64, 0.22);
  --font-display: ui-rounded, "SF Pro Rounded", "Avenir Next", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.14rem/1.55 var(--font-body);
}

/* Paper grain over everything; pure decoration. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.3 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.defs { position: absolute; width: 0; height: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.8rem, 3.2vw, 2.9rem); }
p { margin: 0 0 0.8em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

/* ---------- language toggle ---------- */
.lang {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}
.lang button {
  font: 800 0.9rem/1 var(--font-display);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.55em 0.85em;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang button:focus-visible, a:focus-visible { outline: 3px solid var(--tomato); outline-offset: 3px; }

/* ---------- way home (story pages) ---------- */
.home-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 60;
  font: 800 0.9rem/1 var(--font-display);
  color: var(--ink);
  background: var(--paper);
  padding: 0.75em 1em;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

/* ---------- pages ---------- */
.page {
  --bg: var(--paper);
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: clamp(72px, 9vh, 110px) clamp(20px, 7vw, 120px);
  background: var(--bg);
  overflow-x: clip;
  scroll-snap-align: start;
  isolation: isolate;
}
.page--flip { grid-template-columns: 1fr 1.05fr; }

/* torn top edge where one page meets the next */
.page + .page::before {
  content: "";
  position: absolute;
  top: -14px;
  left: -2%;
  width: 104%;
  height: 30px;
  background: var(--bg);
  filter: url(#rough) drop-shadow(0 -3px 0 rgba(30, 34, 64, 0.12));
  z-index: 1;
}

.page--cream   { --bg: #E6D5B8; }
.page--ink     { --bg: var(--ink); color: var(--paper); }
.page--pink    { --bg: var(--pink); }
.page--sky     { --bg: var(--sky); }
.page--teal    { --bg: #A9D3C6; }
.page--mustard { --bg: #F5CB6B; }
.page--plum    { --bg: var(--plum); }
.page--night   { --bg: var(--ink); color: var(--paper); }

.page__num {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font: 800 0.95rem/1 var(--font-display);
  opacity: 0.55;
}
.page__num::before, .page__num::after { content: " — "; }

.page__art { position: relative; margin: 0; min-width: 0; }
.art { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- paper card ---------- */
.card {
  position: relative;
  padding: clamp(22px, 3vw, 44px);
  max-width: 34rem;
  transform: rotate(-0.8deg);
  z-index: 2;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  filter: url(#rough) drop-shadow(var(--shadow));
}
.page--flip .card { transform: rotate(0.7deg); justify-self: end; }
.card--dark::before { background: #2C3158; }

.note {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7em 0.9em;
  background: var(--mustard);
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: rotate(0.8deg);
  margin-top: 1em;
}
.ask {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--tomato);
}
.big-number { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--mustard); }

.label { font: 800 13px var(--font-display); fill: var(--ink); }
.label--small { font-size: 11px; }

/* ---------- Stick Oğuz ---------- */
.fig-bone {
  stroke: var(--ink);
  stroke-width: 5.5;
  stroke-linecap: round;
}
.fig-head circle { fill: var(--peach); stroke: var(--ink); stroke-width: 3; }
.fig-face circle { fill: var(--ink); }
.fig-face path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.fig-joint {
  fill: var(--mustard);
  stroke: var(--ink);
  stroke-width: 2;
  animation: glow 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes glow {
  0%, 100% { fill: var(--mustard); }
  50% { fill: #FFE7A3; }
}
.fig { filter: drop-shadow(2px 3px 0 rgba(30, 34, 64, 0.2)); }
.fig--dots .fig-bone { stroke: rgba(30, 34, 64, 0.12); stroke-dasharray: 0.04 0.06; }
.fig--dots .fig-head { opacity: 0.25; }
.fig--dots .fig-joint { r: 5.5; }
.fig--ghost { filter: none; }
.fig--ghost .fig-bone { stroke: var(--teal); opacity: 0.45; stroke-width: 9; }
.fig--ghost .fig-head, .fig--ghost .fig-joint { display: none; }

.floor { fill: var(--leaf); filter: url(#rough); }
.floor-line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: 0.4; }
.paper-sheet { fill: var(--paper); filter: url(#rough) drop-shadow(2px 4px 0 rgba(30, 34, 64, 0.16)); }
.page--teal .paper-sheet { fill: var(--paper); }

/* ---------- hero ---------- */
.page--hero {
  --bg: var(--mustard);
  grid-template-columns: 1.25fr 1fr;
}
.hero__text { position: relative; z-index: 2; }
.tag {
  display: inline-block;
  font: 800 0.95rem/1 var(--font-display);
  letter-spacing: 0.04em;
  padding: 0.6em 0.95em;
  margin: 0 0.4em 0.9em 0;
  box-shadow: var(--shadow);
}
.tag--course { background: var(--paper); transform: rotate(-2deg); }
.tag--topic { background: var(--tomato); color: var(--paper); transform: rotate(1.5deg); }
.hero__title {
  font-size: clamp(2.6rem, 6.4vw, 6rem);
  line-height: 0.98;
  margin: 0.15em 0 0.4em;
  max-width: 11ch;
  color: var(--ink);
  text-shadow: 3px 4px 0 rgba(246, 238, 223, 0.7);
}
.hero__tagline { font-size: clamp(1.1rem, 1.6vw, 1.35rem); max-width: 28rem; }
.hero__art { position: relative; z-index: 2; justify-self: center; width: min(100%, 360px); }
.hero__art .art { width: 100%; }

.cut { position: absolute; z-index: 0; filter: url(#rough) drop-shadow(var(--shadow)); }
.cut--sun { width: 34vmin; height: 34vmin; border-radius: 50%; background: var(--tomato); right: 8vw; top: 10vh; }
.cut--hill-a { left: -10%; right: 30%; bottom: -12vh; height: 32vh; border-radius: 50% 50% 0 0; background: var(--teal); }
.cut--hill-b { left: 35%; right: -15%; bottom: -16vh; height: 36vh; border-radius: 50% 50% 0 0; background: var(--leaf); }

.bubble {
  position: relative;
  font: 800 1.05rem/1.25 var(--font-display);
  background: var(--paper);
  padding: 0.8em 1em;
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 15rem;
  margin: 0 0 0.6em;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 30%;
  border: 8px solid transparent;
  border-top: 14px solid var(--paper);
}
.bubble--hero { transform: rotate(-3deg); margin-left: -1rem; }
.bubble--s1 { position: absolute; top: -4%; right: 6%; transform: rotate(3deg); }
.bubble--s1::after { left: 40%; }

.scroll-cue {
  position: absolute;
  z-index: 3;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font: 800 1rem/1 var(--font-display);
  color: var(--paper);
  background: var(--ink);
  padding: 0.75em 1.2em;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ---------- page 1 ---------- */
.phone rect { fill: var(--ink); }
.phone__lens { fill: var(--sky); }
.phone__rec { fill: var(--tomato); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.book { fill: var(--tomato); }
.beam { fill: var(--mustard); opacity: 0.22; }

/* ---------- page 2: grid ---------- */
.grid text { font: 700 13px var(--font-display); text-anchor: middle; }
.art--grid { max-width: 520px; margin: 0 auto; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.35)); }
figcaption { font: 700 0.9rem/1.3 var(--font-display); opacity: 0.75; margin-top: 1em; text-align: center; }

/* ---------- page 3: joint card ---------- */
.art--dots { max-width: 560px; }
.callout-ring { fill: none; stroke: var(--tomato); stroke-width: 2.5; stroke-dasharray: 3 3; }
.joint-card {
  position: absolute;
  left: 2%;
  top: 2%;
  margin: 0;
  padding: 0.8em 1.1em;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
  font: 700 0.95rem/1.45 var(--font-display);
}
.joint-card dt { color: var(--tomato); font-weight: 800; }
.joint-card dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- page 4: skeleton draws itself ---------- */
.art--figure { max-width: 400px; margin: 0 auto; }
.dropped circle { fill: var(--paper); stroke: var(--tomato); stroke-width: 1.4; stroke-dasharray: 2 1.5; }
.badge {
  position: absolute;
  right: 4%;
  top: 6%;
  margin: 0;
  font: 800 clamp(1.4rem, 2.6vw, 2.2rem)/1 var(--font-display);
  background: var(--tomato);
  color: var(--paper);
  padding: 0.45em 0.7em;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
}

/* ---------- page 5 ---------- */
.paper-sheet--grid { fill: #FBF6EC; }
.axes line { stroke: var(--ink); stroke-width: 2; opacity: 0.5; }
.origin { fill: var(--tomato); stroke: var(--ink); stroke-width: 2; }
.unit-line { stroke: var(--tomato); stroke-width: 3; stroke-dasharray: 4 3; }
.arrow { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.arrow-head { fill: var(--ink); }
.steps { margin: 0.6em 0 0; padding-left: 1.4em; }
.steps li { margin-bottom: 0.45em; }
.steps li::marker { font-family: var(--font-display); font-weight: 800; color: var(--tomato); }

/* ---------- page 6: wave ---------- */
.filmstrip > rect { fill: var(--ink); }
.holes rect { fill: var(--paper); }
.axis { stroke: var(--ink); stroke-width: 2; opacity: 0.5; }
.wave { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.wave--light { stroke: var(--mustard); }
.peaks circle { fill: var(--teal); stroke: var(--ink); stroke-width: 2; }
.dips circle { fill: var(--tomato); stroke: var(--ink); stroke-width: 2; }
.label--peak { fill: var(--teal); }
.label--dip { fill: var(--tomato); }

/* ---------- page 7: strips ---------- */
.strip { filter: drop-shadow(2px 3px 0 rgba(30, 34, 64, 0.2)); }
.strip--a { fill: var(--tomato); }
.strip--b { fill: var(--teal); }
.strip--c { fill: var(--plum); }
.label--on-strip { fill: var(--paper); font-size: 12px; }
.ticks line { stroke: var(--paper); stroke-width: 1.4; }
.half { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 6 4; }
.label--half { fill: var(--ink); }

/* ---------- page 8: recipe ---------- */
.page--plum h2 { color: var(--ink); }
.recipe {
  margin: 0 auto 1.4em;
  padding: 1.2em 1.4em;
  max-width: 26rem;
  background: var(--paper);
  box-shadow: 5px 7px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-1.5deg);
  font-family: var(--font-display);
  border-top: 10px solid var(--tomato);
}
.recipe div { display: grid; grid-template-columns: 7.5em 1fr; gap: 0.8em; padding: 0.4em 0; border-bottom: 2px dashed rgba(30, 34, 64, 0.2); align-items: baseline; }
.recipe div:last-child { border-bottom: 0; }
.recipe dt { font-weight: 800; font-size: 1.15rem; color: var(--tomato); font-variant-numeric: tabular-nums; }
.recipe dd { margin: 0; font-weight: 600; }
.art--cos .label { fill: var(--paper); }
.mean { stroke: var(--paper); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0.7; }
.amp { stroke: var(--pink); stroke-width: 3; }

/* ---------- page 9 ---------- */
.gap { stroke: var(--tomato); stroke-width: 3; stroke-linecap: round; }
.label--ghost { fill: var(--teal); }
.label--you { fill: var(--tomato); }

/* ---------- page 10: limits ---------- */
.page--limits { grid-template-columns: 0.8fr 1.4fr; }
.limits__head h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.limits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2vw, 26px);
}
.limit {
  position: relative;
  padding: 1.1em 1.2em;
  font-size: 1rem;
  line-height: 1.45;
  z-index: 0;
}
.limit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  filter: url(#rough) drop-shadow(var(--shadow));
}
.limit:nth-child(1) { transform: rotate(-1.2deg); }
.limit:nth-child(2) { transform: rotate(1deg); }
.limit:nth-child(3) { transform: rotate(0.6deg); }
.limit:nth-child(4) { transform: rotate(-0.8deg); }
.limit h3 { font-size: 1.2rem; margin-bottom: 0.35em; color: var(--tomato); }

/* ---------- page 11 ---------- */
.question {
  font-size: clamp(1.9rem, 3.6vw, 3.2rem);
  color: var(--mustard);
  margin: 0.3em 0 0.8em;
}
.source { font-size: 0.95rem; opacity: 0.75; max-width: 34rem; }
.back {
  display: inline-block;
  margin-top: 1.2em;
  font: 800 1rem/1 var(--font-display);
  color: var(--ink);
  background: var(--paper);
  padding: 0.75em 1.2em;
  text-decoration: none;
  box-shadow: 3px 5px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(-1.5deg);
}
.page--night .fig-head circle { fill: var(--peach); }
.page--night .fig-bone { stroke: var(--paper); }
.page--night .fig-head circle, .page--night .fig-joint { stroke: var(--paper); }
.page--night .fig-face path { stroke: var(--ink); }
.cut--qmark {
  top: -6%;
  right: 6%;
  font: 900 clamp(5rem, 12vw, 10rem)/1 var(--font-display);
  color: var(--tomato);
  filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.35));
  transform: rotate(12deg);
}

/* ---------- reveal on scroll (only when JS runs) ---------- */
.js .reveal {
  opacity: 0;
  translate: 0 36px;
  transition: opacity 0.7s ease, translate 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.js .in-view .reveal { opacity: 1; translate: 0 0; }
.js .in-view .reveal:nth-child(2) { transition-delay: 0.08s; }
.js .in-view .reveal:nth-child(3) { transition-delay: 0.16s; }
.js .in-view .reveal:nth-child(4) { transition-delay: 0.24s; }

.js .art--draw .fig-bone { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s ease 0.3s; }
.js .in-view .art--draw .fig-bone { stroke-dashoffset: 0; }
.js .art--wave .wave { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.2s ease 0.2s; }
.js .in-view .art--wave .wave { stroke-dashoffset: 0; }

/* Layers drift at different speeds while a page scrolls past (where supported). */
@supports (animation-timeline: view()) {
  .page__art, .hero__art {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  .cut--sun { animation: sun linear both; animation-timeline: view(); }
}
@keyframes drift { from { transform: translateY(40px); } to { transform: translateY(-40px); } }
@keyframes sun { from { transform: translateY(-30px) scale(0.92); } to { transform: translateY(60px) scale(1.06); } }

/* ---------- small screens: one page per screen, art above text ---------- */
@media (max-width: 820px) {
  html { scroll-snap-type: y proximity; }
  body { font-size: 0.97rem; }
  .page, .page--flip, .page--hero, .page--limits {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 18px;
    padding: 78px 18px 48px;
  }
  .page--flip .page__art { order: -1; }
  .page--text-first .page__art { order: 0; }
  .page--flip .card { justify-self: stretch; }
  .card { padding: 20px 20px 22px; transform: none; max-width: none; }
  .page--flip .card { transform: none; }
  h2 { font-size: 1.65rem; }
  .page__art { max-height: 40svh; display: flex; flex-direction: column; justify-content: center; }
  .page__art .art { max-height: 30svh; }
  .hero__art { width: 62%; justify-self: end; margin-top: -8px; }
  .hero__art .art { max-height: 30svh; }
  .bubble--hero { font-size: 0.9rem; }
  .hero__art .bubble--hero { margin-left: -40%; }
  .hero__title { font-size: 2.7rem; }
  .cut--sun { width: 46vmin; height: 46vmin; top: auto; bottom: 22vh; right: -6vw; }
  .limits { grid-template-columns: 1fr; gap: 10px; }
  .limit { padding: 0.75em 0.9em; font-size: 0.92rem; }
  .limit h3 { font-size: 1.02rem; }
  .joint-card { font-size: 0.8rem; }
  .recipe { margin-bottom: 0.6em; font-size: 0.92rem; }
  .question { font-size: 1.75rem; }
  .page--night .page__art { order: -1; max-height: 26svh; }
  .scroll-cue { bottom: 18px; }
  .page__art, .hero__art { animation: none; }
  .lang { top: 10px; right: 10px; padding: 4px; }
  .home-link { top: 10px; left: 10px; padding: 0.65em 0.85em; font-size: 0.8rem; }
  .lang button { padding: 0.45em 0.7em; font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .js .art--draw .fig-bone, .js .art--wave .wave { stroke-dashoffset: 0; }
}

/* ---------- issue 1, page 2: magnifier over the arm ---------- */
.art--lens { max-width: 560px; margin: 0 auto; }
.art--lens .frame { fill: #2C3158; filter: url(#rough); }
.lens-fig line, .lens-fig polyline { stroke: var(--paper); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.lens-fig .lens-fig__arm { stroke-width: 12; }
.lens-fig__head, .lens-fig__hand { fill: var(--peach); stroke: var(--paper); stroke-width: 4; }
.lens-fig__joint { fill: var(--mustard); stroke: var(--ink); stroke-width: 2.5; }
.lens-bg { fill: var(--ink); }
.lens-handle { stroke: var(--tomato); stroke-width: 26; stroke-linecap: round; }
.lens-handle--ink { stroke: var(--paper); stroke-width: 34; }
.lens-rim { fill: none; stroke: var(--mustard); stroke-width: 14; }
.lens-rim--ink { stroke: var(--paper); stroke-width: 22; }
.lens-shine { fill: none; stroke: #FFFFFF; stroke-width: 6; stroke-linecap: round; opacity: 0.7; }
.art--lens .grid text { font-size: 15px; }
.lens-fig__face circle { fill: var(--ink); }
.lens-fig__face path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
