/* ============ Tokens ============ */
:root {
  --bg: #F6F1E7;
  --bg-deep: #EDE3D0;
  --surface: #FFFCF6;
  --ink: #2E2A25;
  --ink-soft: #4A433A;
  --muted: #6E6354;
  --line: #DED0B6;
  --accent: #A8451F;
  --accent-dark: #8A3618;
  --accent-ink: #FFF6EF;
  --sage: #4F6B3C;

  --c-baking: #9C5E24;
  --c-ceramics: #9A4B2C;
  --c-floristry: #4F6B3C;
  --c-painting: #4C5C93;

  --font-display: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --radius-l: 22px;
  --radius-m: 14px;
  --radius-s: 8px;
  --shadow-card: 0 2px 0 var(--line), 0 22px 40px -28px rgba(46, 42, 37, .45);
  --shadow-pop: 0 30px 70px -25px rgba(46, 42, 37, .55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ Reset ============ */
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
dl { margin: 0; }
dd { margin: 0; }
button { font: inherit; color: inherit; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--accent-ink);
  padding: 12px 18px;
  border-radius: var(--radius-s);
  z-index: 200;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

/* ============ Focus & buttons base ============ */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); color: var(--bg); }
}
.btn:active { transform: scale(0.97); }

.btn-open {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  width: 100%;
}
@media (hover: hover) and (pointer: fine) {
  .btn-open:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
}
.btn-open:focus-visible { outline-offset: 3px; }

.btn-save {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  width: 100%;
  margin-top: 24px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-save:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
}
.btn-save[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-dark);
}
@media (hover: hover) and (pointer: fine) {
  .btn-save[aria-pressed="true"]:hover { background: var(--bg-deep); }
}

.btn-ghost {
  border-color: var(--ink);
  background: var(--surface);
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: var(--radius-s);
}
.brand-mark { color: var(--accent); font-size: 18px; }
.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 16px;
  flex: 1;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-s);
}
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover { color: var(--accent); }
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .nav-pill:hover { background: var(--bg-deep); }
}
.nav-pill:active { transform: scale(0.97); }
.nav-pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.nav-pill-count {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-pill[aria-pressed="true"] .nav-pill-count {
  background: var(--accent-ink);
  color: var(--accent-dark);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: clip;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(168,69,31,.10), transparent 60%),
    repeating-linear-gradient(115deg, rgba(46,42,37,.035) 0 2px, transparent 2px 34px),
    var(--bg);
  padding: 64px 32px 96px;
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 18px;
}
.eyebrow--light { color: var(--c-baking); }
.display {
  font-size: clamp(2.6rem, 3.6vw + 1.4rem, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 500;
  max-width: 11ch;
}
.hero-lede {
  margin-top: 24px;
  max-width: 52ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.controls-bar {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-search { flex: 1 1 240px; }
.field-filter { flex: 0 1 220px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--radius-m);
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168,69,31,.22);
}
.field select { cursor: pointer; }
.hero-stats {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Hero stack (decorative signature) */
.hero-stack {
  position: relative;
  height: 320px;
  justify-self: end;
  width: 100%;
  max-width: 260px;
}
.stack-card {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 210px;
  height: 130px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  transform-origin: bottom center;
  animation: float-settle 7s ease-in-out infinite;
  transition: transform 220ms var(--ease);
}
.stack-card .icon { width: 22px; height: 22px; }
.stack-edge {
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 8px;
  border-radius: 0 0 6px 6px;
}
.stack-card--baking { transform: rotate(-9deg) translate(-58px, -18px); z-index: 1; animation-delay: 0s; }
.stack-card--baking .stack-edge { background: var(--c-baking); }
.stack-card--floristry { transform: rotate(6deg) translate(38px, -6px); z-index: 2; animation-delay: .6s; }
.stack-card--floristry .stack-edge { background: var(--c-floristry); }
.stack-card--painting { transform: rotate(-3deg) translate(-14px, 6px); z-index: 3; animation-delay: 1.2s; }
.stack-card--painting .stack-edge { background: var(--c-painting); }
.stack-card--ceramics { transform: rotate(4deg) translate(20px, 20px); z-index: 4; animation-delay: 1.8s; }
.stack-card--ceramics .stack-edge { background: var(--c-ceramics); }

@media (hover: hover) and (pointer: fine) {
  .hero-stack:hover .stack-card--baking { transform: rotate(-16deg) translate(-88px, -34px); }
  .hero-stack:hover .stack-card--floristry { transform: rotate(11deg) translate(60px, -14px); }
  .hero-stack:hover .stack-card--painting { transform: rotate(-6deg) translate(-20px, 10px); }
  .hero-stack:hover .stack-card--ceramics { transform: rotate(8deg) translate(34px, 34px); }
}

@keyframes float-settle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

/* ============ Tab rail ============ */
.tab-rail-wrap {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-rail {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  padding: 18px 4px 26px;
  min-width: max-content;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-s) var(--radius-s) 4px 4px;
  border: 1.5px solid var(--line);
  border-top: 4px solid var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .tab:hover { transform: translateY(-3px); }
}
.tab:active { transform: scale(0.97) translateY(0); }
.tab[data-category="all"] { border-top-color: var(--ink); }
.tab[data-category="Baking"] { border-top-color: var(--c-baking); }
.tab[data-category="Ceramics"] { border-top-color: var(--c-ceramics); }
.tab[data-category="Floristry"] { border-top-color: var(--c-floristry); }
.tab[data-category="Painting"] { border-top-color: var(--c-painting); }
.tab.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.tab:nth-child(odd) { transform: translateY(-4px); }
.tab:nth-child(odd):active { transform: translateY(-4px) scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .tab:nth-child(odd):hover { transform: translateY(-7px); }
}

@media (max-width: 640px) {
  .tab-rail { padding-block: 14px; padding-inline-end: 24px; }
  .tab, .tab:nth-child(odd) { transform: none; }
}
@media (max-width: 640px) and (hover: hover) and (pointer: fine) {
  .tab:hover, .tab:nth-child(odd):hover { transform: none; }
}

/* ============ Catalogue ============ */
.catalogue {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 32px 112px;
}
.catalogue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.catalogue-head h2 { font-size: clamp(1.7rem, 1vw + 1.4rem, 2.4rem); }
.result-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
}
.card:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }

.card--featured { grid-column: span 1; }
@media (min-width: 760px) {
  .card--featured { grid-column: span 2; }
  .card--featured .card-media { aspect-ratio: 21 / 9; }
  .card--featured .card-title { font-size: 1.7rem; }
}

.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-deep); }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-plate {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(46,42,37,.72);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
}
.card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tag-color, var(--ink));
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.card-tag .icon { width: 14px; height: 14px; }
.card-saved-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border-radius: 999px;
  animation: badge-in 220ms var(--ease);
}
@keyframes badge-in {
  from { opacity: 0; transform: translateY(4px) scale(.9); }
  to { opacity: 1; transform: none; }
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title { font-size: 1.25rem; line-height: 1.15; }
.card-meta, .card-facts { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.card-price { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.card-instructor { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.dot { color: var(--line); }
.card-body .btn-open { margin-top: auto; }

/* ============ Empty state ============ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-l);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-title { font-family: var(--font-display); font-size: 1.4rem; }
.empty-copy { color: var(--muted); max-width: 44ch; }

/* ============ Visit band ============ */
.visit-band {
  background:
    linear-gradient(rgba(30, 27, 23, .92), rgba(30, 27, 23, .96)),
    url('assets/studio.jpg') center / cover no-repeat;
  color: var(--bg);
  padding: 96px 32px;
}
.visit-inner { max-width: 860px; margin: 0 auto; }
.visit-band h2 {
  color: var(--bg);
  font-size: clamp(1.8rem, 2vw + 1.2rem, 2.8rem);
  margin: 14px 0 20px;
  max-width: 18ch;
}
.visit-copy { color: #D9D0C1; max-width: 60ch; font-size: 17px; line-height: 1.65; }
.visit-facts {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  border-top: 1px solid rgba(246,241,231,.2);
  padding-top: 28px;
}
.visit-facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #B7AC98;
  margin-bottom: 6px;
}
.visit-facts dd { font-size: 15px; }

/* ============ Footer ============ */
.site-footer { padding: 40px 32px 56px; }
.footer-inner { max-width: 1240px; margin: 0 auto; }
.brand-word.small { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.footer-note { color: var(--muted); font-size: 13px; max-width: 60ch; }

/* ============ Detail dialog ============ */
.detail {
  border: none;
  padding: 0;
  border-radius: var(--radius-l);
  width: min(760px, calc(100vw - 40px));
  max-height: min(880px, calc(100vh - 48px));
  background: transparent;
  overflow: visible;
}
.detail::backdrop {
  background: rgba(46, 42, 37, .55);
}
.detail[open] .detail-card {
  animation: card-flip-in 420ms var(--ease);
}
@keyframes card-flip-in {
  from { opacity: 0; transform: perspective(1400px) rotateY(-8deg) scale(.96); }
  to { opacity: 1; transform: perspective(1400px) rotateY(0) scale(1); }
}
.detail-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow: auto;
  max-height: min(880px, calc(100vh - 48px));
  position: relative;
  box-shadow: var(--shadow-pop);
}
.detail-close {
  position: sticky;
  top: 14px;
  margin: 14px 14px 0 auto;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  z-index: 2;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .detail-close:hover { background: var(--ink); color: var(--bg); }
}
.detail-close:active { transform: scale(0.97); }

.detail-media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-deep); }
.detail-img { width: 100%; height: 100%; object-fit: cover; }
.detail-plate {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(46,42,37,.72);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
}
.detail-content { padding: 28px 32px 36px; }
.detail-tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tag-color, var(--accent)); margin-bottom: 8px; }
.detail-title { font-size: clamp(1.6rem, 1.4vw + 1.2rem, 2.2rem); margin-bottom: 20px; }
.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  margin-bottom: 24px;
}
.detail-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 4px; }
.detail-facts dd { font-size: 15px; font-weight: 600; font-family: var(--font-mono); }
.detail-body { font-size: 16px; line-height: 1.7; color: var(--ink-soft); max-width: 62ch; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .stack-card { animation: none; }
  .detail[open] .detail-card { animation: none; }
}

/* ============ Mobile ============ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stack { display: none; }
  .brand-tagline { display: none; }
}

@media (max-width: 640px) {
  .header-inner { padding: 14px 20px; gap: 12px; flex-wrap: nowrap; }
  .brand { flex-shrink: 0; }
  .brand-tagline { display: none; }
  .header-nav {
    flex-shrink: 1;
    min-width: 0;
    overflow-x: auto;
    padding-right: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link, .nav-pill { flex-shrink: 0; }
  .nav-link { padding: 12px 8px; }
  .hero { padding: 40px 20px 56px; }
  .display { max-width: none; }
  .controls-bar { flex-direction: column; padding: 16px; }
  .field-filter { flex-basis: auto; }
  .catalogue { padding: 48px 20px 80px; }
  .tab-rail-wrap { padding: 0 20px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .card--featured .card-media { aspect-ratio: 4/3; }
  .card--featured .card-title { font-size: 1.25rem; }
  .visit-band { padding: 64px 20px; }
  .site-footer { padding: 32px 20px 44px; }
  .detail-content { padding: 22px 20px 28px; }
  .detail { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .detail-card { max-height: calc(100vh - 24px); }
}
