@font-face {
  font-family: Pretendard;
  src: url("/assets/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #182e29;
  --muted: #4c625a;
  --accent: #176552;
  --page: #f7f8f2;
  --line: #dce4d9;
  --map: #102b27;
  --mint: #b3e3c8;
  font-family: Pretendard, system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #277d66; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.55; }
.wrap { width: min(94%, 1320px); margin-inline: auto; }
.skip { position: fixed; top: .75rem; left: .75rem; padding: .7rem; background: white; z-index: 20; transform: translateY(-180%); }
.skip:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, .masthead-links, .brand { display: flex; align-items: center; gap: .85rem; }
.masthead-inner { min-height: 64px; justify-content: space-between; }
.masthead a { color: var(--ink); text-decoration: none; }
.masthead a:hover { color: var(--accent); }
.brand { font-weight: 750; letter-spacing: -.025em; }
.masthead-links { font-size: .92rem; }
.language { border: 1px solid #9db6a8; border-radius: 50px; padding: .4rem .8rem; font-weight: 650; }

.intro { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .65fr); align-items: end; gap: 2rem; padding-block: clamp(32px, 5vw, 66px) 28px; }
.intro h1 { margin-top: .35rem; font-family: Georgia, Pretendard, serif; font-size: clamp(2.6rem, 6vw, 5.1rem); font-weight: 500; line-height: 1.03; letter-spacing: -.062em; }
:lang(ko) .intro h1 { font-family: Pretendard, sans-serif; font-weight: 750; letter-spacing: -.065em; }
.intro > p { max-width: 33rem; color: var(--muted); font-size: 1.08rem; padding-bottom: .22rem; }
.eyebrow { color: var(--accent); font-size: .88rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
:lang(ko) .eyebrow { letter-spacing: .035em; }
.load-status { margin-block: 2rem; }

.study-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; padding: .8rem 0 1rem; border-top: 1px solid var(--line); }
.study-nav h2 { font-size: 1.05rem; }
.silk-controls, .silk-cities { display: flex; flex-wrap: wrap; gap: .4rem; }
.silk-controls button, .study-context button, .study-choices button, .study-use-pin { min-height: 40px; border: 1px solid #a8bdaf; border-radius: 7px; background: white; color: var(--ink); padding: .35rem .6rem; font-size: .92rem; }
.silk-controls button:hover, .study-choices button:hover, .study-context button:hover, .study-use-pin:hover { background: #edf5ec; }
.silk-controls button[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
#study-jump { margin-left: auto; font-weight: 700; }
#gois-jump { font-weight: 700; }

.workspace { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); gap: clamp(12px, 2vw, 24px); align-items: start; }
.map-panel, .detail-panel { border-radius: 18px; overflow: hidden; }
.map-panel { background: var(--map); color: white; }
.map-panel :focus-visible { outline-color: var(--mint); }
.toolbar, .time-head, .map-caption, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.toolbar { padding: .75rem clamp(.75rem, 2vw, 1.35rem); }
.toolbar h2, .time-head h2 { font-size: 1.02rem; font-weight: 700; }
.map-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .35rem; }
.map-actions button, .presets button { min-height: 36px; padding: .28rem .65rem; background: #193d35; color: #edf9f2; border: 1px solid #507466; border-radius: 7px; font-size: .9rem; }
.map-actions button:enabled:hover, .presets button:hover { background: #285547; }
.map-actions button { min-width: 36px; }
.map { position: relative; aspect-ratio: 12 / 5; overflow: hidden; background: #16352f; isolation: isolate; touch-action: pan-y; }
.map.is-zoomed { cursor: grab; touch-action: none; }
.map.is-dragging { cursor: grabbing; }
.map:focus-visible { outline-offset: -4px; }
.map-layer, .map-layer img, .markers, .gois-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-layer { transform-origin: 0 0; }
.map-layer img { pointer-events: none; }
.gois-line { pointer-events: none; overflow: visible; }
.gois-line polyline { stroke: #fbd593; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 6; }
.marker { position: absolute; z-index: 1; width: 34px; height: 34px; transform: translate(-50%, -50%) scale(var(--marker-scale, 1)) translateY(var(--marker-offset, 0px)); border: 0; background: transparent; padding: 0; border-radius: 50%; color: white; touch-action: manipulation; }
.marker:hover, .marker:focus-visible, .marker[aria-pressed="true"] { z-index: 3; }
.marker[data-gois-stop] { z-index: 2; }
.marker[data-gois-stop]:hover, .marker[data-gois-stop]:focus-visible, .marker[data-gois-stop][aria-pressed="true"] { z-index: 4; }
.marker::before { content: ""; display: block; width: 10px; height: 10px; margin: auto; border-radius: 50%; background: #c9f5e0; border: 1px solid #133d33; box-shadow: 0 0 0 3px #1132299c; }
.marker[data-kind="landform"]::before { background: #f3d3a2; border-radius: 2px; transform: rotate(45deg); }
.marker[data-gois-stop]::before { background: #ffd18a; }
.marker[data-kind="pass"]::before { border-radius: 2px; }
.marker[aria-pressed="true"]::before { width: 13px; height: 13px; background: #f8d9a9; box-shadow: 0 0 0 4px #f8d9a945, 0 0 0 8px #172f29ad; }
.marker[data-unattested]::before { background: #102b27; border: 2px solid #f2d7a6; }
.marker[data-kind="region"]::before { width: 23px; height: 16px; border: 2px dashed #bfead2; border-radius: 50%; background: #376451; box-shadow: 0 0 0 2px #17372c; }
.marker[data-kind="region"][aria-pressed="true"]::before { background: #487c68; border-color: #fff4cc; }
.marker[data-spread]::after { content: ""; position: absolute; left: calc(50% - 1px); width: 2px; background: #fbd593; pointer-events: none; z-index: -1; }
.marker[data-spread="above"]::after { top: 50%; height: calc(-1 * var(--marker-offset)); }
.marker[data-spread="below"]::after { bottom: 50%; height: var(--marker-offset); }
.marker[data-kind="region"]::after { display: none; }
.marker span { display: none; pointer-events: none; position: absolute; inset: auto auto 100% 50%; transform: translateX(-50%); width: max-content; max-width: 11rem; background: #122923; color: #fff2d9; border-radius: 5px; padding: .25rem .4rem; font-size: .85rem; line-height: 1.2; box-shadow: 0 2px 8px #0005; }
.marker:hover span, .marker:focus-visible span, .marker[aria-pressed="true"] span { display: block; }
.map-caption { min-height: 38px; flex-wrap: wrap; color: #cae3d5; padding: .5rem clamp(.75rem, 2vw, 1.35rem); font-size: .82rem; }
.gap-legend { color: #ffe0ad; }
.gois-route { display: grid; gap: .55rem; margin: 0 clamp(.75rem, 2vw, 1.35rem) .8rem; padding: .75rem; background: #193d35; border: 1px solid #598170; border-radius: 10px; }
.gois-heading, .gois-stops, .gois-step-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.gois-heading { justify-content: space-between; }
.gois-heading h3 { font-size: 1.06rem; }
.gois-route h4 { margin: .55rem 0 .35rem; font-size: .9rem; }
.gois-key { display: flex; flex-wrap: wrap; gap: .3rem .8rem; color: #e6f5ea; font-size: .84rem; }
.gois-key span { display: inline-flex; align-items: center; gap: .3rem; }
.gois-key span::before { content: ""; width: .7rem; height: .7rem; border: 1px solid #fbd593; border-radius: 50%; background: #fbd593; }
.gois-key [data-symbol="region"]::before { width: .9rem; border: 2px dashed #bfead2; background: transparent; }
.gois-key [data-symbol="unlocated"]::before { background: transparent; border: 1px dotted #d5e4db; border-radius: 2px; }
.gois-heading span, .gois-route p, #gois-position { color: #d3e8db; font-size: .87rem; }
.gois-stops button, .gois-step-controls button { min-height: 38px; padding: .25rem .6rem; background: #12332c; color: #edf9f2; border: 1px solid #658779; border-radius: 7px; font-size: .9rem; }
.gois-stops button:hover, .gois-step-controls button:enabled:hover { background: #285547; }
.gois-stops button[aria-pressed="true"] { background: #f5d59d; border-color: #f5d59d; color: #30251b; font-weight: 700; }
.gois-stops button[data-evidence="region"]:not([aria-pressed="true"]) { border-style: dashed; border-color: #bfead2; }
.gois-stops button[data-evidence="unlocated"]:not([aria-pressed="true"]) { border-style: dotted; border-color: #d5e4db; }
#gois-position { margin-inline-start: .15rem; }
.silk-cities { padding: .15rem clamp(.75rem, 2vw, 1.35rem) .75rem; }
.silk-cities button { min-height: 36px; padding: .28rem .6rem; font-size: .88rem; color: #e6f5eb; background: #193d35; border: 1px solid #507466; border-radius: 7px; }
.silk-cities button[aria-pressed="true"] { background: #bfead1; border-color: #bfead1; color: #15372d; font-weight: 700; }
.time-panel { border-top: 1px solid #416559; padding: .8rem clamp(.75rem, 2vw, 1.35rem) 1.05rem; }
#year-display { color: #ffe0a9; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.time-range { display: grid; grid-template-columns: auto minmax(30px, 1fr) auto; gap: .75rem; align-items: center; margin-block: .25rem .55rem; color: #cae3d5; font-size: .85rem; }
.time-range input { width: 100%; height: 28px; margin: 0; accent-color: #ade6c5; }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.presets button[aria-pressed="true"] { background: #bfead1; color: #15372d; border-color: #bfead1; font-weight: 700; }

.detail-panel { background: #fff; border: 1px solid var(--line); }
.panel-heading { padding: 1rem 1.15rem; background: #ecf3e9; font-size: .86rem; font-weight: 650; color: #3a574d; }
.coordinates { font-variant-numeric: tabular-nums; text-align: right; }
.detail-content { padding: 1.15rem; overflow-wrap: anywhere; }
.detail-content h2 { font-size: clamp(1.7rem, 3.25vw, 2.7rem); line-height: 1.04; letter-spacing: -.06em; }
.place-meta { color: var(--muted); margin: .45rem 0 .95rem; font-size: .9rem; }
.place-meta a { display: inline-block; margin-top: .25rem; }
.current { border-left: 3px solid #6aa589; background: #f2f7ee; border-radius: 0 8px 8px 0; padding: .75rem .8rem; }
.current .current-name { font-weight: 760; font-size: 1.25rem; }
.current p:not(.current-name) { color: #4a6157; font-size: .88rem; }
.timeline { list-style: none; margin: .35rem 0 0; padding: 0; }
.timeline-title { margin-top: 1.2rem; font-size: 1.03rem; }
.timeline li { border-bottom: 1px solid var(--line); padding: .55rem 0; }
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline summary { padding: .1rem .15rem; cursor: pointer; line-height: 1.4; }
.timeline details[data-active] summary { color: var(--accent); }
.timeline .event-date { display: block; padding-left: 1rem; color: var(--muted); font-size: .82rem; }
.event-body { padding: .5rem 0 .35rem 1rem; color: var(--muted); font-size: .94rem; }
.event-body p + p { margin-top: .35rem; }
.event-original bdi { font-weight: 700; }
.event-body a { display: block; width: fit-content; margin-top: .35rem; font-size: .87rem; }
.event-jump { background: #e9f3eb; border: 1px solid #b2cdbc; color: #174e3f; margin-top: .5rem; border-radius: 6px; padding: .3rem .55rem; min-height: 36px; font-size: .86rem; }

.study { padding: 1.2rem; margin-top: 1.4rem; display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 2fr); gap: clamp(12px, 2vw, 24px); background: #ecf3e9; border: 1px solid var(--line); border-radius: 14px; }
.study h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.15; letter-spacing: -.04em; }
.study-context p { margin-top: .55rem; color: var(--muted); }
.study-context ul { list-style: none; padding: 0; margin: .65rem 0; display: grid; gap: .35rem; font-size: .9rem; }
.study-questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.study-question { min-width: 0; margin: 0; padding: .7rem; border: 1px solid #c9dbc9; border-radius: 10px; background: #fff; }
.study-question legend { padding: .16rem .45rem; background: #ecf3e9; border-radius: 6px; font-weight: 730; line-height: 1.4; }
.study-choices { display: grid; gap: .35rem; }
.study-choices button { text-align: start; }
.study-choices button[aria-pressed="true"] { border-color: #367d63; background: #dfede0; font-weight: 700; }
.study-use-pin { margin-top: .65rem; color: var(--accent); }
.study-feedback:not(:empty) { padding: .55rem .65rem; margin-top: .6rem; border-radius: 6px; background: #f7efe0; }
.study-feedback[data-result="correct"] { background: #e7f3e8; }
.study-feedback p, .study-feedback a { margin-top: .3rem; font-size: .92rem; }
.study-feedback a { display: inline-block; }

.catalog { padding-block: clamp(34px, 5vw, 64px); }
.catalog-head, .filters { display: flex; align-items: end; gap: .8rem; }
.catalog-head { justify-content: space-between; flex-wrap: wrap; }
.catalog h2, .method h2 { margin-top: .32rem; font-size: clamp(1.7rem, 4vw, 2.65rem); letter-spacing: -.055em; }
.filters label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 650; }
.filters input, .filters select { border-radius: 7px; border: 1px solid #a8bdaf; background: white; color: var(--ink); min-height: 42px; padding: .45rem .65rem; min-width: 0; max-width: 100%; }
.filters select { appearance: none; padding-right: 1.9rem; background-image: linear-gradient(45deg, transparent 50%, #396255 50%), linear-gradient(135deg, #396255 50%, transparent 50%); background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
#search-count { color: var(--muted); margin-block: 1rem .65rem; font-size: .9rem; }
.catalog-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .65rem; }
.catalog-list button { height: 100%; width: 100%; padding: .72rem .85rem; text-align: left; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: .23rem; align-content: start; }
.catalog-list button:hover, .catalog-list button[aria-pressed="true"] { border-color: #508a72; background: #edf5ec; }
.catalog-list strong { overflow-wrap: anywhere; font-size: 1.05rem; }
.catalog-list span { color: var(--muted); font-size: .88rem; }

.method { display: grid; gap: 1.6rem; grid-template-columns: 1.45fr 1fr; border-top: 1px solid var(--line); padding-block: 2.4rem; }
.method p:not(.eyebrow) { margin-top: .55rem; color: var(--muted); max-width: 65ch; }
.downloads { background: #eef3e9; padding: 1.1rem; border-radius: 12px; }
.downloads > a { display: inline-block; margin: .8rem .8rem .1rem 0; font-weight: 700; }
.credit { font-size: .9rem; }
.page-footer { border-top: 1px solid var(--line); font-size: .88rem; }
.page-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding-block: 1.4rem; }

@media (max-width: 850px) {
  .workspace, .intro, .study { grid-template-columns: 1fr; }
  .intro { gap: .75rem; }
  .intro > p { max-width: 41rem; }
}

@media (max-width: 510px) {
  .wrap { width: calc(100% - 24px); }
  .masthead-inner { gap: .5rem; }
  .brand { gap: .35rem; font-size: .92rem; }
  .masthead-links { gap: .55rem; font-size: .85rem; }
  .masthead-links > a[href="#method"] { display: none; }
  .study-nav { align-items: flex-start; flex-direction: column; }
  #study-jump { margin-left: 0; }
  .silk-cities button, .study-choices button, .study-use-pin, .gois-stops button, .gois-step-controls button { min-height: 44px; }
  .study-questions { grid-template-columns: 1fr; }
  .map-panel, .detail-panel { border-radius: 12px; }
  .map-actions button, .presets button { min-height: 40px; }
  .map-caption { gap: .05rem .7rem; }
  .marker { width: 30px; height: 30px; }
  .marker span { max-width: 7rem; font-size: .76rem; }
  .filters { width: 100%; align-items: stretch; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .method { grid-template-columns: 1fr; }
}
