@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/ebgaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/ebgaramond-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Yuji Syuku";
  src: url("/assets/fonts/yujisyuku.woff2") format("woff2");
  font-display: swap;
}

/* ---------- tokens: paper by day, ink by night */
:root {
  color-scheme: light dark;
  --paper: #ECE3CF;
  --paper-2: #E4D9C1;
  --paper-3: #F4EEE0;
  --ink: #1F2523;
  --ink-soft: #5A615D;
  --red: #C23B2A;
  --line: rgba(31, 37, 35, 0.14);
  --glass: rgba(236, 227, 207, 0.72);
  --shadow: 31, 37, 35;
  --grain-opacity: 0.32;
  --spring: #D9A7A0; --summer: #8FB29A; --autumn: #D49A55; --winter: #8F9EAE;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --brush: "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161A19;
    --paper-2: #1E2321;
    --paper-3: #252B29;
    --ink: #ECE3CF;
    --ink-soft: #A9AB9F;
    --red: #E0614D;
    --line: rgba(236, 227, 207, 0.13);
    --glass: rgba(22, 26, 25, 0.7);
    --shadow: 0, 0, 0;
    --grain-opacity: 0.5;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Paper grain over everything, fixed so it doesn't scroll. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 1.1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: var(--paper); }
h1, h2 { font-weight: 500; line-height: 1.08; margin: 0 0 0.4em; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
p { text-wrap: pretty; }
i { font-style: italic; }

section, .top-inner, .legal { padding-inline: var(--gutter); }
section > *, .top-inner, .legal { max-width: var(--max); margin-inline: auto; }

/* Section labels: a small brush-kanji tag above each heading. */
.label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft);
}
.label .k { font-family: var(--brush); font-size: 1.05rem; letter-spacing: 0.08em; color: var(--red); text-transform: none; }
.label::after { content: ""; height: 1px; width: 56px; background: var(--line); }

/* ---------- header: frosted, sticky */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.top.scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgba(var(--shadow), .5); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 16px; flex-wrap: wrap; }
.brand img { width: clamp(200px, 24vw, 270px); }
.top nav { display: flex; gap: clamp(6px, 1.2vw, 14px); font-size: 1.02rem; }
.top nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px; transition: background .2s, color .2s;
}
.top nav a:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- the season now */
.now {
  position: relative; overflow: clip;
  padding-block: clamp(28px, 6vw, 84px) clamp(40px, 6vw, 80px);
}
.now-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 6vw, 96px); align-items: center;
}
/* The season's name, huge and faint, behind the poster. */
.watermark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  writing-mode: vertical-rl; font-family: var(--brush); font-size: clamp(9rem, 26vw, 22rem); line-height: 1;
  color: var(--ink); opacity: .045; pointer-events: none; user-select: none; white-space: nowrap;
}
.now-poster { perspective: 1200px; margin: 0; }
.now-poster img {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease);
  box-shadow: 0 1px 2px rgba(var(--shadow),.1), 0 40px 70px -30px rgba(var(--shadow),.55), 0 18px 30px -18px rgba(var(--shadow),.35);
}
.pill {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  padding: 6px 14px 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-3) 55%, transparent);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: relative; }
.pill .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--red);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.kanji { font-family: var(--brush); font-size: clamp(2.8rem, 6.4vw, 4.8rem); line-height: 1.05; margin: 0 0 0.12em; letter-spacing: 0.06em; }
.now h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); }
.romaji { font-style: italic; color: var(--ink-soft); margin: 0 0 0.2em; font-size: 1.25rem; }
.dates { color: var(--ink-soft); margin: 0 0 1.4em; font-variant-numeric: lining-nums; }
#now-body { max-width: 34em; }

button.link, .btn {
  font: inherit; color: inherit; cursor: pointer;
}
button.link {
  background: none; border: 0; padding: 0;
  text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 0.2em;
}
button.link:hover { color: var(--red); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 11px 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); transition: background .25s, border-color .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); background: transparent; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- the year in 72 bars */
.year { padding-block: 8px clamp(48px, 7vw, 96px); }
.year-bar {
  display: grid; grid-template-columns: repeat(72, minmax(0, 1fr)); gap: 3px; align-items: end; height: 64px;
  list-style: none; padding: 0; margin: 0 auto;
}
.year-bar li { height: 100%; display: flex; align-items: flex-end; }
.year-bar button {
  all: unset; cursor: pointer; display: block; width: 100%; height: 38%; border-radius: 2px;
  background: var(--q); opacity: .55; transition: height .35s var(--ease), opacity .2s;
}
.year-bar button:hover, .year-bar button:focus-visible { height: 70%; opacity: 1; }
.year-bar button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.year-bar .past button { opacity: .85; }
.year-bar .is-now button { height: 100%; opacity: 1; background: var(--red); }
.year-legend {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px;
  font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.year-legend span { display: flex; align-items: center; gap: 8px; }
.year-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--q); }
.q-spring { --q: var(--spring); } .q-summer { --q: var(--summer); }
.q-autumn { --q: var(--autumn); } .q-winter { --q: var(--winter); }
.year-hint { font-size: 0.92rem; color: var(--ink-soft); margin: 14px auto 0; min-height: 1.6em; }

/* ---------- intro, about */
.intro, .about, .seasons, .shops, .contact { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.intro-grid p { margin: 0 0 1em; font-size: 1.2rem; }
.intro-grid p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: .82; padding: 6px 10px 0 0; color: var(--red); font-weight: 500;
}
.cols { columns: 3 18em; column-gap: 44px; }
.cols p { margin: 0 0 1em; break-inside: avoid; }
.lede { color: var(--ink-soft); margin-top: 0; font-size: 1.15rem; }
.contact-grid .lede { max-width: 30em; }

/* ---------- grid */
.quarter { margin-top: 48px; }
.quarter h3 {
  font-weight: 500; font-size: 1.5rem; margin: 0 0 18px; display: flex; gap: 14px; align-items: center;
}
.quarter h3 span {
  font-family: var(--brush); font-size: 1.35rem; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--q) 35%, transparent); color: var(--ink);
}
.quarter h3 small { margin-left: auto; font-size: 0.9rem; color: var(--ink-soft); font-weight: 400; letter-spacing: .04em; }
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 28px 20px;
}
.card button { all: unset; cursor: pointer; display: block; width: 100%; }
.card .frame { display: block; position: relative; overflow: hidden; border-radius: 3px; }
.card img {
  aspect-ratio: 2900 / 4060; width: 100%; object-fit: cover; background: var(--paper-2);
  transition: transform .6s var(--ease);
}
.card .frame { box-shadow: 0 1px 2px rgba(var(--shadow),.1), 0 12px 24px -16px rgba(var(--shadow),.55); transition: box-shadow .35s, transform .35s var(--ease); }
.card button:hover .frame, .card button:focus-visible .frame {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(var(--shadow),.1), 0 24px 36px -18px rgba(var(--shadow),.6);
}
.card button:hover img { transform: scale(1.035); }
.card button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }
.card .cap { display: block; margin-top: 10px; font-size: 1rem; line-height: 1.3; }
.card .cap small { display: block; color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: lining-nums; margin-top: 2px; }
.card.is-now .frame { outline: 2px solid var(--red); outline-offset: 4px; }
.card.is-now .cap::before {
  content: "Now"; display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 999px;
  background: var(--red); color: var(--paper); font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; vertical-align: 2px;
}

/* ---------- shops */
.shop-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 32px; }
.shop {
  display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; border-radius: 6px;
  background: var(--paper-2); border: 1px solid var(--line); overflow: hidden;
  transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
}
.shop:hover { color: inherit; border-color: color-mix(in srgb, var(--red) 60%, transparent); transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgba(var(--shadow),.55); }
.shop-visual { position: relative; height: clamp(230px, 26vw, 300px); display: flex; justify-content: center; align-items: center; }
.metal { background: radial-gradient(120% 90% at 30% 10%, #48504c, #1f2523 70%); }
.framed { background: radial-gradient(120% 90% at 30% 10%, #faf6ec, #e2d6bd 75%); }
.shop-visual img {
  position: absolute; width: clamp(96px, 11vw, 128px); height: auto;
  box-shadow: 0 16px 28px -12px rgba(0,0,0,.55); transition: transform .5s var(--ease);
}
.shop-visual img:nth-child(1) { transform: translateX(-62%) rotate(-7deg); }
.shop-visual img:nth-child(2) { transform: translateY(-4%); z-index: 2; }
.shop-visual img:nth-child(3) { transform: translateX(62%) rotate(7deg); }
.shop:hover .shop-visual img:nth-child(1) { transform: translateX(-78%) rotate(-10deg); }
.shop:hover .shop-visual img:nth-child(2) { transform: translateY(-9%) scale(1.03); }
.shop:hover .shop-visual img:nth-child(3) { transform: translateX(78%) rotate(10deg); }
.metal img { border-radius: 2px; outline: 1px solid rgba(255,255,255,.2); outline-offset: -1px; }
.framed img { border: 7px solid #2a2622; padding: 6px; background: #f7f2e6; box-sizing: content-box; width: clamp(78px, 9vw, 104px); }
.shop-text { display: flex; flex-direction: column; gap: 6px; padding: 24px 28px 28px; }
.shop-kind { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; color: var(--red); }
.shop-text strong { font-weight: 500; font-size: 1.9rem; line-height: 1.1; }
.shop-text > span:not(.shop-kind):not(.go) { color: var(--ink-soft); }
.go { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 8px; }
.go .arrow {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.shop:hover .go .arrow { background: var(--red); border-color: var(--red); color: var(--paper); transform: translateX(4px); }

/* ---------- contact form */
.contact-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
#contact-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px;
  padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--paper-3) 45%, transparent);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.wide { grid-column: 1 / -1; }
.field label { font-size: 0.92rem; color: var(--ink-soft); letter-spacing: .02em; }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 11px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent); }
.field [aria-invalid="true"] { border-color: var(--red); }
.trap { position: absolute; left: -9999px; }
.form-note { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.send[disabled] { opacity: .6; cursor: progress; }
#form-status { margin: 0; }
#form-status.ok { color: #3b8a5a; }
#form-status.err { color: var(--red); }

/* ---------- footer */
.legal {
  display: grid; grid-template-columns: auto 1fr 1fr 2fr; gap: 28px; align-items: start;
  padding-block: 44px 60px; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--ink-soft);
}
.legal p { margin: 0 0 0.8em; }
.legal strong { color: var(--ink); font-weight: 500; }
.legal .seal { width: 52px; }

/* ---------- detail dialog */
dialog {
  border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--paper); color: var(--ink);
  width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.6);
}
dialog[open] { animation: rise .45s var(--ease); }
dialog::backdrop { background: rgba(14, 17, 16, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.d-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 40px; align-items: center; }
.d-wrap img {
  max-height: calc(100dvh - 112px); width: auto; margin-inline: auto; border-radius: 3px;
  box-shadow: 0 30px 50px -28px rgba(var(--shadow),.6); view-transition-name: detail-image;
}
.d-text { view-transition-name: detail-text; }
.d-text .kanji { font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
.d-text h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.d-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 2em; }
.close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  font: 400 1.6rem/1 var(--serif); background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.close:hover { color: var(--paper); background: var(--red); border-color: var(--red); }
::view-transition-old(detail-image), ::view-transition-new(detail-image),
::view-transition-old(detail-text), ::view-transition-new(detail-text) { animation-duration: .35s; }

/* ---------- reveal on scroll (where supported) */
@supports (animation-timeline: view()) {
  .reveal, .card, .shop {
    animation: appear linear both; animation-timeline: view(); animation-range: entry 0% cover 22%;
  }
  @keyframes appear { from { opacity: 0; transform: translateY(28px); } }
}

/* ---------- small screens */
@media (max-width: 860px) {
  .now-inner, .intro-grid, .contact-grid { grid-template-columns: 1fr; }
  .now-poster { max-width: 420px; }
  .year-bar { gap: 2px; height: 48px; }
  .year-legend { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .legal { grid-template-columns: 1fr 1fr; }
  .legal .seal, .legal .credits { grid-column: 1 / -1; }
  .d-wrap { grid-template-columns: 1fr; padding: 22px; gap: 22px; }
  .d-wrap img { max-height: 58dvh; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 22px 14px; }
  .top nav a { padding: 4px 8px; }
}
@media (max-width: 520px) {
  #contact-form { grid-template-columns: 1fr; }
  .top nav { width: 100%; justify-content: space-between; }
}

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