/* ============================================================
   Forma — warm paper editorial with a "workshop ticket" system
   Canvas: aged paper · Ink: near-black brown · Accent: clay red
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/fraunces-italic-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Spline Sans Mono';
  src: url('assets/fonts/splinemono-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F4EEDF;
  --paper-2: #FBF7EC;
  --paper-3: #FFFDF4;
  --ink: #241C12;
  --ink-2: #5F5442;
  --ink-3: #8B7C63;
  --line: #D9CEB6;
  --line-strong: #241C12;
  --clay: #B3441C;
  --clay-deep: #8C3211;
  --clay-soft: #F0D9CC;
  --on-clay: #FDF6E9;
  --focus: #B3441C;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Spline Sans Mono', 'SF Mono', 'Menlo', monospace;

  --radius-s: 3px;
  --radius-m: 6px;
  --shadow-hover: 4px 4px 0 rgba(36, 28, 18, 0.9);
  --measure: 1200px;
  --gutter: clamp(20px, 4.5vw, 48px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: radial-gradient(rgba(36, 28, 18, 0.055) 1px, transparent 1px);
  background-size: 5px 5px;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-optical-sizing: auto;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

em { font-style: italic; }

:where(a, button, input, select, summary):focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

::selection { background: var(--clay); color: var(--on-clay); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius-s);
}
.skip-link:focus { left: 8px; color: var(--paper); }

/* ---------- Shared roles ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 14px;
}
.kicker::before { content: "— "; color: var(--ink-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 13px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(36,28,18,0.9); }

.btn-primary {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--on-clay);
}
.btn-primary:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: var(--on-clay); }

.btn-small { padding: 8px 12px; font-size: 12px; }

/* ---------- Header ---------- */
.site-head {
  position: relative;
  z-index: 2;
  border-bottom: 1.5px solid var(--line-strong);
  background: var(--paper);
}
.head-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 22px var(--gutter) 18px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark-dot { color: var(--clay); }
.wordmark-foot { font-size: 40px; color: var(--paper); margin: 0; }
.wordmark-foot .wordmark-dot { color: var(--clay); }

.head-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: right;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 84px) var(--gutter) clamp(44px, 6vw, 96px);
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(44px, 6.6vw, 84px);
  margin: 0 0 22px;
}
.hero-copy h1 em { color: var(--clay); font-weight: 500; }

.lede {
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 0 28px;
  text-wrap: pretty;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-meta li {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero-meta li + li::before { content: "+ "; color: var(--clay); }

/* Arch crop — the signature image shape */
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 4.35;
  object-fit: cover;
  border-radius: 999px 999px var(--radius-m) var(--radius-m);
  border: 1.5px solid var(--line-strong);
  background: var(--paper-2);
}
.hero-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-align: center;
}

/* ---------- Workshops section ---------- */
.workshops {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 110px);
  scroll-margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); }

.result-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: 6px;
  white-space: nowrap;
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 26px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-grow { flex: 1 1 240px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field-input, .field-select {
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 11px 14px;
  height: 46px;
}
.field-grow .field-input { width: 100%; }
.field-input::placeholder { color: var(--ink-3); }
.field-select {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23241C12' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.chip { height: 46px; align-self: flex-end; }
.chip-mark {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  flex: none;
}
.chip[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--on-clay);
}
.chip[aria-pressed="true"] .chip-mark { background: var(--on-clay); border-color: var(--on-clay); }

/* ---------- Ticket list ---------- */
.ticket-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--paper-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: 0 2px 0 rgba(36, 28, 18, 0.12);
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 56px 96px 1fr auto;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  padding: 20px clamp(16px, 2.4vw, 28px);
  transition: background 120ms ease;
}
.ticket + .ticket { border-top: 1.5px dashed var(--line); }
.ticket:hover { background: var(--paper-3); }

.ticket-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-right: clamp(14px, 2vw, 26px);
  border-right: 1.5px dashed var(--line);
  align-self: stretch;
  justify-content: center;
}
.ticket-index {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  color: var(--ink-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 120ms ease;
}
.ticket:hover .ticket-index { color: var(--clay); }

.ticket-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}

.ticket-main { min-width: 0; }
.ticket-cat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ticket-index-inline { display: none; color: var(--ink-2); }
.ticket-title {
  font-size: clamp(22px, 2.2vw, 27px);
  margin: 0 0 6px;
}
.ticket-title .saved-flag { color: var(--clay); }
.ticket-summary {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 46em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-spec {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.ticket-spec b { color: var(--ink); font-weight: 500; }
.ticket-savedtag { color: var(--clay); font-weight: 600; }

.ticket-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.ticket-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 560;
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.ticket-price small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 4px;
}

/* ---------- Empty state ---------- */
.empty-state { padding: 6px 0; }
.empty-card {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--paper-2);
  text-align: center;
  padding: clamp(40px, 6vw, 72px) 24px;
}
.empty-card .kicker { text-align: center; }
.empty-title { font-size: clamp(26px, 3vw, 36px); margin-bottom: 10px; }
.empty-text { color: var(--ink-2); margin: 0 0 24px; }

/* ---------- Studio band ---------- */
.studio-band {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(64px, 9vw, 120px);
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.studio-figure { margin: 0; }
.studio-figure img {
  width: 100%;
  aspect-ratio: 3 / 4.1;
  object-fit: cover;
  border-radius: 999px 999px var(--radius-m) var(--radius-m);
  border: 1.5px solid var(--line-strong);
}
.studio-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-align: center;
}
.studio-copy h2 {
  font-size: clamp(30px, 3.8vw, 48px);
  margin-bottom: 18px;
}
.studio-copy h2 em { color: var(--clay); font-weight: 500; }
.studio-copy > p { color: var(--ink-2); max-width: 36em; margin: 0 0 30px; text-wrap: pretty; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 16px 0;
}
.steps li + li { border-top: 1.5px dashed var(--line); }
.step-no {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--clay);
  flex: none;
  font-variant-numeric: tabular-nums;
}
.step-text { color: var(--ink-2); }
.step-text strong { color: var(--ink); font-weight: 600; }

/* ---------- Footer ---------- */
.site-foot {
  position: relative;
  z-index: 2;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(48px, 6vw, 80px) var(--gutter) 40px;
}
.foot-grid {
  max-width: var(--measure);
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(244, 238, 223, 0.28);
  padding-bottom: 32px;
}
.foot-line {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: rgba(244, 238, 223, 0.85);
  max-width: 22em;
  text-align: right;
}
.foot-credits {
  max-width: var(--measure);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  color: rgba(244, 238, 223, 0.62);
}

/* ---------- Detail dialog ---------- */
.detail {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(1000px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  width: 100%;
  overflow: visible;
}
.detail::backdrop {
  background: rgba(28, 21, 12, 0.55);
  backdrop-filter: blur(2px);
}
.dialog-open .detail { animation: ticket-in 260ms cubic-bezier(0.2, 0.9, 0.25, 1); }
.dialog-open .detail::backdrop { animation: fade-in 260ms ease; }

.detail-card {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--paper-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: 8px 8px 0 rgba(36, 28, 18, 0.85);
  overflow: hidden;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  position: relative;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: var(--paper-2);
}
.detail-close span { font-weight: 500; }

.detail-figure { margin: 0; position: sticky; top: 0; }
.detail-figure img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: calc(100dvh - 40px);
  object-fit: cover;
  border-radius: 999px 999px 0 0 / 300px 300px 0 0;
}

.detail-content {
  padding: clamp(28px, 4vw, 48px) clamp(24px, 3.5vw, 44px) clamp(28px, 4vw, 40px);
  display: flex;
  flex-direction: column;
}
.detail-title { font-size: clamp(32px, 3.6vw, 46px); margin-bottom: 16px; }
.detail-body {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 26px;
  text-wrap: pretty;
}

.detail-specs {
  margin: 0 0 30px;
  border-top: 1.5px solid var(--line-strong);
}
.detail-specs .spec-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
}
.detail-specs .spec-row + .spec-row { border-top: 1.5px dashed var(--line); }
.detail-specs dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.detail-specs dd {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1.5px dashed var(--line);
  padding-top: 24px;
}
.detail-actions .btn { width: 100%; }
#save-item[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
#save-item[aria-pressed="true"]:hover { background: var(--clay); border-color: var(--clay); }
.detail-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: var(--ink-2);
  text-align: center;
}

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .detail-card { grid-template-columns: 1fr; }
  .detail-figure { position: static; }
  .detail-figure img {
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 10;
    border-radius: 999px 999px 0 0 / 140px 140px 0 0;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 40px;
  }
  .hero-figure img { aspect-ratio: 4 / 3; }
  .hero-figure { max-width: 520px; }

  .studio-band { grid-template-columns: 1fr; }
  .studio-figure { max-width: 380px; }

  .head-note { display: none; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .result-count { padding: 0; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .toolbar { align-items: stretch; }
  .toolbar .field { flex: 1 1 150px; }
  .field-grow { flex-basis: 100%; }
  .chip { flex: 1 1 auto; align-self: stretch; white-space: nowrap; }

  .ticket {
    grid-template-columns: 88px 1fr;
    grid-template-areas:
      "thumb main"
      "actions actions";
    row-gap: 14px;
    padding: 18px 18px;
  }
  .ticket-stub { display: none; }
  .ticket-index-inline { display: inline; }
  .ticket-thumb { grid-area: thumb; width: 88px; height: 96px; }
  .ticket-main { grid-area: main; }
  .ticket-actions {
    grid-area: actions;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .ticket-actions .btn { padding: 11px 16px; }

  .detail { margin: 0; max-width: none; max-height: 100dvh; width: 100vw; }
  .detail-card {
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
  }

  .foot-line { text-align: left; }
  .foot-grid { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
