/* SnapTheDupe — always-white, phone-first.
   Twin motif: the thing you love (pink) + its look-alike (green). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --fg: #17141d;
  --muted: #5f5b69;
  --line: #ece7ef;
  --accent: #d4146d;
  --accent-deep: #b00f5a;
  --accent-ink: #ffffff;
  --blush: #fdf0f6;
  --save: #087a56;
  --save-soft: #e4f6ee;
  --ink-soft: #f4f3f6;
  --gold: #ffc21a;
  --gold-soft: #fff4cc;
  --gold-ink: #7a4f00;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --bar: rgba(255, 255, 255, .95);
  --shadow: 0 1px 2px rgba(40, 10, 30, .05), 0 8px 24px -14px rgba(60, 10, 40, .28);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  padding-block: env(safe-area-inset-top, 0px) 128px;
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.logo .the { color: var(--accent); }
.logo svg { width: 32px; height: 26px; flex: none; }
.logo .lo { fill: none; stroke: var(--fg); stroke-width: 2.5; }
.logo .ld { fill: var(--accent); }
.top-nav { display: flex; gap: 4px; }
.top-nav a { font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; padding: 10px 8px; border-radius: 10px; white-space: nowrap; }
@media (max-width: 420px) { .top-nav .nav-trend { display: none; } .top-nav a { padding-inline: 4px; } }
.top-nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding-block: 4px 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(36px, 10vw, 52px); line-height: .96; letter-spacing: -0.045em;
  margin: 0 0 12px; text-wrap: balance;
}
.hero h1 .pink { color: var(--accent); display: inline; background: linear-gradient(transparent 74%, var(--gold) 74%, var(--gold) 90%, transparent 90%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .04em; }
.hero p { color: var(--muted); font-size: 16.5px; margin: 0; max-width: 34em; }
.twins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
@media (max-width: 400px) { .twins .arrow { display: none; } }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.love { background: var(--blush); color: var(--accent-deep); }
.pill.dupe { background: var(--save-soft); color: var(--save); }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.twins .arrow { color: var(--muted); font-weight: 700; }

/* Finder */
.finder { display: grid; gap: 14px; }
.viewfinder {
  position: relative; aspect-ratio: 4 / 3; max-width: 100%;
  border-radius: 24px; background: var(--ink-soft); overflow: hidden;
  display: grid; place-items: center;
}
.corner { position: absolute; width: 28px; height: 28px; border: 0 solid var(--accent); pointer-events: none; z-index: 1; }
.c1 { top: 14px; left: 14px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 9px; }
.c2 { top: 14px; right: 14px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 9px; }
.c3 { bottom: 14px; left: 14px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 9px; }
.c4 { bottom: 14px; right: 14px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 9px; }
.vf-empty { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 24px 20px; width: 100%; }
.vf-empty p { margin: 0; color: var(--muted); font-size: 14px; max-width: 26em; }
.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 340px); }
.pbtn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 88px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 14.5px; line-height: 1.2; color: var(--fg); cursor: pointer; box-shadow: var(--shadow);
}
.pbtn.cam { background: var(--fg); border-color: var(--fg); color: #fff; }
.pbtn svg { width: 26px; height: 26px; }
.pbtn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pbtn:focus-within { outline: 3px solid var(--fg); outline-offset: 2px; }
.vf-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vf-clear {
  position: absolute; top: 12px; right: 12px; z-index: 2; min-height: 44px; padding: 0 14px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 999px;
  font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow);
}
.scanline {
  position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; z-index: 1;
  background: var(--gold); box-shadow: 0 0 18px var(--gold), 0 0 2px var(--gold-ink);
  animation: scan 1.1s ease-in-out infinite alternate;
}
@keyframes scan { to { top: 88%; } }

.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.describe { display: grid; gap: 10px; min-width: 0; }
.describe label { font-weight: 700; font-size: 15px; }
textarea {
  width: 100%; min-height: 88px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--fg);
  font: 16px/1.5 var(--font-body); padding: 13px 14px;
}
textarea::placeholder { color: #8f8a99; }
textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 4px var(--ink-soft); }
.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.count { font-variant-numeric: tabular-nums; }
.error { display: flex; gap: 8px; align-items: flex-start; background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; font-weight: 600; }

/* Sticky action bar */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--bar); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.action-inner { max-width: 560px; margin: 0 auto; }
.go {
  width: 100%; min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--fg); color: #fff; border: 0; border-radius: 16px; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  box-shadow: 0 10px 24px -12px rgba(23, 20, 29, .6);
}
.go:active { background: #000; }
.go .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.go:disabled { opacity: .7; cursor: progress; }
.go.secondary { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 2px var(--fg); }
.go svg { width: 20px; height: 20px; flex: none; }

/* Results */
.results { margin-top: 30px; scroll-margin-top: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.results h2 { font-family: var(--font-display); font-size: clamp(23px, 6.4vw, 30px); letter-spacing: -0.025em; line-height: 1.12; margin: 4px 0 14px; text-wrap: balance; }
.love-card { display: flex; align-items: center; gap: 14px; background: var(--ink-soft); border-radius: 20px; padding: 12px; margin-bottom: 14px; }
.love-thumb { flex: none; width: 88px; height: 88px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 2.5px solid var(--accent); display: grid; place-items: center; }
.love-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.love-thumb svg { width: 34px; height: 34px; color: var(--accent); }
.love-text { min-width: 0; }
.love-text h2 { font-size: clamp(19px, 5.2vw, 25px) !important; margin: 2px 0 0 !important; }
.dupes-label { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--save); font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dupes-label svg { width: 16px; height: 16px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); margin: 0 0 12px; min-height: 1.5em; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(255, 194, 26, .6); animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgba(255, 194, 26, 0); } }
.shots { display: grid; gap: 12px; }
.shot {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; box-shadow: var(--shadow);
}
.shot.primary { border: 2px solid var(--accent); }
.shot-head { display: flex; align-items: center; gap: 10px; }
.shot-ico { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.shot-ico svg { width: 20px; height: 20px; }
.shot .label { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.shot .label small { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); letter-spacing: 0; }
.k-close .shot-ico { background: var(--accent); color: var(--accent-ink); }
.k-cheap .shot-ico { background: var(--save-soft); color: var(--save); }
.k-nice .shot-ico { background: var(--gold-soft); color: var(--gold-ink); }
.k-nice .shot-ico svg { fill: var(--gold); stroke: var(--gold-ink); }
.shot.k-nice .label small { color: var(--gold-ink); }
.shot.k-cheap .label small { color: var(--save); }
.searching { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; font-weight: 600; background: var(--ink-soft); border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; }
.searching svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--muted); }
.why { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.see {
  display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 50px; margin-top: 2px; padding: 8px 12px; text-align: center;
  text-decoration: none; border-radius: 14px; font-family: var(--font-display); font-weight: 800; font-size: 16px;
  background: var(--fg); color: var(--bg);
}
.see:active { opacity: .85; }
.see .short { display: none; }
.original {
  margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  border: 1.5px dashed #ddd5e2; border-radius: 16px; padding: 10px 14px;
}
.original span { font-size: 14.5px; color: var(--muted); }
.original a { font-weight: 800; font-size: 14.5px; color: var(--accent); text-decoration: none; padding: 10px 0; }
.refine { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 10px 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.disclose { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

/* Loading skeletons */
.skel { pointer-events: none; }
.skel .bar { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--ink-soft) 0%, #ebe8ef 40%, var(--ink-soft) 80%); background-size: 240% 100%; animation: shimmer 1.3s linear infinite; }
.skel .bar.lg { height: 44px; border-radius: 12px; }
.skel .bar.w60 { width: 60%; }
.skel .bar.w85 { width: 85%; }
@keyframes shimmer { to { background-position: -140% 0; } }

/* Trending */
.section { margin-top: 36px; scroll-margin-top: 12px; }
.section h3 { font-family: var(--font-display); font-size: 23px; letter-spacing: -0.025em; margin: 0 0 4px; }
.section .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.section h3 .flame { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 6px; border-radius: 9px; background: var(--gold-soft); vertical-align: 3px; }
.section h3 .flame svg { width: 18px; height: 18px; }
.hot { position: absolute; top: -8px; right: 10px; display: inline-block; padding: 2px 8px; box-shadow: 0 2px 6px -2px rgba(122, 79, 0, .4); border-radius: 999px; background: var(--gold); color: var(--fg); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.filter { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 700; font-size: 14px; cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: #fff; }
.trend-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; list-style: none; padding: 8px 0 0; margin: 0; }

/* Trending tiles */
.tile {
  position: relative; width: 100%; height: 100%; min-height: 132px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
  background: var(--surface); color: var(--fg); border: 1.5px solid #e2dce6; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(40, 10, 30, .06), 0 10px 22px -12px rgba(40, 10, 30, .35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { border-color: var(--fg); }
.tile:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(40, 10, 30, .08); }
.t-top { display: flex; align-items: center; gap: 8px; }
.t-ico { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.t-ico svg { width: 20px; height: 20px; }
.tile .cat { font-weight: 800; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.t-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.15; letter-spacing: -0.015em; flex: 1; }
.t-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--fg); color: #fff; font-weight: 800; font-size: 13px; }
.c-style .t-ico { background: var(--ink-soft); color: var(--fg); }
.c-tech .t-ico { background: var(--fg); color: #fff; }
.c-home .t-ico { background: var(--gold-soft); color: var(--gold-ink); }
.c-fitness .t-ico { background: var(--save-soft); color: var(--save); }
.c-beauty .t-ico { background: var(--blush); color: var(--accent); }
.c-home { background: linear-gradient(180deg, #fffaea 0%, #fff 55%); }
.c-fitness { background: linear-gradient(180deg, #f1fbf6 0%, #fff 55%); }
.c-beauty { background: linear-gradient(180deg, #fff5f9 0%, #fff 55%); }
.c-style, .c-tech { background: linear-gradient(180deg, #f7f6f9 0%, #fff 55%); }

/* Install tip */
.install { margin-top: 28px; display: flex; gap: 12px; align-items: center; background: var(--ink-soft); border-radius: var(--radius); padding: 14px; }
.install .app-ico { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; }
.install .app-ico svg { width: 30px; height: 24px; }
.install .txt { flex: 1; min-width: 0; }
.install strong { display: block; font-size: 15px; }
.install span { font-size: 13.5px; color: var(--muted); }
.install .x { flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; border-radius: 12px; cursor: pointer; }

/* How it works */
.how { border-top: 1px solid var(--line); padding-top: 26px; }
.steps { display: grid; gap: 16px; list-style: none; padding: 0; margin: 14px 0 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 2px 12px; }
.steps li::before { content: counter(s); grid-row: span 2; font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--accent); line-height: 1; }
.steps li:nth-child(2)::before { color: var(--gold); -webkit-text-stroke: 1.5px var(--gold-ink); paint-order: stroke fill; }
.steps li:nth-child(3)::before { color: var(--save); }
.steps strong { font-size: 16px; }
.steps span { color: var(--muted); font-size: 14.5px; }

/* Footer */
footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: grid; gap: 8px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer nav a { color: var(--fg); font-weight: 700; font-size: 14px; text-decoration: none; padding: 8px 0; }
footer p { margin: 0; }

/* Simple content pages */
.page h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 8vw, 40px); letter-spacing: -0.035em; line-height: 1.05; margin: 8px 0 8px; }
.page .updated { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.page h2 { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; margin: 26px 0 6px; }
.page p, .page li { font-size: 16px; color: #2e2a35; max-width: 65ch; }
.page ul { padding-left: 20px; }
.page .back { display: inline-flex; margin-top: 24px; font-weight: 800; text-decoration: none; padding: 12px 0; }

/* Tablets and up */
@media (min-width: 740px) {
  .wrap, .action-inner { max-width: 900px; }
  .wrap { padding-inline: 32px; }
  .hero { padding-block: 16px 26px; }
  .hero h1 { font-size: 62px; max-width: 13ch; }
  .hero p { font-size: 18px; }
  .finder { grid-template-columns: 1.1fr 1fr; align-items: start; column-gap: 22px; }
  .or { display: none; }
  .viewfinder { aspect-ratio: 1 / 1; }
  .love-thumb { width: 112px; height: 112px; }
  .love-card { padding: 14px; gap: 18px; }
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .see .long { display: none; }
  .see .short { display: inline; }
  .trend-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-inner { display: flex; justify-content: flex-end; }
  .go { width: auto; min-width: 240px; padding-inline: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .scanline { animation: none; top: 50%; }
  .skel .bar { animation: none; }
  .status::before { animation: none; }
  html { scroll-behavior: auto; }
}
:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
