:root {
  color-scheme: light;
  --ink: #131e34;
  --ink-dark: #111a2b;
  --paper: #f8f7f3;
  --white: #fff;
  --gold: #f9cb58;
  --muted: #535e70;
  --line: #dededb;
  --font: Inter, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 var(--font); }
body, button, input { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #366acb; outline-offset: 4px; }
.hero :focus-visible { outline-color: #fbe0a0; }
h1, h2, p { margin: 0; }
.page-width { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 5; top: 8px; left: 8px; padding: 12px; background: var(--white); }

.header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; line-height: 1.12; }
.brand strong { display: block; font-size: .94rem; font-weight: 850; letter-spacing: -.02em; white-space: nowrap; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font: 600 .67rem/1 var(--mono); letter-spacing: .15em; }
.brand-mark { position: relative; display: grid; width: 37px; height: 37px; border-radius: 11px; background: var(--ink); place-items: center; }
.brand-mark span { position: relative; width: 13px; height: 13px; margin-top: -1px; border-radius: 7px 7px 3px 3px; background: var(--gold); }
.brand-mark span::before { content: ""; position: absolute; inset: -3px 5px auto; height: 4px; border-radius: 4px; background: var(--gold); }
.brand-mark span::after { content: ""; position: absolute; inset: auto 4px -4px; height: 3px; border-radius: 0 0 5px 5px; background: var(--gold); }
.button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 17px; border: 1px solid transparent; border-radius: 10px;
  font-weight: 750; font-size: .94rem; text-align: center; white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s;
}
.button span { font-size: 1.2em; line-height: 1; }
.button-outline { background: var(--white); color: var(--ink); border-color: var(--line); }
.button-share { min-height: 42px; padding-inline: 13px; font-size: .84rem; }
.button-dark { background: var(--ink); color: var(--white); }
.button-gold { background: var(--gold); color: var(--ink-dark); }
.button-glass { color: #f7f8fc; border-color: #ffffff45; background: #ffffff08; }
.button:disabled { cursor: default; background: #e7e9ed; color: #596375; }

.hero { overflow: hidden; color: #f7f8fc; background: var(--ink); border-radius: 25px; box-shadow: 0 16px 40px #1b284415; }
.hero-content {
  position: relative; display: grid; grid-template-columns: 1.05fr 1fr; grid-template-areas: "copy art" "actions art";
  grid-template-rows: 1fr auto; isolation: isolate; min-height: 480px; padding: 58px 57px 52px;
}
.hero-copy { grid-area: copy; align-self: end; z-index: 1; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
  color: #ffe1a1; font: 650 .77rem/1.3 var(--mono); letter-spacing: .15em;
}
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.hero h1 { font-size: clamp(4rem, 7vw, 6.1rem); font-weight: 900; letter-spacing: -.087em; line-height: 1.04; word-break: keep-all; }
.hero h1 em { display: block; color: var(--gold); font-style: normal; }
.hero-description { margin-top: 20px; color: #d7deee; font-size: clamp(.94rem, 1.6vw, 1.12rem); line-height: 1.65; word-break: keep-all; }
.hero-actions { grid-area: actions; z-index: 1; display: flex; gap: 9px; margin-top: 27px; }
.hero-actions .button { min-height: 52px; padding-inline: 21px; }
.hero-art { position: absolute; inset: 0 0 0 41%; z-index: -1; overflow: hidden; }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink), transparent 18%, transparent 86%, var(--ink)); }
.event-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px;
  min-height: 62px; padding: 13px 57px; border-top: 1px solid #ffffff26; background: #ffffff06;
  font-size: .91rem; font-weight: 650;
}
.event-label { color: #ffda84; font-size: .77rem; }
.event-location { border-left: 1px solid #ffffff42; padding-left: 16px; color: #d7deee; }

.types { padding: 38px 0 43px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 15px; }
.section-heading h2 { font-size: 1.45rem; font-weight: 850; letter-spacing: -.05em; }
.section-heading p { color: var(--muted); font-size: .88rem; }
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.type-card { display: flex; align-items: center; gap: 13px; min-height: 90px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); transition: border-color .18s, background-color .18s; }
.type-card strong, .type-card small { display: block; }
.type-card strong { font-size: 1rem; font-weight: 800; letter-spacing: -.035em; }
.type-card small { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.type-icon { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; border-radius: 10px; font-weight: 800; }
.type-icon-ox { color: #664512; background: #faeccd; font: 800 1rem/1 var(--mono); }
.type-icon-choice { color: #293e75; background: #e9eefc; font-size: 1.3rem; }
.type-icon-written { color: #565174; background: #efe9f9; }
.card-arrow { margin-left: auto; color: var(--muted); }
.pdf-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 13px; margin-top: 13px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f1efe8; }
.pdf-download strong { font-size: .92rem; letter-spacing: -.025em; }
.pdf-download .button { min-height: 44px; padding-inline: 12px; font-size: .84rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-block: 18px 27px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.footer span:first-child { font: 650 .72rem/1.5 var(--mono); letter-spacing: .08em; }

.inner-view { width: min(760px, 100%); min-height: 58vh; margin: 0 auto; padding: 15px 0 44px; }
.inner-view h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 850; letter-spacing: -.055em; line-height: 1.24; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; color: var(--muted); font-size: .89rem; font-weight: 750; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; }
.progress-label { display: flex; justify-content: space-between; margin: 13px 0 6px; color: var(--muted); font-size: .84rem; font-weight: 750; }
#position { font-family: var(--mono); }
progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 10px; background: #e7e4da; accent-color: #bd8611; }
progress::-webkit-progress-bar { border-radius: 10px; background: #e7e4da; }
progress::-webkit-progress-value { border-radius: 10px; background: #bd8611; }
progress::-moz-progress-bar { border-radius: 10px; background: #bd8611; }
.question-card, .result-card { margin-top: 17px; padding: clamp(20px, 5vw, 42px); border: 1px solid var(--line); border-radius: 19px; background: var(--white); }
.question-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 13px; }
#question-number { color: #674813; font: 750 .88rem/1.3 var(--mono); letter-spacing: .025em; }
#question-type { padding: 4px 9px; border-radius: 7px; color: #485670; background: #edf0f5; font-size: .75rem; font-weight: 750; }
#question-title { font-size: clamp(1.27rem, 3.1vw, 1.85rem); line-height: 1.53; letter-spacing: -.035em; word-break: keep-all; overflow-wrap: anywhere; }
.choices { min-inline-size: 0; margin: 24px 0 0; padding: 0; border: 0; }
.choice-options { display: grid; gap: 8px; }
.choice-options.ox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 10px; min-height: 53px; position: relative;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-size: .96rem; cursor: pointer; overflow-wrap: anywhere;
}
.choice input { width: 17px; height: 17px; margin: 0; flex-shrink: 0; accent-color: #815700; }
.choice-marker { flex-shrink: 0; color: var(--muted); font: 750 .86rem/1 var(--mono); }
.choice:has(input:checked) { border-color: #aa7414; background: #fff5df; }
.choice.is-right { border-color: #337754; background: #edf8f0; }
.choice.is-wrong { border-color: #a34a4f; background: #fff0ef; }
.choice:has(input:disabled) { cursor: default; }
.choice-options.ox .choice { justify-content: center; min-height: 68px; font: 750 1.6rem/1 var(--mono); }
.choice-options.ox input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.choice-options.ox .choice:has(input:checked) { border-width: 2px; }
.choice-options.ox .choice:has(input:focus-visible) { outline: 3px solid #366acb; outline-offset: 4px; }
#written { margin-top: 22px; }
#written label { display: block; margin-bottom: 6px; font-size: .89rem; font-weight: 750; }
#written label span { color: var(--muted); font-weight: 400; }
.search, #written-input, #share-url { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #bdc3cd; border-radius: 9px; background: var(--white); color: var(--ink); }
.check-answer { width: 100%; margin-top: 18px; }
.feedback { margin-top: 17px; padding: 15px 17px; border-radius: 10px; background: #f3f1e9; overflow-wrap: anywhere; }
.feedback[data-tone="correct"] { background: #edf8f0; color: #205537; }
.feedback[data-tone="incorrect"] { background: #fff0ef; color: #7e3038; }
.feedback p { margin-top: 4px; color: var(--ink); }
.self-grade { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.self-grade .button { min-height: 44px; white-space: normal; }
.text-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.quiz-pagination { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; }
.quiz-pagination a:only-child, #previous[hidden] + #next { margin-left: auto; }

.search { margin-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 13px 10px; }
.filters button { min-height: 44px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: .86rem; font-weight: 700; }
.filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.match-count { margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.question-list { list-style: none; margin: 0; padding: 0; border-radius: 12px; }
.question-list li { border: 1px solid var(--line); background: var(--white); }
.question-list li + li { border-top: 0; }
.question-list li:first-child { border-radius: 12px 12px 0 0; }
.question-list li:last-child { border-radius: 0 0 12px 12px; }
.question-list li:only-child { border-radius: 12px; }
.question-list a { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 62px; padding: 10px 13px; border-radius: inherit; }
.list-id { color: #674813; font: 750 .8rem/1 var(--mono); }
.list-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .93rem; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.list-type { color: var(--muted); font-size: .73rem; font-weight: 700; }
.question-list .empty { padding: 18px; color: var(--muted); }
.result-mode { margin-bottom: 6px; color: var(--muted); font-size: .9rem; font-weight: 750; }
.result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.result-stats div { padding: 10px 5px; border-radius: 10px; background: #f5f3eb; text-align: center; }
.result-stats dt { color: var(--muted); font-size: .83rem; }
.result-stats dd { margin: 3px 0 0; font: 750 clamp(1.4rem, 5vw, 2rem)/1.2 var(--mono); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; z-index: 2; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; padding: 13px 17px; border-radius: 11px; background: var(--ink); color: var(--white); font-size: .9rem; }
dialog { width: min(440px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); }
dialog::backdrop { background: #111a2b95; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dialog-heading h2 { font-size: 1.2rem; }
.dialog-heading button { min-width: 44px; text-decoration: none; font-size: 1.3rem; }
dialog .button { width: 100%; margin-top: 8px; }
#copy-status:not(:empty) { margin-top: 8px; font-size: .85rem; }

@media (hover: hover) {
  .button-outline:not(:disabled):hover, .type-card:hover { border-color: #8894a7; background: #fbfcff; }
  .button-gold:hover { background: #ffdc88; }
  .button-glass:hover { background: #ffffff20; }
  .button-dark:not(:disabled):hover { background: #273958; }
  .choice:has(input:not(:disabled)):hover { border-color: #a47b2a; }
  .question-list a:hover { background: #f8f7f3; }
}

@media (max-width: 820px) {
  .page-width { width: calc(100% - 44px); }
  .hero-content { min-height: 418px; padding: 40px 37px; }
  .event-strip { padding-inline: 37px; }
  .hero h1 { font-size: clamp(3.25rem, 8vw, 4.5rem); }
}

@media (max-width: 570px) {
  .page-width { width: calc(100% - 28px); }
  .header { min-height: 70px; }
  .brand-mark { width: 35px; height: 35px; }
  .hero { border-radius: 17px; }
  .hero-content {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
    grid-template-areas: "copy" "art" "actions"; min-height: 0; padding: 27px 20px 20px;
  }
  .hero h1 { font-size: clamp(2.85rem, 11.3vw, 4rem); }
  .eyebrow { margin-bottom: 11px; font-size: .64rem; }
  .hero-description { margin-top: 10px; line-height: 1.58; }
  .hero-art { position: relative; inset: auto; grid-area: art; height: clamp(164px, 47vw, 245px); margin: -3px -20px 4px; }
  .hero-art::after { background: linear-gradient(0deg, var(--ink), transparent 14%, transparent 88%, var(--ink)); }
  .hero-actions { margin-top: 0; }
  .hero-actions .button { flex: 1; min-height: 49px; padding-inline: 8px; }
  .event-strip { min-height: 54px; gap: 4px 9px; padding: 10px 20px; font-size: .77rem; }
  .event-label { font-size: .68rem; }
  .event-location { padding-left: 9px; }
  .types { padding: 24px 0 28px; }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { font-size: 1.21rem; }
  .section-heading p { font-size: .8rem; }
  .type-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .type-card { min-height: 64px; padding: 9px 12px; }
  .type-card small { margin-top: 1px; }
  .type-icon { width: 39px; height: 39px; flex-basis: 39px; }
  .inner-view { padding-top: 3px; }
  .question-list a { grid-template-columns: 2.6rem minmax(0, 1fr) auto; padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
