:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --white: #fffdf7;
  --ink: #173e33;
  --muted: #56675d;
  --line: #e2e4d6;
  --green: #225244;
  --gold: #f1cd82;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #9b6316; outline-offset: 4px; }
h1, h2, p, figure { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }

.site-header { background: #fffdf8; border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 67px; }
.brand { display: inline-flex; gap: 10px; align-items: center; justify-self: start; font: 700 1.21rem/1 var(--serif); white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--gold); font: 1.05rem/1 var(--sans); }
nav { display: flex; gap: 29px; font-size: .92rem; font-weight: 620; }
nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero { position: relative; isolation: isolate; display: grid; align-items: center; min-height: 405px; overflow: hidden; margin-top: 27px; border-radius: 24px; color: #fff9e9; background: #12382f url('./winterwald.jpg') center 57% / cover no-repeat; }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ''; background: linear-gradient(90deg, #0d2a24 0%, #102f29ed 24%, #12332c70 55%, transparent 82%); }
.hero-content { padding: 42px clamp(32px, 6vw, 86px); }
.overline { color: #71521d; font-weight: 750; font-size: .81rem; letter-spacing: .12em; text-transform: uppercase; }
.hero-date { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.hero h1 { margin-top: 13px; font: 400 clamp(3rem, 5.6vw, 5.35rem)/.98 var(--serif); letter-spacing: -.062em; }
.hero-description { margin-top: 20px; color: #f3f0df; font-size: 1.04rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 45px; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 710; font-size: .92rem; transition: background-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-gold { margin-top: 23px; background: var(--gold); color: #29351e; }
.button-gold:hover { background: #ffdc94; }
.button-gold:focus-visible { outline-color: #fff1cb; }
.button-green { background: var(--green); color: white; }
.button-green:hover { background: #173d31; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); align-items: start; gap: 30px; margin-top: 36px; }
.calendar, .map-card { scroll-margin-top: 20px; }
.section-heading { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 19px; }
h2 { font: 400 clamp(1.8rem, 3vw, 2.45rem)/1.05 var(--serif); letter-spacing: -.045em; }
.section-heading p { margin-top: 6px; color: var(--muted); font-size: .94rem; }
.progress-card { display: grid; gap: 5px; min-width: 112px; flex-shrink: 0; align-self: center; font-size: .83rem; font-weight: 730; }
progress { display: block; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; background: #dfe6da; color: var(--green); }
progress::-webkit-progress-bar { background: #dfe6da; }
progress::-webkit-progress-value { background: var(--green); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 8px; }
.doors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.door { position: relative; display: grid; place-items: center; isolation: isolate; min-width: 0; min-height: 80px; aspect-ratio: 1.18; border: 1px solid #daddd0; border-radius: 12px; background: #fffdf7; color: var(--ink); overflow: hidden; transition: transform .18s ease, background-color .18s ease, border-color .18s ease; }
.door:nth-child(3n + 2) { background: #eef0e5; }
.door:nth-child(3n + 3) { background: #f4eee2; }
.door.enabled:hover { transform: translateY(-2px); border-color: #8ca58e; background: #e5ebdc; }
.door.locked { color: #5c6960; border-style: dashed; cursor: default; }
.door.current, .door.current:hover { background: var(--green); color: #fff4d6; border-color: var(--green); }
.door.solved, .door.solved:hover { background: #dfe9d9; border-color: #b2c6af; color: #214a3a; }
.door-number { font: 400 clamp(1.85rem, 3.25vw, 2.8rem)/1 var(--serif); }
.door-icon { position: absolute; top: 8px; right: 9px; color: #70633e; font-size: .9rem; line-height: 1; }
.current .door-icon { color: var(--gold); }
.solved .door-icon { color: var(--green); }
.door-flake { position: absolute; z-index: -1; bottom: -31%; left: -8%; color: #53785f17; font-size: clamp(3rem, 5.5vw, 5.4rem); line-height: 1; }
.door.current .door-flake { color: #fff3d51d; }
.calendar-status { margin-top: 14px; color: var(--muted); font-size: .9rem; }

.map-card { padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--white); }
.map-heading h2 { font-size: 1.85rem; }
.map-eyebrow { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.map-figure { margin-top: 14px; }
.map-scene { position: relative; display: grid; place-items: center; min-height: 210px; overflow: hidden; border: 1px solid #dae4d7; border-radius: 11px; background: radial-gradient(ellipse at 50% 28%, #f2f5e9, #e5ede0 76%); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 560 / 355; }
.map-controls { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 5px; }
.map-controls button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #d3dccf; border-radius: 7px; background: #fffdf7; color: var(--ink); font-size: 1.38rem; line-height: 1; }
.map-controls button:hover { background: #e4ecde; }
figcaption { display: flex; align-items: flex-start; gap: 9px; padding-top: 13px; color: var(--muted); font-size: .9rem; }
.pin-icon { display: grid; flex: 0 0 24px; place-items: center; height: 24px; border-radius: 50%; background: #e7ede0; color: var(--green); }
figcaption strong { color: var(--ink); }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 35px; padding-block: 16px 23px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer span span { margin-left: 4px; }
dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--white); color: var(--ink); box-shadow: 0 18px 60px #142b2360; }
dialog::backdrop { background: #09251eb8; }
.dialog-inner { position: relative; padding: clamp(22px, 5vw, 34px); }
.close-dialog { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font: 1.5rem/1 var(--sans); }
.close-dialog:hover { background: #e7ede0; }
dialog h2 { margin: 8px 28px 11px 0; }
.riddle-question { color: #344e43; margin-bottom: 20px; }
form label { display: block; margin-bottom: 4px; font-weight: 660; }
form input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #9ba99a; border-radius: 8px; color: var(--ink); background: white; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.text-button { min-height: 42px; padding: 5px 0; border: 0; background: transparent; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.riddle-feedback:not(:empty) { margin-top: 10px; color: #933e31; }
.riddle-tip { margin-top: 10px; color: var(--muted); }
.result-label { margin-bottom: 5px; font-weight: 750; }
#riddle-location { margin-bottom: 14px; }

@media (max-width: 880px) {
  .shell { width: calc(100% - 48px); }
  .workspace { gap: 20px; }
  .section-heading { align-items: start; }
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .shell { width: calc(100% - 30px); }
  .header-inner { grid-template-columns: 1fr auto; gap: 0 10px; min-height: auto; padding-block: 9px 7px; }
  nav { grid-row: 2; grid-column: 1 / -1; gap: 19px; margin-top: 6px; padding-left: 3px; }
  nav a { padding: 4px 0; }
  .hero { min-height: 345px; margin-top: 14px; border-radius: 16px; background-position: 63% center; }
  .hero::before { background: linear-gradient(90deg, #0d2a24ee, #102f29ac 54%, #122e2670); }
  .hero-content { padding: 26px 20px; }
  .hero h1 { font-size: clamp(2.45rem, 9.4vw, 3.65rem); }
  .hero-description { font-size: .98rem; }
  .workspace { grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
  .door { min-height: 67px; }
  .map-card { padding: 15px; }
  .progress-card { min-width: 85px; }
}

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