/* ------------------------------------------------------------------
   Forma — design system
   Style: warm artisan editorial (Minimalism/Swiss bones, craft warmth)
   Palette: terracotta #9A3412 on cream, warm near-black ink
   Type: Fraunces (display serif) + Nunito Sans (UI/body)
-------------------------------------------------------------------*/

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.3--ui-ux-pro-max--2026-09-17T06-15-22-146Z/assets/fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.3--ui-ux-pro-max--2026-09-17T06-15-22-146Z/assets/fonts/fraunces-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.3--ui-ux-pro-max--2026-09-17T06-15-22-146Z/assets/fonts/nunito-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/artifacts/forma-frontend--v1--s1--glm-5.3--ui-ux-pro-max--2026-09-17T06-15-22-146Z/assets/fonts/nunito-sans-italic-latin.woff2') format('woff2');
}

:root {
  --paper: #faf5ec;
  --surface: #fffdf8;
  --ink: #2b2118;
  --ink-soft: #655648;
  --terracotta: #9a3412;
  --terracotta-deep: #7c2d0e;
  --terracotta-tint: #f6e3d5;
  --border: #e6dac6;
  --border-strong: #d5c3a8;
  --shadow-sm: 0 1px 2px rgba(43, 33, 24, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(43, 33, 24, 0.25);
  --shadow-lg: 0 30px 70px -20px rgba(26, 16, 8, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Nunito Sans', -apple-system, 'Segoe UI', sans-serif;
}

/* Category chip tints (text on tint ≥ 4.5:1) */
:root {
  --chip-Baking-bg: #f7ecd5;    --chip-Baking-tx: #74480c;
  --chip-Ceramics-bg: #f5e3d3;  --chip-Ceramics-tx: #8a3b12;
  --chip-Floristry-bg: #e4efe1; --chip-Floristry-tx: #2f5b3b;
  --chip-Painting-bg: #e7e9f6;  --chip-Painting-tx: #3d3f8f;
}

* { box-sizing: border-box; }

/* Explicit display values must not defeat the hidden attribute */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: 16px;
  z-index: 100;
  background: var(--terracotta);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  text-decoration: none;
  transition: top 150ms ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Inside the dialog, the ring must read on both the photo header and the light body:
   light ring + white halo against dark, terracotta against light. */
.detail-root :focus-visible {
  outline: 3px solid #ff9e5e;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.6);
}

::selection { background: var(--terracotta-tint); color: var(--terracotta-deep); }

/* ---------- Header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 30;
}
.site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--terracotta);
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark .dot { color: var(--terracotta); }

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: clamp(420px, 58vh, 620px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(24, 14, 6, 0.86) 0%,
    rgba(24, 14, 6, 0.45) 55%,
    rgba(24, 14, 6, 0.25) 100%
  );
}
.hero-content {
  padding-top: 72px;
  padding-bottom: 72px;
  color: #f7efe2;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ecc9a8;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1.05;
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: -0.015em;
}
.hero-sub {
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  margin: 0 0 30px;
  color: #f0e4d2;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent;
  color: var(--terracotta-deep);
  border: 2px solid var(--terracotta);
}
.btn-secondary:hover { background: var(--terracotta-tint); }
.btn-lg { font-size: 17px; padding: 15px 28px; }

/* ---------- Main / section head ---------- */

.main { padding-top: 64px; padding-bottom: 88px; }

.section-head { margin-bottom: 28px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.section-note { margin: 0; color: var(--ink-soft); }

/* ---------- Controls bar ---------- */

.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  grid-template-areas:
    "search category saved"
    "count count count";
  gap: 12px 16px;
  align-items: end;
  padding: 16px;
  margin: 0 0 36px;
  background: rgba(250, 245, 236, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field-search { grid-area: search; position: relative; }
.field-category { grid-area: category; }
.field-saved { grid-area: saved; }
.result-count {
  grid-area: count;
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-search input,
.field-category select {
  width: 100%;
  height: 46px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field-search input { padding-left: 42px; }
.field-search input::placeholder { color: #7d6a55; font-weight: 500; }
.field-search input:focus,
.field-category select:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(154, 52, 18, 0.16);
  outline: none;
}
.input-icon {
  position: absolute;
  left: 14px; bottom: 13px;
  color: var(--ink-soft);
  pointer-events: none;
}

.field-category select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23655648' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--terracotta-deep);
  background: var(--surface);
  border: 2px solid var(--terracotta);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.saved-toggle:hover { background: var(--terracotta-tint); }
.saved-toggle[aria-pressed="true"] {
  background: var(--terracotta);
  color: #fff;
}
.saved-toggle .icon-heart { flex: none; }
.saved-toggle[aria-pressed="false"] .icon-heart path { fill: none; }
.saved-toggle[aria-pressed="true"] .icon-heart path { fill: #fff; }
.saved-count {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--terracotta-tint);
  color: var(--terracotta-deep);
}
.saved-toggle[aria-pressed="true"] .saved-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---------- Grid & cards ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  scroll-margin-top: 150px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--terracotta-tint);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--chip-Painting-bg);
  color: var(--chip-Painting-tx);
}
.chip-Baking { background: var(--chip-Baking-bg); color: var(--chip-Baking-tx); }
.chip-Ceramics { background: var(--chip-Ceramics-bg); color: var(--chip-Ceramics-tx); }
.chip-Floristry { background: var(--chip-Floristry-bg); color: var(--chip-Floristry-tx); }
.chip-Painting { background: var(--chip-Painting-bg); color: var(--chip-Painting-tx); }
.card-media .chip {
  position: absolute;
  left: 12px; bottom: 12px;
  box-shadow: 0 2px 8px rgba(20, 10, 4, 0.28);
  backdrop-filter: blur(4px);
}

.card-badge {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--terracotta);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(20, 10, 4, 0.35);
}
.card-badge svg { fill: #fff; }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 20px;
}
.card-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.005em;
}
.card-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.card-meta strong { color: var(--ink); font-weight: 800; }

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.card-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.card-price span { font-size: 13px; font-family: var(--font-body); color: var(--ink-soft); font-weight: 600; }

.open-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  color: var(--terracotta-deep);
  background: transparent;
  border: none;
  padding: 8px 10px;
  margin: -8px -10px -8px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: gap 180ms ease, color 180ms ease;
}
.open-item-btn svg { transition: transform 180ms ease; }
.open-item-btn:hover { color: var(--terracotta); }
.open-item-btn:hover svg { transform: translateX(3px); }

/* ---------- Empty state ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 64px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.6);
}
.empty svg { color: var(--border-strong); margin-bottom: 8px; }
.empty h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.empty p { margin: 0 0 14px; max-width: 44ch; }

/* ---------- Footer ---------- */

.site-footer {
  background: #241a12;
  color: #e9dcc8;
  padding: 44px 0;
}
.footer-inner { display: flex; gap: 32px; align-items: baseline; flex-wrap: wrap; }
.footer-word {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}
.footer-word .dot { color: #e07a4a; }
.footer-note {
  margin: 0;
  flex: 1;
  min-width: 280px;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.65;
  color: #cfc0aa;
}

/* ---------- Detail dialog ---------- */

.detail-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 13, 6, 0.6);
  animation: fadeIn 200ms ease both;
}

.dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: dialogIn 240ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.detail-hero { position: relative; }
.detail-hero img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 14, 6, 0.35), transparent 55%);
  pointer-events: none;
}

.close-detail-btn {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: rgba(24, 14, 6, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color 180ms ease, transform 180ms ease;
}
.close-detail-btn:hover { background: rgba(24, 14, 6, 0.8); transform: scale(1.05); }

.detail-body { padding: 28px clamp(20px, 4vw, 40px) 36px; }
.detail-body .chip { margin-bottom: 16px; }
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.detail-desc {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 60ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 28px;
  list-style: none;
  padding: 0;
}
.fact {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.fact dt {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 3px;
}
.fact dd {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.fact .fact-price { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

.save-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid var(--terracotta);
  color: var(--terracotta-deep);
  background: transparent;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}
.save-item-btn:hover { background: var(--terracotta-tint); }
.save-item-btn[aria-pressed="true"] {
  background: var(--terracotta);
  color: #fff;
}
.save-item-btn[aria-pressed="true"]:hover { background: var(--terracotta-deep); }
.save-item-btn .icon-heart { flex: none; }
.save-item-btn[aria-pressed="false"] .icon-heart path { fill: none; }
.save-item-btn[aria-pressed="true"] .icon-heart path { fill: #fff; }
.save-item-btn[aria-pressed="true"] .icon-heart { animation: heartPop 240ms ease; }

/* ---------- Animations ---------- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heartPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@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;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .container { padding: 0 18px; }
  .masthead { padding-top: 14px; padding-bottom: 14px; }
  .wordmark { font-size: 26px; }
  .tagline { font-size: 13px; }

  .hero { min-height: 66vh; }
  .hero-content { padding-top: 56px; padding-bottom: 48px; }

  .main { padding-top: 44px; padding-bottom: 64px; }

  .controls {
    position: static;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "search search"
      "category saved"
      "count count";
    margin-bottom: 28px;
  }
  .saved-toggle { width: 100%; justify-content: center; }

  .grid { grid-template-columns: 1fr; gap: 20px; }

  .facts { grid-template-columns: repeat(2, 1fr); }

  .detail-root { padding: 0; }
  .dialog {
    width: 100%;
    max-height: none;
    height: 100dvh;
    border-radius: 0;
  }
  .detail-hero img { aspect-ratio: auto; height: 36vh; }
  .detail-body { padding: 22px 20px 32px; }
}
