/* Second Hand Restoration · site styles
   Brand: Charcoal #2C3539, Jewel Teal #4ECDC4 (accent only), White,
   Paper #EEF0F1, Hairline #DDE2E6, Body Ink #3A4249, Mute #8A9096 (dots/borders only;
   small text uses --mute-dark, which meets WCAG AA 4.5:1 on white and paper) */

:root {
  --charcoal: #2C3539;
  --charcoal-2: #353F44;
  --teal: #4ECDC4;
  --white: #FFFFFF;
  --paper: #EEF0F1;
  --hairline: #DDE2E6;
  --ink: #3A4249;
  --mute: #8A9096;
  --mute-dark: #5F666C;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 6px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--charcoal); margin: 0; line-height: 1.15; }
h2 { font-size: clamp(28px, 4vw, 38px); text-transform: uppercase; letter-spacing: 0.01em; }
h3 { font-size: 20px; font-weight: 500; letter-spacing: 0.01em; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.brand img { width: 34px; height: 34px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; gap: 22px; }
.nav a {
  color: rgba(255,255,255,0.78); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a:focus-visible { color: var(--white); border-bottom-color: var(--teal); outline: none; }

/* Hero */
.hero { background: var(--charcoal); color: rgba(255,255,255,0.86); padding: 56px 0 72px; }
.hero-inner { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: center; }
.hero-logo { width: 100%; height: auto; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
}
.jewel { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(255,255,255,0.9); flex: none; }
.hero h1 { color: var(--white); font-size: clamp(34px, 5.2vw, 56px); text-transform: uppercase; max-width: 14ch; }
.lede { font-size: 18px; max-width: 54ch; margin: 18px 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius);
  font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-light { background: var(--white); color: var(--charcoal); }
.btn-light:hover { background: var(--paper); }
.btn-ghost { color: var(--white); border-color: rgba(255,255,255,0.35); background: transparent; }
.btn-ghost:hover { border-color: var(--white); }
.btn-dark { background: var(--charcoal); color: var(--white); }
.btn-dark:hover { background: var(--charcoal-2); }
.btn-line { background: var(--white); color: var(--charcoal); border-color: var(--hairline); }
.btn-line:hover { border-color: var(--charcoal); }
.btn:focus-visible, .card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 28px; }
.section-head h2 { position: relative; padding-left: 18px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--teal);
}
.section-note { margin: 0; color: var(--mute-dark); }
.loading { color: var(--mute-dark); }
.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; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  text-align: left; padding: 0; font: inherit; color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.section-alt .card { background: var(--paper); }
.card:hover { border-color: #C3CAD0; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(44,53,57,0.08); }
.card-photo { position: relative; aspect-ratio: 4 / 5; background: var(--charcoal); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(255,255,255,0.55); }
.photo-empty img { width: 64px; height: 64px; opacity: 0.85; }
.badge {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.95); color: var(--charcoal); border-radius: 999px; padding: 5px 11px 5px 9px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.photo-tag {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  background: rgba(44,53,57,0.85); color: var(--white);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; text-align: center;
}
.gallery-note { margin: 0; padding: 10px 14px; background: var(--charcoal); color: rgba(255,255,255,0.85); font-size: 13px; border-top: 1px solid rgba(255,255,255,0.15); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.badge-pending .badge-dot { background: #E0B04A; }
.badge-bench .badge-dot { background: var(--mute); }
.badge-sold { background: var(--charcoal); color: var(--white); }
.badge-sold .badge-dot { background: var(--white); }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-id { color: var(--mute-dark); }
.card-title { font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.2; color: var(--charcoal); letter-spacing: 0.01em; }
.card-specs { color: var(--mute-dark); line-height: 1.6; }
.card-text { margin: 0; font-size: 15px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--hairline); }
.price { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--charcoal); }
.more { font-size: 14px; font-weight: 600; color: var(--charcoal); display: inline-flex; align-items: center; gap: 6px; }
.more::after { content: "→"; color: var(--teal); }
.grid-sold .card-photo { aspect-ratio: 1 / 1; }
.grid-sold .card-photo img { filter: grayscale(0.35); opacity: 0.9; }

/* Empty state */
.empty {
  grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: center;
  background: var(--charcoal); color: rgba(255,255,255,0.85); border-radius: var(--radius); padding: 36px;
}
.empty img { width: 120px; height: 120px; }
.empty h3 { color: var(--white); font-size: 26px; font-weight: 700; text-transform: uppercase; }
.empty p { margin: 8px 0 20px; max-width: 58ch; }
.empty .hero-actions { gap: 10px; }

/* How to buy */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.steps li { background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 22px; }
.step-num { display: block; color: var(--mute-dark); margin-bottom: 14px; }
.steps h3 { margin-bottom: 8px; }
.steps p { margin: 0; font-size: 15px; }
.fine { margin: 26px 0 0; max-width: 72ch; font-size: 15px; color: var(--ink); }
.fine strong { color: var(--charcoal); }

/* About */
.section-dark { background: var(--charcoal); color: rgba(255,255,255,0.84); }
.section-dark h2 { color: var(--white); margin-bottom: 16px; }
.about { display: grid; grid-template-columns: 140px 1fr; gap: 40px; align-items: start; max-width: 860px; }
.about p { margin: 0 0 14px; font-size: 17px; }
.about-mark { width: 120px; height: 120px; }
.about-sig { color: rgba(255,255,255,0.55); margin-top: 22px !important; }

/* Footer */
.footer { background: #252D30; color: rgba(255,255,255,0.7); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-name { margin: 0; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--white); }
.footer-meta { margin: 4px 0 0; color: rgba(255,255,255,0.5); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--teal); padding-bottom: 2px; }
.footer-links a:hover { color: var(--white); }

/* Detail panel */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28,34,37,0.72); }
.modal-panel {
  position: relative; background: var(--white); border-radius: 8px; width: 100%; max-width: 1000px;
  max-height: calc(100vh - 48px); overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.modal-close-bar { position: sticky; top: 0; height: 0; z-index: 3; display: flex; justify-content: flex-end; }
.modal-close {
  margin: 10px 10px 0 0; flex: none;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--white); color: var(--charcoal); font-size: 24px; line-height: 1; cursor: pointer;
}
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; }
.gallery { background: var(--charcoal); }
.gallery-main { aspect-ratio: 4 / 5; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: var(--charcoal); }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.9); color: var(--charcoal); font-size: 20px; cursor: pointer;
}
.gallery-prev { left: 12px; } .gallery-next { right: 12px; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: none; opacity: 0.65; }
.thumbs button[aria-current="true"] { border-color: var(--teal); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 32px 30px 30px; display: flex; flex-direction: column; gap: 14px; }
.detail-info h2 { font-size: 30px; text-transform: none; padding-right: 30px; }
.detail-price { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--charcoal); }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 8px 0; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.spec-table th { width: 40%; font: 500 11px/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute-dark); padding-right: 12px; }
.spec-table td { font: 400 14px/1.5 var(--mono); color: var(--charcoal); }
.detail-block h3 { font-size: 13px; font-family: var(--mono); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute-dark); margin-bottom: 6px; }
.detail-block p { margin: 0; white-space: pre-line; }
.buy-box { background: var(--paper); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.buy-box p { margin: 0; font-size: 14px; }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.buy-actions .btn { flex: 1 1 auto; }
.copy-link { background: none; border: 0; padding: 0; font: 500 13px var(--body); color: var(--mute-dark); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }
body.modal-open { overflow: hidden; }

/* Responsive */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .hero { padding: 36px 0 48px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-logo { width: 150px; }
  .section { padding: 52px 0; }
  .empty { grid-template-columns: 1fr; padding: 28px 22px; gap: 18px; }
  .empty img { width: 72px; height: 72px; }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .about-mark { width: 72px; height: 72px; }
  .modal { padding: 0; align-items: stretch; }
  .modal-panel { max-height: 100vh; border-radius: 0; }
  .detail-info { padding: 22px 18px 28px; }
}
@media (max-width: 560px) {
  .grid, .steps { grid-template-columns: 1fr; }
  .grid-sold { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-sold .card-body { padding: 12px; }
  .grid-sold .card-title { font-size: 17px; }
  .brand span { font-size: 15px; }
  .lede { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}

.badge-inline { position: static; border: 1px solid var(--hairline); }
.demo-flag { background: #E0B04A; color: var(--charcoal); text-align: center; padding: 6px 12px; }
.gallery-main .photo-empty img { width: 96px; height: 96px; object-fit: contain; }

/* Reviews (hidden unless at least one review is set to Show) */
.section-reviews { border-top: 1px solid var(--hairline); }
.grid-reviews { align-items: start; }
.review { background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.review-photo { aspect-ratio: 4 / 5; background: var(--charcoal); overflow: hidden; }
.review-photo img { width: 100%; height: 100%; object-fit: cover; }
.review-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.review-watch { color: var(--mute-dark); }
.review-quote { margin: 0; padding-left: 14px; border-left: 2px solid var(--teal); font-size: 16px; line-height: 1.6; color: var(--charcoal); white-space: pre-line; }
.review-meta { margin: 0; color: var(--mute-dark); }
.review-links { display: flex; flex-wrap: wrap; gap: 16px; }
.review-link { font-size: 14px; font-weight: 600; color: var(--charcoal); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.review-link::after { content: "→"; color: var(--teal); }
.review-link:hover { text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; }

/* Loading placeholders (replaced as soon as the inventory loads) */
.skeleton { cursor: default; pointer-events: none; }
.skeleton .card-photo { background: var(--hairline); }
.sk-line { display: block; height: 12px; border-radius: 3px; background: var(--hairline); }
.sk-short { width: 30%; }
.sk-mid { width: 60%; }
.skeleton .card-photo, .sk-line { animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .skeleton .card-photo, .sk-line { animation: none; } }

/* FAQ */
.faq { max-width: 780px; border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-family: var(--display); font-weight: 500; font-size: 19px; color: var(--charcoal); letter-spacing: 0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 24px/1 var(--body); color: var(--teal); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.faq details p { margin: 0 0 20px; max-width: 68ch; font-size: 15px; }

/* Sticky buy bar in the detail panel, phones only */
.sticky-buy { display: none; }
@media (max-width: 720px) {
  .sticky-buy {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    position: sticky; bottom: 0; z-index: 3;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--hairline); box-shadow: 0 -6px 18px rgba(44,53,57,0.08);
  }
  .sticky-price { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--charcoal); }
  .sticky-buy .btn { flex: 1 1 auto; max-width: 240px; }
}

/* Footer links wrap on small screens */
.footer-links { flex-wrap: wrap; }

/* Simple pages: Terms, Privacy, 404 */
.page { padding: 56px 0 72px; }
.page .wrap { max-width: 780px; }
.page h1 { font-size: clamp(32px, 5vw, 44px); text-transform: uppercase; margin-bottom: 8px; }
.page h2 { font-size: 22px; text-transform: uppercase; margin: 36px 0 10px; }
.page p, .page li { font-size: 16px; max-width: 70ch; }
.page ul { padding-left: 20px; }
.page a { text-decoration-color: var(--teal); text-underline-offset: 3px; }
.page-meta { color: var(--mute-dark); margin: 0 0 28px; }
.notfound { min-height: 60vh; display: flex; align-items: center; background: var(--charcoal); color: rgba(255,255,255,0.85); }
.notfound .wrap { display: grid; grid-template-columns: 120px 1fr; gap: 32px; align-items: center; }
.notfound h1 { color: var(--white); }
.notfound p { margin: 8px 0 22px; }
@media (max-width: 560px) { .notfound .wrap { grid-template-columns: 1fr; gap: 18px; } .notfound img { width: 72px; height: 72px; } }
