/* SAFREZA apparel (light theme)
   Palette locked to brand spec: Ink #1C1A17, Camel #B58B5A, Bone #EFE8DD.
   Other tones are those three at reduced opacity, no new hues. */

:root {
  --ink: #1C1A17;
  --camel: #B58B5A;
  --bone: #EFE8DD;

  --bg: var(--bone);
  --text: var(--ink);
  --text-muted: rgba(28, 26, 23, 0.7);
  --line: rgba(28, 26, 23, 0.12);
  --line-strong: rgba(28, 26, 23, 0.28);
  --raise: rgba(28, 26, 23, 0.035);
  --tile: rgba(28, 26, 23, 0.06);

  --font: "Saira", system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.125rem; letter-spacing: 0; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bone); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 880px; }
.section { padding-block: clamp(var(--s8), 10vw, var(--s10)); }

.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--camel); color: var(--ink); padding: var(--s2) var(--s4);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: var(--s4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  font: 500 15px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; border-radius: 0;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn .ph { font-size: 18px; }
.btn-primary { background: var(--camel); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: 14px; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--ink); color: var(--bone); }
  .btn-ghost:hover { border-color: var(--ink); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: var(--s6); height: 72px; }
.nav-logo { display: block; padding-block: var(--s2); }
.nav-logo img { width: 141px; height: auto; }
.nav-links { display: flex; gap: var(--s6); margin-left: auto; }
.nav-links a {
  font-size: 15px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; color: var(--text-muted);
  transition: color 200ms ease;
}
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner .btn { margin-left: auto; }
  .nav-logo img { width: 124px; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(var(--s7), 7vw, var(--s9)); }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(var(--s7), 6vw, var(--s9));
  align-items: center; min-height: calc(100dvh - 72px - 160px);
}
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); line-height: 1.02; max-width: 14ch; }
.hero-sub { margin-top: var(--s5); font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--text-muted); max-width: 42ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }

.hero-visual {
  position: relative; aspect-ratio: 4 / 5;
  background: var(--tile);
  display: grid; place-items: center;
  overflow: hidden;
}

/* ---------- Hangtag (signature object) ---------- */
.tag {
  position: relative;
  width: min(46%, 240px); aspect-ratio: 50 / 90;
  background: var(--ink); color: var(--bone);
  padding: 22% 10% 10%;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.18), 0 18px 40px -12px rgba(28, 26, 23, 0.45);
}
.tag-hole {
  position: absolute; top: 7%; left: 50%; translate: -50% 0;
  width: 9%; aspect-ratio: 1; border-radius: 50%;
  background: var(--bone); box-shadow: inset 0 0 0 2px var(--camel);
}
.tag-front { justify-content: center; align-items: center; padding-top: 10%; }
.tag-front img { width: 78%; }
.tag-brand { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--camel); }
.tag-brand span { font-weight: 400; letter-spacing: 0.04em; text-transform: lowercase; }
.tag-model { margin-top: var(--s3); font-size: 15px; font-weight: 600; line-height: 1.2; }
.tag-spec { margin-top: var(--s3); display: grid; gap: var(--s2); font-size: 11px; line-height: 1.3; }
.tag-spec dt { color: var(--camel); letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.tag-spec dd { margin: 0; color: var(--bone); }
.tag-care { margin-top: auto; font-size: 10px; line-height: 1.4; color: rgba(239, 232, 221, 0.6); }

.hero-visual .tag-back { position: absolute; left: 8%; top: 9%; rotate: -6deg; }
.hero-visual .tag-front { position: absolute; right: 8%; bottom: 8%; rotate: 5deg; }
.hero-visual .tag { transition: rotate 600ms var(--ease-out), translate 600ms var(--ease-out); }
@media (hover: hover) {
  .hero-visual:hover .tag-back { rotate: -9deg; translate: -6px -4px; }
  .hero-visual:hover .tag-front { rotate: 8deg; translate: 6px 4px; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { aspect-ratio: 5 / 4; }
  .hero-visual .tag { width: min(34%, 200px); }
  .hero-visual .tag-back { left: 16%; top: 9%; }
  .hero-visual .tag-front { right: 16%; bottom: 9%; }
}
@media (max-width: 480px) {
  .hero-visual { aspect-ratio: 1; }
  .hero-visual .tag { width: 42%; }
  .tag-brand, .tag-spec, .tag-care { font-size: 9px; }
  .tag-spec dt { font-size: 8px; }
  .tag-model { font-size: 12px; margin-top: var(--s2); }
  .hero-visual .tag-back .tag-care { display: none; }
}

/* ---------- Signature stitch: one line, one gap ---------- */
.stitch {
  position: relative; height: 2px; margin-top: clamp(var(--s7), 7vw, var(--s9));
  display: grid; grid-template-columns: 1fr 40px 1fr;
}
.stitch::before, .stitch::after {
  content: ""; height: 2px;
  background: repeating-linear-gradient(90deg, var(--camel) 0 10px, transparent 10px 16px);
  transition: transform 1200ms var(--ease-reveal);
}
.stitch::before { grid-column: 1; transform-origin: right; }
.stitch::after { grid-column: 3; transform-origin: left; }
.js .stitch:not(.is-in)::before, .js .stitch:not(.is-in)::after { transform: scaleX(0); }

/* ---------- Catalog ---------- */
.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--s3);
}
.catalog-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--s5); margin-bottom: var(--s7);
}
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4);
  font: 500 14px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 0; cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip:hover { color: var(--text); border-color: var(--text-muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.chip-count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.7; text-transform: none; letter-spacing: 0; }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s7) var(--s5);
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; gap: var(--s7); } }

.card { display: block; text-decoration: none; color: inherit; animation: card-in 500ms var(--ease-reveal) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
.card-media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--tile);
  display: grid; place-items: center;
}
.card-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.card-media .tag { width: 46%; transition: rotate 500ms var(--ease-out); rotate: -3deg; }
@media (hover: hover) {
  .card:hover .card-media > img { transform: scale(1.03); }
  .card:hover .card-media .tag { rotate: 2deg; }
}
.badge {
  position: absolute; top: var(--s4); left: var(--s4);
  background: var(--ink); color: var(--camel);
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: var(--s1) var(--s3);
}
.card-body { padding-top: var(--s4); }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); }
.card-name { font-size: 1.1875rem; }
.card-price { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-meta, .card-colors { font-size: 15px; color: var(--text-muted); }
.card-meta { margin-top: var(--s1); }
.card-cta {
  display: inline-flex; align-items: center; gap: var(--s1);
  margin-top: var(--s3);
  font-size: 14px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text);
  padding-bottom: 3px;
  background: linear-gradient(var(--camel), var(--camel)) left bottom / 0 2px no-repeat;
  transition: background-size 300ms var(--ease-out);
}
.card:hover .card-cta, .card:focus-visible .card-cta { background-size: 100% 2px; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--s3); padding: var(--s9) var(--s5);
  border: 1px solid var(--line);
}
.empty-title { font-size: 1.375rem; font-weight: 600; margin-top: var(--s3); }
.empty-body { color: var(--text-muted); max-width: 44ch; }
.empty-body a { color: var(--text); text-decoration-color: var(--camel); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.empty .btn { margin-top: var(--s3); }
.note { margin-top: var(--s7); font-size: 14px; color: var(--text-muted); }

/* ---------- Detail bento ---------- */
#detail h2 { max-width: 18ch; margin-bottom: var(--s7); }
.bento {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "patch patch patch patch button button"
    "patch patch patch patch label label"
    "stitch stitch stitch stitch stitch stitch";
}
.cell {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6);
  padding: clamp(var(--s5), 3vw, var(--s6));
  background: var(--raise); border: 1px solid var(--line);
}
.cell-text p { margin-top: var(--s2); color: var(--text-muted); font-size: 15px; max-width: 48ch; }
.cell-patch { grid-area: patch; background: var(--camel); border-color: var(--camel); color: var(--ink); }
.cell-patch .cell-text p { color: var(--ink); }
.cell-button { grid-area: button; }
.cell-label { grid-area: label; }
.cell-stitch { grid-area: stitch; flex-direction: row; align-items: center; }
.cell-stitch .cell-text { flex: 1; }

.patch {
  flex: 1; display: grid; place-items: center;
  min-height: 220px;
}
.patch img {
  width: min(70%, 360px);
  padding: 7% 9%;
  border: 1px solid rgba(28, 26, 23, 0.35);
  outline: 1px dashed rgba(28, 26, 23, 0.35); outline-offset: -8px;
  box-sizing: content-box;
  filter: drop-shadow(0 1px 0 rgba(239, 232, 221, 0.35));
  opacity: 0.88;
}
.rivet img { width: 88px; height: 88px; border-radius: 50%; }
.rivet img { clip-path: circle(50%); }
.woven {
  align-self: flex-start;
  background: var(--ink);
  padding: var(--s3) var(--s5);
}
.woven img { width: 120px; }

.stitch-demo {
  flex: 0 0 auto; width: min(40%, 360px);
  display: grid; grid-template-columns: 1fr 28px 1fr;
}
.stitch-demo span { height: 2px; background: repeating-linear-gradient(90deg, var(--camel) 0 10px, transparent 10px 16px); }
.stitch-demo span:last-child { grid-column: 3; }

@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "patch patch" "button label" "stitch stitch";
  }
  .cell-stitch { flex-direction: column; align-items: stretch; }
  .stitch-demo { width: 100%; }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; grid-template-areas: "patch" "button" "label" "stitch"; }
  .patch { min-height: 160px; }
}

/* ---------- Sizes ---------- */
.lead { margin-top: var(--s4); color: var(--text-muted); max-width: 60ch; }
.table-wrap { margin-top: var(--s7); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sizes { width: 100%; min-width: 560px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sizes th, .sizes td { text-align: left; padding: var(--s4) var(--s3); }
.sizes thead th {
  font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--line-strong);
}
.sizes tbody th { font-weight: 600; font-size: 1.125rem; }
.sizes tbody tr + tr { border-top: 1px solid var(--line); }
.sizes td { color: var(--text-muted); }
.sizes tbody tr:hover td { color: var(--text); }

.care {
  list-style: none; padding: 0; margin-top: var(--s7);
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6);
  font-size: 15px; color: var(--text-muted);
}
.care li { display: flex; align-items: center; gap: var(--s2); }
.care .ph { color: var(--camel); font-size: 20px; }

/* ---------- CTA ---------- */
.cta { border-top: 1px solid var(--line); }
.cta-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cta-mark { width: 64px; height: 64px; margin-bottom: var(--s6); }
.cta h2 { max-width: 16ch; }
.cta p { margin-top: var(--s4); margin-bottom: var(--s6); color: var(--text-muted); max-width: 46ch; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: var(--s7); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5) var(--s7); }
.footer-links { display: flex; gap: var(--s5); }
.footer-links a { font-size: 15px; color: var(--text-muted); text-decoration: none; transition: color 200ms ease; }
.footer-links a:hover { color: var(--text); }
.footer-copy { margin-left: auto; font-size: 14px; color: var(--text-muted); }
@media (max-width: 560px) { .footer-inner { flex-direction: column; align-items: flex-start; } .footer-copy { margin-left: 0; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease-reveal), transform 700ms var(--ease-reveal); }
.js .reveal.is-in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: 60ms; }
.hero .reveal:nth-child(3) { transition-delay: 120ms; }
.hero-visual.reveal { transition-delay: 100ms; }
.bento .reveal:nth-child(2) { transition-delay: 60ms; }
.bento .reveal:nth-child(3) { transition-delay: 120ms; }
.bento .reveal:nth-child(4) { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .stitch:not(.is-in)::before, .js .stitch:not(.is-in)::after { transform: none; }
}
