/* ReDress public landing — token values copied verbatim from
   apps/mobile/lib/theme.ts (COLORS) so this static site stays visually
   identical to the app rather than inventing a parallel palette. */
:root {
  --redress-primary-soft: #BFDCE8;
  --redress-primary-surface: #EEF6F9;
  --redress-primary-mist: #F6FAFC;
  --redress-primary-deep: #315F70;
  --redress-primary-darker: #244C5A;
  --redress-accent: #C6AF73;

  --redress-background: #FFFFFF;
  --redress-foreground: #1F1F1F;
  --redress-muted: #77736B;
  --redress-border: rgba(49, 95, 112, 0.12);

  --redress-max-width: 960px;
  --redress-radius-lg: 20px;
  --redress-radius-full: 999px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--redress-background);
  color: var(--redress-foreground);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Latin brand name stays LTR and visually intact inside RTL sentences —
   mirrors LogoWordmark's writingDirection:'ltr' choice in the mobile app. */
bdi.redress-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--redress-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  background: var(--redress-primary-deep);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--redress-radius-full);
  transition: top 0.15s ease;
  z-index: 20;
}
.skip-link:focus {
  top: 1rem;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
/* Phase 17.1 preview pages wrap the brand SVG in a <span> (a standalone
   function response can't <use> index.html's <symbol>) — same sizing. */
span.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-word {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--redress-primary-darker);
}
.brand-word .brand-re {
  color: #AAA090;
}

/* ── Hero (home view) ──────────────────────────────────────────────── */

.hero {
  background: linear-gradient(180deg, var(--redress-primary-surface) 0%, var(--redress-primary-mist) 55%, var(--redress-background) 100%);
  padding: 2.5rem 1.5rem 4rem;
  text-align: center;
}

.hero-inner {
  max-width: var(--redress-max-width);
  margin: 0 auto;
}

.hero-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.75rem;
}

.hero-headline {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--redress-primary-darker);
  margin: 0 0 0.9rem;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--redress-muted);
  max-width: 34ch;
  margin: 0 auto 2.25rem;
}

/* ── CTA button ─────────────────────────────────────────────────────── */

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--redress-primary-deep);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.95rem 2.1rem;
  border-radius: var(--redress-radius-full);
  box-shadow: 0 8px 24px rgba(49, 95, 112, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cta-button:hover {
  background: var(--redress-primary-darker);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(49, 95, 112, 0.32);
}
.cta-button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cta-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--redress-muted);
}

/* ── Three-column "who it's for" row ───────────────────────────────── */

.value-row {
  max-width: var(--redress-max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .value-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-bottom: 3.5rem;
  }
}

.value-card {
  background: var(--redress-primary-mist);
  border: 1px solid var(--redress-border);
  border-radius: var(--redress-radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.value-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.9rem;
  color: var(--redress-primary-deep);
}

.value-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  color: var(--redress-primary-darker);
}

.value-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--redress-muted);
}

/* ── Generic fallback card (dress / store / not-found views) ──────── */

.fallback {
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, var(--redress-primary-surface) 0%, var(--redress-background) 65%);
}

.fallback-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: #fff;
  border: 1px solid var(--redress-border);
  border-radius: var(--redress-radius-lg);
  padding: 2.75rem 2rem;
  box-shadow: 0 18px 48px rgba(36, 76, 90, 0.08);
}

.fallback-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
}

.fallback-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--redress-primary-darker);
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

.fallback-desc {
  color: var(--redress-muted);
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
}

.fallback-links {
  margin-top: 1.25rem;
  font-size: 0.92rem;
}

/* ── Dress/store preview pages (Phase 17.1A) ─────────────────────────
   Direct translation of app/dress/[id].tsx + components/DressCard.tsx +
   app/store-profile.tsx's own design tokens — see the Phase 17.1A design
   audit for the exact source values. Extra tokens beyond the :root block
   above, matching lib/theme.ts's COLORS object precisely (this static
   site's :root only ever defined a subset before this phase). */
:root {
  --redress-primary-mist-2: #F6FAFC;
  --redress-condition-gold: #B49355;
  --redress-secondary-bg: #F6FAFC;
}

/* Compact header — Phase 17.1A section 6: mobile vertical space is
   valuable, this is a persistent app-style top bar, not a marketing
   hero logo lockup. Sticky so it reads as a real app chrome bar while
   scrolling a tall listing. */
.preview-body {
  background: var(--redress-secondary-bg);
}

.preview-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--redress-border);
}

.brand-compact {
  gap: 0.5rem;
}
.brand-mark-compact {
  width: 26px;
  height: 26px;
}
.brand-word-compact {
  font-size: 1rem;
}

.preview-main {
  display: flex;
  justify-content: center;
  padding: 0 0 2.5rem;
}

.preview-footer {
  padding: 1.75rem 1.5rem 2.5rem;
  text-align: center;
  color: var(--redress-muted);
  font-size: 0.82rem;
}
.preview-footer p {
  margin: 0;
}

/* ── Dress listing (section 2/3/4/7) ─────────────────────────────────
   Hero image first and dominant (product before marketing), then an
   overlapping rounded "sheet" — same visual grammar as the app's own
   Dress Detail screen (hero image behind a pulled-up rounded content
   sheet with a grabber handle), not a generic card-below-hero layout. */
.listing {
  width: 100%;
  max-width: 480px;
}

.listing-hero {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--redress-primary-mist-2);
  overflow: hidden;
}
.listing-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-hero-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-hero-mark {
  width: 72px;
  height: 72px;
  opacity: 0.35;
}

.listing-sheet {
  position: relative;
  margin-top: -22px;
  background: #fff;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  padding: 1.1rem 1.35rem 1.5rem;
  box-shadow: 0 -4px 14px rgba(36, 76, 90, 0.05);
}

.listing-sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--redress-border);
  margin: 0 auto 1.1rem;
}

.listing-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--redress-primary-deep);
  background: var(--redress-primary-surface);
  border: 1px solid var(--redress-primary-soft);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: 0.6rem;
}

.listing-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--redress-foreground);
  margin: 0 0 0.55rem;
  text-wrap: balance;
}

.listing-price-row {
  display: flex;
  align-items: baseline;
}
.listing-price {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--redress-primary-deep);
}
.listing-price-underline {
  width: 42px;
  height: 2px;
  border-radius: 1px;
  background: var(--redress-accent);
  margin: 0.4rem 0 1.1rem;
}

.listing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Badge — direct match to app/dress/[id].tsx's own Badge component:
   full pill, 13px/8px padding, 12.5px medium text, two variants. */
.rd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--redress-border);
  background: #fff;
  color: var(--redress-foreground);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  line-height: 1;
}
.rd-badge-accent {
  background: var(--redress-primary-surface);
  border-color: var(--redress-primary-soft);
  color: var(--redress-primary-deep);
}
.rd-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── CTA hierarchy (section 7) — primary "open app" solid teal, exactly
   the app's own CTA button (bg #244C5A / rounded-2xl), secondary
   download link is text-weight, never competing with the primary. ──── */
.cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--redress-primary-darker);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.25rem;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(36, 76, 90, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(36, 76, 90, 0.24);
}
.cta-primary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cta-secondary {
  display: block;
  text-align: center;
  color: var(--redress-muted);
  text-decoration: none;
  font-size: 0.82rem;
  margin-top: 0.85rem;
}
.cta-secondary bdi.redress-name {
  color: var(--redress-primary-deep);
}
.cta-secondary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cta-secondary-standalone {
  margin-top: 1.25rem;
}

/* ── Store profile page (section 10/11) — cover + overlapping circular
   logo, same overlap pattern as app/store-profile.tsx's own header. ── */
.store-listing {
  width: 100%;
  max-width: 480px;
}

.store-cover {
  width: 100%;
  height: 180px;
  background: #F3EBD8;
  overflow: hidden;
}
.store-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.store-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-cover-mark {
  width: 56px;
  height: 56px;
  opacity: 0.4;
}

.store-sheet {
  position: relative;
  background: #fff;
  padding: 0 1.35rem 1.75rem;
}

.store-logo {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: var(--redress-primary-deep);
  box-shadow: 0 4px 12px rgba(49, 95, 112, 0.18);
  margin-top: -36px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.store-logo-fallback {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
}

.store-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--redress-foreground);
  margin: 0 0 0.15rem;
  text-wrap: balance;
}

.store-category {
  font-size: 0.82rem;
  color: var(--redress-muted);
  margin: 0 0 0.75rem;
}

.store-badges {
  margin-bottom: 1.1rem;
}

.store-description {
  color: var(--redress-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1.35rem;
}

/* ── Not-found state (section 12) — same premium shell, never a raw
   generic error page. ─────────────────────────────────────────────── */
.notfound-wrap {
  width: 100%;
  max-width: 420px;
  padding: 3.5rem 1.25rem 0;
}

.notfound-card {
  text-align: center;
  background: #fff;
  border: 1px solid var(--redress-border);
  border-radius: var(--redress-radius-lg);
  padding: 2.5rem 1.75rem;
  box-shadow: 0 18px 48px rgba(36, 76, 90, 0.08);
}

.notfound-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--redress-primary-darker);
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.notfound-body {
  color: var(--redress-muted);
  font-size: 0.92rem;
  margin: 0;
}

.notfound-back {
  margin-top: 1.1rem;
  font-size: 0.85rem;
}
.notfound-back a {
  color: var(--redress-primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Desktop (section 9) — restrained centered layout, never a
   stretched phone page or a full marketing homepage. ────────────────── */
@media (min-width: 640px) {
  .preview-main {
    padding-top: 2rem;
  }
  .listing,
  .store-listing {
    max-width: 720px;
    display: grid;
    grid-template-columns: minmax(0, 320px) 1fr;
    gap: 0;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(36, 76, 90, 0.08);
    border: 1px solid var(--redress-border);
  }
  .listing-hero {
    aspect-ratio: auto;
    height: 100%;
  }
  .listing-sheet {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 1.75rem 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .listing-sheet-grabber {
    display: none;
  }
  .store-cover {
    height: 100%;
    aspect-ratio: auto;
  }
  .store-sheet {
    padding: 1.75rem 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .store-logo {
    margin-top: 0;
  }
}

.fallback-links a {
  color: var(--redress-primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  color: var(--redress-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--redress-border);
}

.site-footer a {
  color: var(--redress-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer p {
  margin: 0.3rem 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Delete-account / data-deletion doc page ─────────────────────────
   Long-form Hebrew RTL policy content — same header/footer/token
   language as the rest of the site (compact sticky header, warm ivory
   base, teal headings, gold accent rule), but a plain readable article
   layout rather than a card, since this page is meant to be read and
   referenced, not glanced at like a preview card. */
.doc-main {
  display: flex;
  justify-content: center;
  padding: 0 1.25rem 3rem;
}

.doc-page {
  width: 100%;
  max-width: 720px;
  padding-top: 2rem;
}

.doc-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--redress-primary-darker);
  margin: 0 0 0.9rem;
  text-wrap: balance;
}

.doc-intro {
  color: var(--redress-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.doc-toc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--redress-primary-mist);
  border: 1px solid var(--redress-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin: 0 0 2.5rem;
}
.doc-toc a {
  color: var(--redress-primary-deep);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.doc-toc a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-section {
  margin-bottom: 3rem;
  scroll-margin-top: 4.5rem;
}
.doc-section-last {
  margin-bottom: 1rem;
}

.doc-h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--redress-primary-darker);
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--redress-accent);
  display: inline-block;
}

.doc-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--redress-primary-deep);
  margin: 1.75rem 0 0.6rem;
}
.doc-h3:first-of-type {
  margin-top: 0;
}

.doc-p {
  font-size: 0.96rem;
  line-height: 1.75;
  color: #3F3B36;
  margin: 0 0 0.9rem;
}

.doc-list {
  margin: 0 0 0.9rem;
  padding-inline-start: 1.35rem;
  font-size: 0.96rem;
  line-height: 1.75;
  color: #3F3B36;
}
.doc-list li {
  margin-bottom: 0.5rem;
}
.doc-list li:last-child {
  margin-bottom: 0;
}

.doc-link {
  color: var(--redress-primary-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Warning card — same visual language as the app's own delete-account
   screen (rose-tinted card, teal heading, no red text block). */
.doc-warning {
  background: #FDF3F2;
  border: 1px solid rgba(212, 24, 61, 0.14);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.doc-warning .doc-h3 {
  margin-top: 0;
  color: var(--redress-primary-deep);
}
.doc-warning .doc-p {
  margin-bottom: 0;
}

.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--redress-border);
  margin: 0 0 1.5rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.doc-table th,
.doc-table td {
  text-align: start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--redress-border);
  vertical-align: top;
  line-height: 1.6;
}
.doc-table thead th {
  background: var(--redress-primary-mist);
  color: var(--redress-primary-darker);
  font-weight: 700;
  white-space: nowrap;
}
.doc-table tbody tr:last-child td {
  border-bottom: none;
}
.doc-table tbody td:first-child {
  font-weight: 600;
  color: var(--redress-primary-deep);
  white-space: nowrap;
}

/* Mobile: collapse the table into stacked label/value rows instead of
   letting it force horizontal scroll on a 3-column layout — the page
   body itself must never scroll horizontally. */
@media (max-width: 640px) {
  .doc-table-wrap {
    border: none;
    overflow-x: visible;
  }
  .doc-table thead {
    display: none;
  }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td {
    display: block;
    width: 100%;
  }
  .doc-table tr {
    border: 1px solid var(--redress-border);
    border-radius: 14px;
    margin-bottom: 0.9rem;
    overflow: hidden;
  }
  .doc-table td {
    border-bottom: 1px solid var(--redress-border);
    padding: 0.7rem 1rem;
  }
  .doc-table tr td:last-child {
    border-bottom: none;
  }
  .doc-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--redress-primary-deep);
    margin-bottom: 0.25rem;
  }
  .doc-table td:first-child::before {
    display: none;
  }
}
