/* Haena Family: a family zine. Drawing paper, black marker, three highlighters.
   All other colour comes from Haena's drawings. */
:root {
  --paper: #fbfbf8;
  --ink: #17171a;
  --ink-soft: #45454d;
  --yellow: #ffe94d;
  --pink: #ff9ccc;
  --teal: #7fe0d6;
  --tape: rgb(255 233 77 / .72);
  --hand: "Shantell Sans", "Gaegu", "Comic Sans MS", cursive;
  --body: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  /* wobbly marker box */
  --wobble: 18px 6px 22px 8px / 8px 20px 6px 18px;
  --wobble-2: 8px 22px 7px 19px / 20px 7px 18px 8px;
  --gap: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
:lang(ko) { --hand: "Gaegu", "Shantell Sans", cursive; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; overflow-x: clip; }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint pencil grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 17px/1.7 var(--body);
  overflow-x: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
::selection { background: var(--yellow); color: var(--ink); }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; text-decoration-color: var(--ink); }
a:hover { background-color: var(--yellow); }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--yellow); padding: 8px 14px; border: 2px solid var(--ink); }
.skip:focus { top: 12px; }

h1, h2, h3, .hand { font-family: var(--hand); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; }
:lang(ko) :is(h1, h2, h3, .hand) { font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); margin: 0 0 .25em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 .35em; }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 0 0 .3em; }
:lang(ko) h1 { font-size: clamp(2.7rem, 7vw, 5.2rem); }
:lang(ko) h2 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
:lang(ko) h3 { font-size: clamp(1.6rem, 3vw, 2rem); }
p { margin: 0 0 1em; max-width: 66ch; text-wrap: pretty; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); }

/* highlighter swipe behind words */
.hl { background: linear-gradient(176deg, transparent 0 48%, var(--yellow) 48% 90%, transparent 90%); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl-pink { --yellow: var(--pink); }
.hl-teal { --yellow: var(--teal); }

/* ---------- masthead ---------- */
.mast, main > *, .foot { width: min(1200px, 100% - 2 * var(--gap)); margin-inline: auto; }
.mast { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding: 18px 0 10px; }
.logo { display: grid; text-decoration: none; line-height: 1; }
.logo:hover { background: none; }
.logo-en { font: 800 clamp(1.6rem, 3vw, 2.1rem)/1 "Shantell Sans", cursive; letter-spacing: -.02em; }
.logo-ko { font: 700 1.35rem/1.2 "Gaegu", cursive; color: var(--ink-soft); margin-top: 2px; }
.mast nav { display: flex; flex-wrap: wrap; gap: 4px 6px; font: 700 1.15rem/1 var(--hand); }
:lang(ko) .mast nav { font-size: 1.35rem; }
.mast nav a { text-decoration: none; padding: 8px 10px; border-radius: var(--wobble); }
.mast nav a[aria-current] { background: var(--yellow); }
.mast nav .lang { margin-left: 6px; padding: 2px 6px !important; }

/* ---------- buttons ---------- */
/* every box is drawn with the same marker stroke (9-slice border-image) */
.btn, .play, .screen, .strip li, .mast nav .lang {
  border-style: solid !important; border-width: 10px !important; border-color: transparent !important; border-image: url("/assets/marker-box.svg") 11 / 10px stretch !important; border-radius: 0 !important; background-clip: padding-box;
}
.btn, .play {
  display: inline-flex; align-items: center; gap: .5em;
  font: 800 1.15rem/1.1 var(--hand); color: var(--ink); text-decoration: none;
  background-color: var(--paper);
  padding: .55em 1em; min-height: 48px;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), background-color .2s;
}
:lang(ko) :is(.btn, .play) { font-size: 1.4rem; font-weight: 700; }
.play { background-color: var(--yellow); font-size: clamp(1.25rem, 2.2vw, 1.5rem); padding: .75em 1.3em; }
:lang(ko) .play { font-size: clamp(1.5rem, 2.6vw, 1.85rem); }
.btn:hover, .play:hover { background-color: var(--pink); transform: rotate(-1.5deg) scale(1.03); }
.btn:active, .play:active { transform: translateY(2px); }
.play-ico { width: 1.05em; height: 1.05em; fill: var(--ink); }

/* ---------- taped drawings ---------- */
.taped { position: relative; margin: 0; background: #fff; padding: 10px; border-radius: 3px;
  box-shadow: 0 1px 2px rgb(23 23 26 / .12), 0 10px 24px -12px rgb(23 23 26 / .35); }
.taped::before, .taped::after { content: ""; position: absolute; width: 84px; height: 26px; background: var(--tape); top: -12px; mix-blend-mode: multiply; }
.taped::before { left: -14px; transform: rotate(-24deg); }
.taped::after { right: -14px; transform: rotate(21deg); background: rgb(127 224 214 / .7); }
.taped img, .taped video { width: 100%; }
.tilt-l { rotate: -2.2deg; }
.tilt-r { rotate: 1.8deg; }
figcaption { font: 700 1.05rem/1.35 var(--hand); padding: 10px 4px 2px; }
:lang(ko) figcaption { font-size: 1.25rem; }

.stamp { display: inline-block; font: 800 .8rem/1 "Shantell Sans", cursive; letter-spacing: .04em; text-transform: uppercase;
  color: #c2185b; white-space: nowrap; border: 2px solid currentColor; border-radius: 6px; padding: 5px 8px; rotate: -4deg; margin: 0 8px 6px 0; }

/* ---------- marker arrow ---------- */
.arrow { width: 150px; overflow: visible; }
.arrow path { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.js .arrow path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.16, 1, .3, 1); }
.js .arrow path + path { transition-delay: .8s; transition-duration: .4s; }
.js .drawn .arrow path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .js .arrow path { stroke-dashoffset: 0; transition: none; } .btn, .play { transition: none; } }

/* ---------- the spread: drawing -> game ---------- */
.intro { padding-top: clamp(8px, 2vw, 24px); }
.intro p { margin-bottom: 0; }
.spread { display: grid; grid-template-columns: minmax(150px, .5fr) auto minmax(0, 1.5fr); align-items: center; gap: 8px clamp(8px, 2vw, 28px); padding-block: clamp(16px, 2vw, 24px) clamp(40px, 5vw, 64px); }
.intro + .spread { padding-bottom: 44px; }
.band.spread { padding-top: 56px; }
.spread .art { max-width: 220px; justify-self: end; }
.game { max-width: 640px; }
.spread .art figcaption { font-size: .98rem; display: grid; justify-items: start; gap: 2px; }
:lang(ko) .spread .art figcaption { font-size: 1.15rem; }
.became { display: grid; justify-items: center; gap: 2px; font: 700 1.25rem/1.1 var(--hand); text-align: center; }
:lang(ko) .became { font-size: 1.5rem; }
.became .arrow { width: clamp(90px, 10vw, 150px); }
.game { display: grid; gap: 14px; justify-items: start; }
.screen { display: block; background-color: transparent; width: 100%; }
.screen img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.screen:hover { background-color: #38bdf8; }
.screen:hover { transform: rotate(-.6deg); background-color: transparent; }
.screen { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.game-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.game-row p { margin: 0; font-size: .98rem; color: var(--ink-soft); max-width: 36ch; }
.spread.flip { grid-template-columns: minmax(0, 1.5fr) auto minmax(150px, .5fr); }
.spread.flip .art { justify-self: start; order: 3; }
.spread.flip .became { order: 2; }
.spread.flip .became .arrow { transform: scaleX(-1); }
.spread.flip .game { order: 1; }
.spread h2 { margin: 0; }

/* full-bleed highlighter band behind a section */
.band { position: relative; isolation: isolate; }
.band::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(50% - 50vw); background: var(--teal); opacity: .5; transform: rotate(-1.2deg); }
.band-pink::before { background: var(--pink); opacity: .42; transform: rotate(.9deg); }
.band-yellow::before { background: var(--yellow); opacity: .55; }

/* ---------- comic strip: how a drawing becomes a game ---------- */
.how { padding-block: clamp(40px, 7vw, 88px); }
.strip { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: .85fr .75fr 1.05fr 1.35fr; gap: 14px; counter-reset: step; }
.strip li { counter-increment: step; background: #fff; padding: 14px 14px 16px; display: grid; grid-template-rows: auto 1fr; gap: 10px; position: relative; }
.strip li:nth-child(even) { border-radius: var(--wobble-2); }
.strip li::before { content: counter(step); position: absolute; top: -18px; left: 12px; width: 38px; height: 38px; display: grid; place-items: center;
  font: 800 1.25rem/1 "Shantell Sans", cursive; background: var(--yellow); border: 3px solid var(--ink); border-radius: 50% 45% 52% 48%; }
.strip .pic { height: 210px; display: grid; place-items: center; overflow: hidden; }
.strip .pic img { max-height: 210px; width: auto; object-fit: contain; }
.strip .pic.wide img { width: 100%; height: 210px; object-fit: cover; border-radius: 6px; }
.strip .pic.cut { background: repeating-conic-gradient(#ececec 0 25%, #fff 0 50%) 0 0 / 18px 18px; border-radius: 6px; }
.strip p { margin: 0; font-size: .97rem; }
.strip strong { display: block; font: 700 1.2rem/1.2 var(--hand); margin-bottom: 4px; }
:lang(ko) .strip strong { font-size: 1.45rem; }

/* ---------- video ---------- */
.alive { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(48px, 7vw, 90px); }
.alive .taped { max-width: 300px; }

/* ---------- collage wall ---------- */
.wall-teaser { padding-block: clamp(40px, 7vw, 88px); }
.collage { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; align-items: start; margin: 26px 0 30px; }
.collage .taped:nth-child(1) { grid-column: span 4; }
.collage .taped:nth-child(2) { grid-column: span 3; margin-top: 40px; }
.collage .taped:nth-child(3) { grid-column: span 5; }
.collage .taped:nth-child(4) { grid-column: 2 / span 6; }
.collage .taped:nth-child(5) { grid-column: span 3; margin-top: 30px; }

.wall { columns: 3 280px; column-gap: 28px; margin-top: 26px; }
.wall .taped { break-inside: avoid; margin: 0 0 34px; display: inline-block; width: 100%; }
.wall figcaption { font-family: var(--body); font-weight: 400; font-size: .95rem; line-height: 1.55; }
.wall figcaption strong { display: block; font: 700 1.25rem/1.2 var(--hand); margin: 4px 0; }
:lang(ko) .wall figcaption strong { font-size: 1.5rem; }
.intro + section > h2 { margin-top: 1.2em; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 300px)); gap: 34px; margin-top: 22px; }

/* ---------- character pages ---------- */
.char { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 6vw, 72px); }
.char.flip { grid-template-columns: 1fr minmax(200px, 320px); }
.char.flip > .taped { order: 2; }
.char > .taped { max-width: 300px; justify-self: center; }
.pins { position: relative; }
.pin { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; display: grid; place-items: center; font: 800 1rem/1 "Shantell Sans", cursive;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 50% 44% 52% 47%; }
.callouts { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; gap: 10px; }
.callouts li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; }
.callouts b { width: 30px; height: 30px; display: grid; place-items: center; font: 800 .95rem/1 "Shantell Sans", cursive; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 50% 44% 52% 47%; }

/* ---------- game page ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 40px; padding-block: 8px clamp(40px, 6vw, 72px); }
.facts section { padding-top: 22px; background: url("/assets/marker-line.svg") top left / 100% 8px no-repeat; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.keys li { display: flex; gap: 12px; align-items: baseline; }
kbd { font: 700 .9rem/1 var(--body); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 7px; padding: 5px 8px; background: #fff; white-space: nowrap; }
.next { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: center; padding-block: clamp(36px, 6vw, 72px); }
.next img { width: 150px; }

/* ---------- prose pages ---------- */
.prose { max-width: 760px; padding-block: clamp(16px, 4vw, 40px) 56px; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 1.6em; }
:lang(ko) .prose h2 { font-size: clamp(1.8rem, 3.4vw, 2.3rem); }
.note { color: var(--ink-soft); font-size: .95rem; }

.ad-slot { margin-block: 28px; min-height: 0; }
.ad-slot:empty { display: none; }

/* ---------- footer ---------- */
.foot { margin-top: clamp(40px, 7vw, 90px); padding: 30px 0 40px; background: url("/assets/marker-line.svg") top left / 100% 8px no-repeat; color: var(--ink-soft); font-size: .95rem; }
.foot p { margin: 0 0 .5em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .intro .lede { font-size: 1rem; }
  .spread .pin { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: .75rem; border-width: 2px; }
  .spread, .spread.flip { grid-template-columns: minmax(0, 96px) auto; justify-content: start; column-gap: 18px; row-gap: 4px; padding-top: 16px; }
  .spread .art, .spread.flip .art { order: 0; justify-self: start; max-width: 96px; padding: 5px; margin-top: 8px; }
  .spread .game h2 { font-size: 1.9rem; }
  .spread .game > .screen { order: 2; }
  .spread .art .pins .pin { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: .65rem; }
  .spread .art .stamp { font-size: .72rem; padding: 4px 5px; }
  .spread .art figcaption { font-size: .9rem; }
  .spread .became, .spread.flip .became { order: 1; justify-self: start; }
  .spread .became .arrow, .spread.flip .became .arrow { transform: rotate(35deg); width: 92px; }
  .spread .game, .spread.flip .game { order: 2; grid-column: 1 / -1; width: 100%; max-width: none; }
  .strip { grid-template-columns: 1fr 1fr; row-gap: 30px; }
  .alive, .char, .char.flip { grid-template-columns: 1fr; }
  .char.flip > .taped { order: 0; }
  .alive .taped, .char > .taped { max-width: 320px; justify-self: center; }
  .collage .taped:nth-child(n) { grid-column: span 6; margin-top: 0; }
  .collage .taped:nth-child(5) { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .mast nav { font-size: 1.05rem; }
  :lang(ko) .mast nav { font-size: 1.25rem; }
  .mast nav a { padding: 8px 7px; }
  .strip { grid-template-columns: 1fr; }
  .play { width: 100%; justify-content: center; }
}

/* pins on the hero original */
.art .pins .pin { width: 28px; height: 28px; margin: -14px 0 0 -14px; font-size: .85rem; }
.art-notes { list-style: none; padding: 0; margin: 4px 0 0; font: 700 .95rem/1.35 var(--hand); }
:lang(ko) .art-notes { font-size: 1.15rem; }
.art-notes b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; font: 800 .7rem/1 "Shantell Sans", cursive; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; }
@media (max-width: 860px) { .art-notes { display: none; } }
video { accent-color: var(--pink); background: var(--ink); }
.intro + .spread { padding-bottom: 20px; }
.intro + .spread .game-row p { font-size: .92rem; line-height: 1.5; }

/* ---------- game update log ---------- */
.updates { padding-block: 0 clamp(36px, 5vw, 56px); }
.log { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; max-width: 760px; }
.log li { display: grid; grid-template-columns: 8.2em 1fr; gap: 6px 14px; align-items: baseline; }
.log .stamp { justify-self: start; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; } }
.log .tag { display: inline-block; margin-right: 6px; padding: 1px 8px; font-size: .85em; color: var(--ink); text-decoration: none; background: #fff; border: 2px solid var(--ink); border-radius: 999px; }
.updates > .btn { margin-top: 20px; }
