:root {
  --paper: #fbf1dc;
  --paper-deep: #efe0bb;
  --ink: #24201c;
  --muted: #756b60;
  --red: #d97767;
  --blue: #6a9bc8;
  --green: #83b99b;
  --yellow: #efd17a;
  --pink: #ebb7c8;
  --white: #fffaf0;
  --border: #24201c;
  --max: 1180px;
  --font-latin: Arial, Helvetica, sans-serif;
  --font-cjk: "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Apple SD Gothic Neo", "Malgun Gothic", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-latin);
  line-height: 1.5;
  background:
    radial-gradient(circle at 20% 20%, rgba(36, 32, 28, .035) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 82% 9%, rgba(106, 155, 200, .1) 0 1px, transparent 1px 9px),
    linear-gradient(135deg, rgba(217, 119, 103, .07), rgba(131, 185, 155, .075), rgba(106, 155, 200, .055)),
    var(--paper);
}

:root:lang(ko) body,
:root:lang(ja) body,
:root:lang(zh-CN) body {
  font-family: var(--font-cjk);
  word-break: keep-all;
}

.is-language-transitioning main,
.is-language-transitioning .site-header,
.is-language-transitioning .footer {
  filter: blur(1px);
  opacity: .72;
  transition: opacity .18s ease, filter .18s ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  opacity: .35;
  mix-blend-mode: multiply;
  background:
    repeating-linear-gradient(0deg, rgba(36, 32, 28, .018) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 30% 30%, rgba(36, 32, 28, .035) 0 1px, transparent 1px 7px);
}

button,
input {
  font: inherit;
}

button,
a,
input,
[role="button"] {
  outline-offset: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 4px solid var(--blue);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  border: 3px solid var(--ink);
  padding: 8px 12px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

.skip-link:focus {
  top: 16px;
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header,
main,
.footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--ink);
  background: rgba(244, 234, 210, .94);
  backdrop-filter: blur(10px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--ink);
  background:
    radial-gradient(circle, var(--ink) 0 2px, transparent 2px 7px),
    var(--yellow);
  box-shadow: 4px 4px 0 var(--red);
  transform: rotate(-4deg);
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.language-pair-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-pair-arrow {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.language-pair-button {
  min-width: 84px;
}

.language-pair-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links a,
.button,
.filter-button,
.copy-button,
.language-button,
.language-menu__item {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.nav-links a {
  padding: 6px 10px;
}

.language-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
}

.language-button__icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  font-size: 12px;
  line-height: 1;
}

.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(250px, calc(100vw - 32px));
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}

.language-menu[hidden] {
  display: none;
}

.language-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  box-shadow: 3px 3px 0 var(--ink);
}

.language-menu__item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.language-menu__item.is-active {
  background: var(--green);
}

.button,
.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
}

.button-blue {
  background: var(--blue);
  color: var(--white);
}

.button-red {
  background: var(--red);
  color: var(--white);
}

.copy-button {
  min-width: 64px;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

.button:hover,
.filter-button:hover,
.copy-button:hover,
.nav-links a:hover,
.language-button:hover,
.language-menu__item:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.hero {
  padding: 58px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  align-items: stretch;
}

.cover {
  position: relative;
  min-height: 470px;
  border: 4px solid var(--ink);
  padding: clamp(24px, 5vw, 54px);
  background:
    radial-gradient(circle at 86% 18%, rgba(63, 143, 114, .7) 0 70px, transparent 71px),
    radial-gradient(circle at 82% 20%, rgba(23, 18, 15, .08) 0 2px, transparent 2px 8px),
    linear-gradient(155deg, var(--yellow) 0 18%, var(--paper) 18% 62%, rgba(239, 158, 178, .45) 62% 100%);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  transform: rotate(-.5deg);
}

.cover::after {
  position: absolute;
  left: -42px;
  bottom: 28px;
  display: block;
  width: 120%;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 10px 0;
  content: attr(data-ribbon);
  background: var(--red);
  color: var(--white);
  text-align: center;
  font-weight: 900;
  letter-spacing: .14em;
  transform: rotate(-5deg);
}

.eyebrow,
.issue-label,
.lesson-kicker {
  display: inline-block;
  width: fit-content;
  border: 3px solid var(--ink);
  padding: 7px 10px;
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

.eyebrow {
  max-width: min(100%, 430px);
  line-height: 1.45;
  white-space: normal;
  transform: rotate(1deg);
}

.issue-label {
  background: var(--pink);
  color: var(--ink);
  font-size: 13px;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 24px 0 16px;
  font-size: clamp(54px, 11vw, 132px);
  line-height: .82;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 4px 2px 0 rgba(228, 91, 67, .72), -4px -2px 0 rgba(36, 103, 166, .55);
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.25;
}

.issue-card {
  display: grid;
  gap: 18px;
  border: 4px solid var(--ink);
  padding: 22px;
  background: var(--white);
  box-shadow: 8px 8px 0 var(--blue);
  transform: rotate(1deg);
}

.issue-card h2 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
}

.deck {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat {
  border: 3px solid var(--ink);
  padding: 16px;
  background: var(--paper);
}

.stat strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.stat span {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

.flow-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  min-height: 52px;
  border: 3px solid var(--ink);
  background: var(--paper);
  font-weight: 900;
}

.flow-list span {
  display: grid;
  align-items: center;
  align-self: stretch;
  border-right: 3px solid var(--ink);
  background: var(--yellow);
  text-align: center;
}

.section {
  padding: 46px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 6vw, 70px);
  line-height: .92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-head p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.band-yellow {
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background:
    radial-gradient(circle, rgba(22, 18, 15, .12) 0 1px, transparent 1px 8px),
    rgba(231, 184, 75, .48);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.step-card,
.lesson-paper,
.tool-strip,
.template-paper,
.note-block,
.topic-card,
.zine-note {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: rgba(255, 248, 232, .9);
}

.step-card {
  min-height: 210px;
  padding: 18px;
  box-shadow: 7px 7px 0 var(--ink);
}

.step-card:nth-child(2) {
  background: rgba(239, 158, 178, .68);
}

.step-card:nth-child(3) {
  background: rgba(63, 143, 114, .34);
}

.step-card:nth-child(4) {
  background: rgba(36, 103, 166, .18);
}

.step-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-weight: 900;
}

.step-card h3 {
  margin: 18px 0 8px;
  font-size: 28px;
  text-transform: uppercase;
}

.step-card p {
  margin: 0;
  font-weight: 700;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
  gap: 18px;
  align-items: start;
}

.lesson-paper {
  padding: clamp(18px, 3vw, 30px);
  box-shadow: 9px 9px 0 var(--red);
}

.lesson-paper h3 {
  margin: 18px 0 6px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: .95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lesson-section {
  margin-top: 22px;
}

.lesson-section h4 {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 8px;
}

.lesson-section p,
.lesson-section li,
td,
th {
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border: 2px solid var(--ink);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--yellow);
  text-transform: uppercase;
  font-size: 12px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: help;
}

tr:nth-child(even) .type-badge {
  background: var(--red);
}

.question-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.lesson-section ol,
.follow-list {
  margin: 0;
  padding-left: 22px;
}

.lesson-section li + li {
  margin-top: 8px;
}

.wrap-task {
  border: 3px solid var(--ink);
  padding: 14px;
  background: rgba(231, 184, 75, .32);
}

.tool-strip {
  position: sticky;
  top: 92px;
  display: grid;
  grid-auto-flow: row;
  gap: 12px;
  min-width: 300px;
  padding: 14px;
  background: var(--paper-deep);
  box-shadow: 7px 7px 0 var(--blue);
}

.tool-strip .button {
  width: 100%;
}

.tool-strip > * {
  width: 100%;
}

.translation-status {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0 0 18px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 11px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 6px 6px 0 var(--ink);
}

.translation-status::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}

.translation-status[data-status="loading"] {
  background: var(--yellow);
}

.translation-status[data-status="success"] {
  background: var(--green);
}

.translation-status[data-status="warning"] {
  background: var(--red);
  color: var(--white);
}

.translation-status[data-status="warning"]::before {
  background: var(--white);
}

.translation-status:empty,
.translation-status[hidden] {
  display: none;
}

.difficulty-jump {
  display: grid;
  gap: 10px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 14px;
  background: var(--white);
}

.difficulty-jump strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.level-button {
  background: rgba(255, 250, 240, .94);
}

.level-button.is-active {
  background: var(--green);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--blue);
}

.floatingchat-container,
.floatingchat-container-mobi {
  filter: drop-shadow(4px 5px 0 var(--ink));
}

.zine-note {
  padding: 14px;
  background: var(--white);
}

.zine-note strong,
.note-block strong {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.zine-note p,
.note-block p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.browser-section {
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: rgba(63, 143, 114, .22);
}

.browser-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.search-label {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

#search {
  width: 100%;
  min-height: 52px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 5px 5px 0 var(--ink);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-button {
  min-height: 40px;
  background: var(--white);
  font-size: 12px;
}

.filter-button.is-active {
  background: var(--red);
  color: var(--white);
  box-shadow: 5px 5px 0 var(--blue);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.pagination[hidden] {
  display: none;
}

.pagination-summary {
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

.pagination-button {
  min-width: 44px;
  min-height: 40px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 7px 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.pagination-button:hover:not(:disabled),
.pagination-button:focus-visible:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--blue);
}

.pagination-button.is-active {
  background: var(--green);
  box-shadow: 5px 5px 0 var(--blue);
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: 2px 2px 0 var(--ink);
}

.topic-card {
  display: grid;
  gap: 10px;
  min-height: 260px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 7px 7px 0 var(--ink);
  transition: transform .14s ease, box-shadow .14s ease;
}

.topic-card:nth-child(4n + 1) {
  background: rgba(255, 248, 232, .94);
}

.topic-card:nth-child(4n + 2) {
  background: rgba(239, 158, 178, .56);
}

.topic-card:nth-child(4n + 3) {
  background: rgba(231, 184, 75, .48);
}

.topic-card:nth-child(4n + 4) {
  background: rgba(36, 103, 166, .16);
}

.topic-card:hover,
.topic-card:focus-visible {
  transform: translate(-2px, -2px) rotate(-.4deg);
  box-shadow: 9px 9px 0 var(--blue);
}

.topic-card.is-selected {
  box-shadow: 9px 9px 0 var(--red);
}

.empty-state {
  grid-column: 1 / -1;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 18px;
  background: var(--white);
  font-weight: 900;
  box-shadow: 7px 7px 0 var(--ink);
}

.topic-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.topic-number,
.topic-level {
  border: 2px solid var(--ink);
  padding: 4px 7px;
  background: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.topic-level {
  background: var(--white);
}

.topic-card h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  text-transform: uppercase;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.topic-card .topic-question {
  color: var(--ink);
}

.topic-category {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.template-paper {
  max-height: 620px;
  overflow: auto;
  padding: 18px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 9px 9px 0 var(--yellow);
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

code {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}

.notes-section {
  background:
    radial-gradient(circle, rgba(22, 18, 15, .12) 0 1px, transparent 1px 8px),
    rgba(228, 91, 67, .18);
}

.notes-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 18px;
  align-items: start;
}

.notes-grid h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: .92;
  text-transform: uppercase;
}

.notes-grid > div > p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.note-block {
  min-height: 160px;
  padding: 16px;
  box-shadow: 7px 7px 0 var(--ink);
}

.footer {
  border-top: 4px solid var(--ink);
  padding: 24px 0;
  background: var(--blue);
  color: var(--white);
  font-weight: 900;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  border: 3px solid var(--ink);
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--ink);
}

@media (max-width: 980px) {
  .hero-grid,
  .lesson-layout,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .cover {
    min-height: 500px;
  }

  .tool-strip {
    position: static;
    min-width: 0;
  }

  .step-grid,
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .nav-bar,
  .section-head,
  .question-columns {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .nav-bar {
    justify-content: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .header-controls,
  .language-pair-switcher {
    width: 100%;
  }

  .header-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .language-button {
    width: 100%;
    justify-content: center;
  }

  .language-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .hero {
    padding-top: 34px;
  }

  .cover {
    min-height: 420px;
  }

  .cover::after {
    bottom: 16px;
    font-size: 12px;
  }

  .issue-card {
    transform: none;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .step-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 220px;
  }

  .flow-list li {
    grid-template-columns: 62px 1fr;
  }

  .issue-card,
  .lesson-paper,
  .template-paper,
  .tool-strip {
    box-shadow: 5px 5px 0 var(--ink);
  }
}
