/* Front page: a printed comic page — ink, paper and one spot colour (jusa). Design: docs/homepage.md §9 (B). */
:root {
    --paper: #f7f3ea;
    --gutter: #ebe6da;
    --ink: #1d1a17;
    --ink-2: #4a443d;
    --tone: #847c71;
    --spot: #a8321e;
    --balloon: #ffffff;
    --display: "Black Han Sans", "Noto Sans KR", sans-serif;
    --sans: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--gutter); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }

.page {
    max-width: 1040px; margin: 24px auto 40px; padding: 18px; background: var(--paper);
    box-shadow: 0 1px 0 #cfc7b6, 0 20px 40px -24px rgba(29, 26, 23, .4);
    display: grid; gap: 14px;
}
.panel { position: relative; border: 4px solid var(--ink); background: var(--paper); overflow: hidden; }

/* screentone and speed lines */
.tone { position: absolute; inset: 0; background-image: radial-gradient(var(--tone) 1.1px, transparent 1.3px); background-size: 7px 7px; opacity: .55; }
.tone.fade { -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 70%); mask-image: linear-gradient(160deg, #000 10%, transparent 70%); }
.speed { position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 85% 60%, var(--ink) 0 .6deg, transparent .6deg 7deg); opacity: .12; }

/* title panel */
.title { padding: 28px 30px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; min-height: 180px; }
.title h1 { position: relative; margin: 0; font: 400 clamp(44px, 8vw, 92px)/.95 var(--display); letter-spacing: -.01em; }
.title-side { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.caption { margin: 0; background: var(--paper); border: 3px solid var(--ink); padding: 8px 12px; font-size: 14px; max-width: 300px; }
.lang { display: flex; border: 3px solid var(--ink); background: var(--paper); }
.lang button { border: 0; background: none; font: 700 12px var(--sans); padding: 3px 10px; cursor: pointer; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* section panels: the first (lead) panel is tall on the left, the rest stack on the right */
.panels { display: grid; gap: 14px; grid-template-columns: 1.2fr 1fr; grid-auto-rows: minmax(200px, auto); }
.panels .lead { grid-row: span var(--rest, 1); min-height: 420px; }
.panels.solo { grid-template-columns: 1fr; }
.sec { display: flex; flex-direction: column; gap: 18px; padding: 40px 16px 16px 22px; transition: transform .15s; }
.sec:hover { transform: rotate(-.6deg) scale(1.01); }
.sec:hover .balloon { transform: translateY(-3px); }
/* whole panel is a link; stamps are their own links on top */
.sec .hit { position: absolute; inset: 0; z-index: 1; }
.sec .no { position: absolute; top: 10px; left: 12px; font: 700 12px var(--sans); letter-spacing: .12em; color: var(--ink-2); }
.foot {
    position: relative; z-index: 2; pointer-events: none;
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px;
}
.word { margin: 0; font: 400 clamp(40px, 6vw, 72px)/1 var(--display); }
.word small { display: block; font: 700 13px var(--sans); letter-spacing: .2em; color: var(--spot); margin-bottom: 6px; }
.art { position: absolute; right: -6%; top: 8%; width: 78%; image-rendering: pixelated; border: 4px solid var(--ink); transform: rotate(2deg); background: var(--gutter); }

.balloon {
    position: relative; align-self: flex-end; max-width: 62%; margin: 0 0 auto; background: var(--balloon); border: 3px solid var(--ink);
    border-radius: 50% / 46%; padding: 14px 20px; font: 500 15px/1.4 var(--sans); text-align: center; transition: transform .15s;
}
.balloon::after { content: ""; position: absolute; left: 22%; bottom: -16px; border: 9px solid transparent; border-top: 14px solid var(--ink); }
.lead .balloon { margin: auto 6px 0 0; }

.stamps { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.stamp { border: 3px solid var(--spot); color: var(--spot); padding: 2px 8px; font: 700 13px var(--sans); transform: rotate(-6deg); background: var(--paper); text-decoration: none; }
a.stamp { pointer-events: auto; }
a.stamp:hover { background: var(--spot); color: var(--paper); }
.stamp.soon { border-style: dashed; }

/* credit panel: company */
.credit { padding: 14px 18px; font-size: 13px; color: var(--ink-2); }
.credit p { margin: 0; }
.credit .about { max-width: 70ch; margin-bottom: 6px; }
.credit b { color: var(--ink); }

/* section pages (/game, /webtoon, /software) and the work "coming soon" page: title panel + one panel per work */
.title-main { position: relative; display: flex; flex-direction: column; gap: 10px; }
.back { font: 400 22px/1 var(--display); text-decoration: none; letter-spacing: .02em; }
.back::before { content: "← "; font-family: var(--sans); }
.back:hover { color: var(--spot); }
.section-page .title h1 small { display: block; font: 700 14px var(--sans); letter-spacing: .2em; color: var(--spot); margin-bottom: 8px; }
.works { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.work { display: flex; flex-direction: column; min-height: 320px; transition: transform .15s; }
.work:hover { transform: rotate(-.5deg) scale(1.01); }
.work.soon { border-style: dashed; }
.work .hit { position: absolute; inset: 0; z-index: 1; }
.work .no { position: absolute; top: 10px; left: 12px; z-index: 2; font: 700 12px var(--sans); letter-spacing: .12em; color: var(--ink-2); background: var(--paper); padding: 0 4px; }
.work .thumb { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; image-rendering: pixelated; border-bottom: 4px solid var(--ink); display: block; }
.work > .tone, .work > .speed { position: relative; inset: auto; height: 150px; border-bottom: 4px solid var(--ink); }
.work .body { position: relative; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work .word { font-size: clamp(30px, 4vw, 40px); }
.work p { margin: 0; color: var(--ink-2); font-size: 14px; }
.work .stamp { align-self: flex-end; margin-top: auto; }

/* item intro, screens and devlog on a section page */
.more { display: grid; gap: 14px; }
.more:empty { display: none; }
.strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--ink); color: var(--paper); }
.strip h2 { margin: 0; font: 400 clamp(24px, 3.4vw, 34px)/1.1 var(--display); }
.strip .stamp { transform: rotate(-3deg); }
.stories { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story { padding: 20px 22px; }
.story:last-child:nth-child(odd) { grid-column: 1 / -1; }
.story h3 { margin: 0 0 8px; font: 400 22px/1.25 var(--display); }
.story p { margin: 0; color: var(--ink-2); font-size: 15px; }
.story ul { margin: 12px 0 0; padding-left: 1.1em; font-size: 14px; color: var(--ink-2); }
.story li { margin: 4px 0; }
.story li::marker { color: var(--spot); }
.shots { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shot { margin: 0; }
.shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-bottom: 4px solid var(--ink); }
.shot figcaption { padding: 10px 14px 12px; font-size: 13px; color: var(--ink-2); }
.devlog { padding: 20px 22px; }
.devlog h2 { margin: 0; font: 400 clamp(24px, 3.4vw, 34px)/1.1 var(--display); }
.devlog .sub { margin: 6px 0 14px; font-size: 13px; color: var(--ink-2); }
.week { border-top: 3px solid var(--ink); padding-top: 12px; margin-top: 12px; }
.week h3 { margin: 0 0 6px; font: 700 16px var(--sans); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.week h3 small { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.week p { margin: 0 0 8px; font-size: 15px; }
.week summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--spot); }
.commits { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; columns: 2; column-gap: 28px; }
.commits li { break-inside: avoid; margin: 0 0 6px; color: var(--ink-2); word-break: normal; }
.commits .area { display: inline-block; min-width: 3.2em; font-weight: 700; font-size: 11px; color: var(--ink); border: 1px solid var(--ink); padding: 0 4px; margin-right: 2px; text-align: center; }

@media (max-width: 760px) {
    .page { margin: 0; padding: 12px; gap: 10px; }
    .title { flex-direction: column; align-items: flex-start; min-height: 0; }
    .title-side { align-items: flex-start; }
    .panels { grid-template-columns: 1fr; gap: 10px; }
    .panels .lead { grid-row: auto; min-height: 340px; }
    .art { width: 92%; right: -10%; }
    .stories, .shots { grid-template-columns: 1fr; }
    .commits { columns: 1; }
    .strip { flex-wrap: wrap; }
    .balloon { max-width: 84%; }
}
@media (prefers-reduced-motion: reduce) { .sec, .balloon { transition: none; } }
