@font-face {
  font-family: "Festival Title";
  src: url("/assets/festival-title.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #17372f;
  --ink-soft: #53625a;
  --red: #a73628;
  --line: #d9dacf;
  --paper: #fcfbf6;
  --serif: "Festival Title", "Noto Serif KR", "Noto Serif CJK KR", "Nanum Myeongjo", Batang, serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, sans-serif;
  --margin: clamp(1.25rem, 6.2vw, 6rem);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; font-size: 1rem; }
a { color: inherit; }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
img { max-width: 100%; }
:where(a, button, summary):focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
#content:focus { outline: none; }
html:has(#image-viewer[open]) { overflow: hidden; }
#image-viewer {
  width: min(66rem, calc(100% - 2rem)); height: calc(100% - 2rem); height: calc(100dvh - 2rem);
  max-width: none; max-height: none; margin: auto; padding: 0; border: 0; border-radius: .5rem;
  background: #19231f; color: var(--ink); box-shadow: 0 1rem 4rem #08151060;
}
#image-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#image-viewer::backdrop { background: #111b17c9; }
.viewer-bar { display: flex; align-items: center; gap: .5rem; padding: .45rem .85rem; background: var(--paper); }
.viewer-bar h2 { flex: 1; margin: 0; font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.3; }
.viewer-bar button { min-height: 44px; padding: .35rem .7rem; border: 1px solid #abb4a9; border-radius: .25rem; background: transparent; color: var(--ink); white-space: nowrap; font-size: .88rem; }
.viewer-bar form button { background: var(--ink); border-color: var(--ink); color: white; }
.viewer-canvas { display: flex; overflow: auto; min-width: 0; min-height: 0; padding: .6rem; overscroll-behavior: contain; }
.viewer-canvas img { display: block; flex: none; width: auto; height: auto; max-width: 100%; max-height: 100%; margin: auto; }
.viewer-canvas.original-size img { max-width: none; max-height: none; }
.viewer-pages:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 1.25rem; padding: .3rem .65rem max(.3rem, env(safe-area-inset-bottom)); background: var(--paper); }
.viewer-pages button { min-height: 44px; padding: .25rem .85rem; background: none; border: 0; color: var(--ink); font-weight: 600; }
.viewer-pages button:disabled { color: #757a75; }
#viewer-position { min-width: 4.5rem; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  #image-viewer { width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .viewer-bar { padding: .35rem .6rem; }
  .viewer-canvas { padding: .3rem; }
}
.skip { position: absolute; left: 1rem; top: 1rem; z-index: 9; transform: translateY(-180%); padding: .65rem 1rem; background: var(--ink); color: white; }
.skip:focus { transform: none; }
.wrap { width: min(75rem, calc(100% - var(--margin) * 2)); margin-inline: auto; }
.loading { padding-block: 4rem; }
.site-header { position: relative; z-index: 4; background: var(--paper); border-bottom: 1px solid #dedcd1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; min-height: 4.65rem; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: .67rem; width: fit-content; text-decoration: none; }
.brand img { display: block; width: 2.4rem; height: auto; }
.brand > span { display: flex; flex-direction: column; gap: .12rem; }
.brand small { font-size: .72rem; line-height: 1.1; font-weight: 650; letter-spacing: .055em; }
.brand strong { font-family: var(--serif); font-size: 1.42rem; font-weight: 800; line-height: 1.14; letter-spacing: -.07em; }
#main-nav { display: flex; align-items: stretch; flex: 1; align-self: stretch; gap: clamp(1.4rem, 3.2vw, 3.1rem); margin-left: clamp(2rem, 10vw, 10rem); }
#main-nav a { position: relative; display: inline-flex; align-items: center; color: #3d4b43; white-space: nowrap; text-decoration: none; font-size: .965rem; font-weight: 600; letter-spacing: -.035em; }
#main-nav a:not(.guide-link)::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: transparent; }
#main-nav a[aria-current], #main-nav a:hover { color: var(--red); }
#main-nav a[aria-current]:not(.guide-link)::after { background: var(--red); }
@media (width > 760px) {
  #main-nav .guide-link { align-self: center; min-height: 2.55rem; gap: .45rem; margin-left: auto; padding: .45rem 1.05rem; border: 1px solid #9faaa0; border-radius: 2rem; color: var(--ink); font-size: .89rem; }
  #main-nav .guide-link:is(:hover,[aria-current]) { border-color: var(--ink); background: #e9ede4; }
}
#main-nav .guide-link svg, .line-icon { flex: none; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
#menu-toggle { display: none; }

.hero {
  display: grid;
  grid-template: "banner" auto / minmax(0, 1fr);
  isolation: isolate;
  position: relative;
  background: #f8ebd8;
  border-bottom: 1px solid #d4cebb;
}
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: url("/assets/paper.png") repeat; opacity: .43; z-index: -1; }
.hero-art {
  grid-area: banner;
  align-self: end;
  justify-self: end;
  width: min(61%, 64rem);
  margin-inline-end: max(0px, calc((100% - 104rem) / 2));
  mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / .88) 7%, #000 15%);
}
.hero-art img { display: block; width: 100%; height: auto; }
.hero-inner {
  grid-area: banner;
  align-self: center;
  position: relative;
  padding-block: clamp(1.8rem, 3.2vw, 3.5rem);
}
.hero-copy { width: min(42%, 30rem); }
.hero-year, .section-kicker { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; color: var(--red); font-size: .91rem; font-weight: 750; letter-spacing: .04em; }
.short-rule { display: inline-block; width: 2rem; height: 2px; background: currentColor; }
.small-dot { width: .23rem; height: .23rem; background: currentColor; border-radius: 50%; }
.hero h1 { margin: 0; color: #19382f; font-family: var(--serif); font-size: clamp(3.6rem, 6.7vw, 6.65rem); font-weight: 850; letter-spacing: -.095em; line-height: 1.05; }
.hero-region { display: block; margin-bottom: .22em; font-size: clamp(1.6rem, .44em, 2.65rem); line-height: 1.2; letter-spacing: -.055em; font-weight: 750; word-break: keep-all; }
.hero-event-details { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.25rem; margin-top: 1.45rem; }
.hero-city { display: grid; gap: .25rem; border-inline-start: 1px solid #c3baa5; padding-inline-start: 1.1rem; }
.hero-city span { font-size: .8125rem; color: var(--ink-soft); }
.hero-city img { display: block; width: 5.5rem; height: auto; }
.hero-schedule { display: grid; gap: .32rem; color: #304739; font-size: clamp(1rem, 1.15vw, 1.16rem); letter-spacing: -.025em; }
.hero-schedule p { display: flex; align-items: center; gap: .55rem; margin: 0; }
.hero-schedule time { font-weight: 650; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .68rem; margin-top: 1.65rem; }
.button { display: inline-flex; min-height: 3.05rem; align-items: center; justify-content: center; gap: .52rem; padding: .68rem 1.14rem; border: 1px solid; border-radius: 3px; font: 650 .96rem/1.35 var(--sans); text-decoration: none; letter-spacing: -.038em; }
.primary { background: var(--ink); border-color: var(--ink); color: #fffdf3; }
.primary:hover { background: #264d41; border-color: #264d41; }
.outline { background: transparent; color: var(--ink); border-color: #819183; }
.outline:hover { border-color: var(--ink); background: #e4e7d8; }
.home-schools { padding-block: clamp(3.15rem, 4.4vw, 4.4rem) clamp(4rem, 6.2vw, 6.25rem); }
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(1.55rem, 2.2vw, 2.2rem); }
.woven { display: flex; align-items: center; gap: 3px; width: max-content; margin-bottom: .62rem; }
.woven i { display: block; width: .74rem; height: .26rem; background: #a43729; transform: skewX(-19deg); }
.woven i:nth-child(2) { background: #c99d48; }
.woven i:nth-child(3) { background: #355d55; }
.section-top h2 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 2.85vw, 2.78rem); font-weight: 800; letter-spacing: -.08em; line-height: 1.28; }
.section-top p { margin: .42rem 0 0; color: var(--ink-soft); line-height: 1.6; letter-spacing: -.03em; }
.more-link { display: inline-flex; flex: none; align-items: center; gap: .48rem; padding: .5rem 0; color: var(--ink); font-size: .93rem; font-weight: 650; text-decoration: none; }
.more-link:hover { text-decoration: underline; text-underline-offset: .25em; }
.more-link svg { width: 1rem; height: 1rem; }
.school-groups {
  --school-gap: clamp(1rem, 1.7vw, 1.5rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.8rem, 3.5vw, 3rem) var(--school-gap);
}
.school-group { --columns: 1; grid-column: span 3; min-width: 0; }
.school-group[data-columns="2"] { --columns: 2; grid-column: span 6; }
.school-group[data-columns="3"] { --columns: 3; grid-column: 1 / -1; }
.school-group-heading { display: flex; align-items: baseline; gap: .58rem; padding: .55rem 0 .72rem; border-top: 2px solid var(--ink); }
.school-group-heading > :is(h2,h3) { margin: 0; font: 750 1.12rem/1.4 var(--sans); letter-spacing: -.045em; }
.school-group-heading > span { color: var(--ink-soft); font-size: .84rem; }
.school-cards { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 1.1rem var(--school-gap); }
.school-card { display: block; min-width: 0; color: var(--ink); text-decoration: none; }
.school-card-photo { overflow: hidden; aspect-ratio: 1.8; background: #e8e8dd; }
.school-card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease-out; }
.school-card-text { margin-top: .66rem; }
.school-card-text > span { color: var(--ink-soft); font-size: .875rem; }
.school-card .school-card-title { margin: .17rem 0 0; color: var(--ink); font: 750 clamp(1.24rem, 1.75vw, 1.65rem)/1.35 var(--serif); letter-spacing: -.055em; word-break: keep-all; overflow-wrap: anywhere; }
.school-card:hover img { transform: scale(1.025); }
.school-card:hover .school-card-title, .record-link:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .23em; }
.home-archive { background: #f1f1e8; border-top: 1px solid var(--line); padding-block: clamp(3rem, 5vw, 5rem); }
.record-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; }
.record-link { display: grid; grid-template-columns: clamp(3.8rem, 5.5vw, 5rem) 1fr auto; align-items: center; gap: 1rem; padding: 1rem 0; border-block: 1px solid #bdc4b8; color: var(--ink); text-decoration: none; }
.record-link img { display: block; width: 100%; aspect-ratio: 1.4; object-fit: cover; }
.poster-link img { object-position: 50% 40%; }
.record-link small { color: var(--red); font-size: .84rem; font-weight: 650; }
.record-link h3 { margin: .25rem 0 0; font-family: var(--serif); font-weight: 700; font-size: clamp(1.16rem, 1.7vw, 1.58rem); line-height: 1.35; letter-spacing: -.055em; }
.record-icon { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border: 1px solid #b5bfb3; border-radius: 50%; }
.page-head { padding-top: clamp(2.75rem, 6vw, 5.6rem); margin-bottom: clamp(2rem, 3.7vw, 3.8rem); }
.page-title { margin: 0; font-family: var(--serif); font-size: clamp(2.65rem, 5.2vw, 4.9rem); font-weight: 800; line-height: 1.16; letter-spacing: -.078em; }
.page-head > p:last-child:not(.section-kicker) { color: var(--ink-soft); }
.page-head > .button { margin-top: 1.4rem; }
footer { border-top: 1px solid var(--line); background: #f6f6ee; }
.footer-in { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem 2rem; padding-block: 2rem; min-height: 7rem; }
.footer-in .brand img { width: 1.95rem; }
.footer-in .brand strong { font-size: 1.12rem; }
.footer-in .brand small { font-size: .67rem; }
.footer-in > span, .footer-links a { color: #536158; font-size: .875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .45rem 1.3rem; margin-inline-start: auto; text-underline-offset: .25em; }

@media (min-width: 641px) and (max-width: 900px) {
  .school-group { grid-column: span 6; }
  .school-group[data-columns="2"] { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .school-groups { display: flex; flex-direction: column; gap: 1.65rem; }
  .school-group-heading { padding-block: .5rem .65rem; }
  .school-cards { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .school-card { display: grid; grid-template-columns: clamp(5.7rem, 28vw, 9.7rem) minmax(0, 1fr); align-items: center; column-gap: .85rem; }
  .school-card-photo { aspect-ratio: 1.6; }
  .school-card-text { margin: 0; }
  .school-card .school-card-title { font-size: clamp(1.09rem, 4.25vw, 1.35rem); }
}

@media (max-width: 1000px) {
  .record-grid { grid-template-columns: 1fr; gap: 0; }
  .record-link + .record-link { border-top: none; }
  #main-nav { margin-left: 1rem; gap: clamp(1rem, 2.6vw, 2.15rem); }
}

@media (max-width: 760px) {
  :root { --margin: clamp(1.3rem, 5.4vw, 2.35rem); }
  .topbar { min-height: 4rem; gap: 1rem; }
  .brand img { width: 2.05rem; }
  .brand small { font-size: .66rem; }
  .brand strong { font-size: 1.2rem; }
  #menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; background: transparent; width: 44px; height: 44px; margin-right: -.55rem; padding: .5rem; border: none; }
  #menu-toggle span { width: 21px; height: 2px; background: var(--ink); }
  #menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  #menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  #menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
  #main-nav { display: none; position: absolute; inset: 100% 0 auto; padding: .5rem var(--margin) 1.2rem; margin: 0; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 8px 11px #15372e13; }
  #main-nav.open {
    display: flex; align-items: stretch; flex-direction: column; gap: .1rem;
    max-height: calc(100vh - 4rem - 1px);
    max-height: calc(100dvh - 4rem - 1px);
    overflow-y: auto; overscroll-behavior-y: contain;
  }
  #main-nav a { min-height: 44px; padding: .5rem 0; }
  #main-nav a:not(.guide-link)::after { display: none; }
  #main-nav .guide-link svg { display: none; }
  .hero-year { margin-bottom: .8rem; }
  .section-top { align-items: flex-end; gap: .8rem; }
  .record-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .record-link + .record-link { border-top: none; }
  .footer-in { gap: .9rem 1.2rem; }
}

@media (max-width: 540px) {
  .button { padding-inline: .87rem; min-height: 2.8rem; font-size: .91rem; }
  .section-top { flex-wrap: wrap; }
  .section-top p { font-size: .94rem; }
  .more-link { font-size: .87rem; min-height: 44px; }
  .footer-in { align-items: flex-start; }
  .footer-in > .brand { flex-basis: 100%; }
  .footer-links { margin-inline-start: 0; }
}

@media (max-width: 340px) {
  .record-link { grid-template-columns: 4rem 1fr; gap: .75rem; }
  .record-icon { display: none; }
}

@media (min-width: 104rem) {
  .hero-art { mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / .88) 7%, #000 15%, #000 94%, transparent); }
}

@media (min-width: 641px) and (max-width: 1000px) {
  .hero-art img { mask-image: linear-gradient(180deg, transparent, #000 12%); }
  .hero-inner { padding-block: 1.3rem; }
  .hero h1 { font-size: clamp(2.9rem, 6.45vw, 4.4rem); }
  .hero-city { display: flex; align-items: center; gap: .4rem; padding: 0; border: 0; }
  .hero-event-details, .hero-actions { gap: .5rem; margin-top: .9rem; }
  .hero-city img { width: 3.9rem; }
  .hero-schedule { font-size: .93rem; }
  .hero-actions .button { min-height: 2.75rem; padding: .52rem .7rem; font-size: .87rem; }
  .hero-actions .line-icon { display: none; }
}

@media (max-width: 640px) {
  .hero {
    grid-template: "year" auto "title" auto "art" auto "details" auto "actions" auto / minmax(0, 1fr);
    padding-block: clamp(1.4rem, 5vw, 2.1rem) 1.5rem;
  }
  .hero-inner, .hero-copy { display: contents; }
  .hero-year, .hero h1, .hero-event-details, .hero-actions { margin-inline: var(--margin); }
  .hero-year { grid-area: year; margin-bottom: .55rem; font-size: .8rem; }
  .hero h1 {
    grid-area: title;
    position: relative;
    z-index: 1;
    font-size: clamp(3.4rem, 13.5vw, 4.8rem);
    line-height: .99;
  }
  .hero-art {
    grid-area: art;
    width: 100%;
    margin: clamp(-3.2rem, -9vw, -1.75rem) 0 0;
    mask-image: linear-gradient(0deg, transparent, #000 12%);
  }
  .hero-art img {
    mask-image: radial-gradient(ellipse 39% 80% at 63% 82%, #000 97%, transparent),
                linear-gradient(180deg, transparent, #000 19%);
  }
  .hero-event-details { grid-area: details; margin-block: .15rem 0; gap: .5rem 1rem; }
  .hero-schedule { font-size: .97rem; gap: .25rem; }
  .hero-schedule .line-icon { width: 1.05rem; height: 1.05rem; }
  .hero-city { padding-inline-start: .85rem; }
  .hero-city img { width: 4.4rem; }
  .hero-actions { grid-area: actions; margin-top: 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .hero-actions .button { min-height: 2.9rem; padding-inline: .45rem; gap: .35rem; }
}
@media (max-width: 375px) {
  .hero h1 { font-size: clamp(2.95rem, 14vw, 3.3rem); }
  .hero-art { margin-top: 0; }
  .hero-event-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .5rem; }
  .hero-schedule { font-size: clamp(.85rem, 3.95vw, .94rem); }
  .hero-schedule p { gap: .34rem; }
  .hero-city { padding-inline-start: .45rem; }
  .hero-city img { width: 3.75rem; }
  .hero-actions .button { font-size: .85rem; }
}

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