/* =====================================================================
   RAWRK™ product page — v3.1 (launch-ready for Ep.1 + US case drop)
   Mobile first, fast in TikTok / Instagram / YouTube in-app browsers.
   Fixes:
   - Full uncropped phone cases on mobile gallery & All 9 designs cards
   - Sticky phone buy bar only appears AFTER scrolling past main CTA
   - Grouped iPhone 14–17 model dropdown + per-design mood line
   - Compact @itsrawrk character bridge strip tying Ep.1 to the merch
   ===================================================================== */

:root {
  --bg: #ffffff;
  --ink: #0e100e;
  --muted: #555c55;
  --line: #e2e5df;
  --soft: #f4f5f2;
  --photo: #f7f8f5;
  --green: #2b7732;
  --green-deep: #1f5a26;
  --lime: #dbf952;
  --red: #c8231a;

  --f: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --r-lg: 22px;
  --wrap: 1240px;
  --gut: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bar-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--f);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.ulink { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
.ulink:hover { color: var(--green); }

/* ---------- top ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__bar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo img { height: 28px; width: auto; }
.top__nav { display: flex; align-items: center; gap: 14px; }
.top__pill {
  font-size: 13px; font-weight: 700; text-decoration: none;
  padding: 5px 11px; border-radius: 999px;
  background: var(--lime); border: 1.5px solid var(--ink);
  transition: transform .15s var(--ease);
}
.top__pill:hover { transform: translateY(-1px); }
.top__link { font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 0; }
.top__link:hover { color: var(--green); }

/* ---------- product ---------- */
.pdp { padding-bottom: 48px; }

.gal { margin-inline: calc(var(--gut) * -1); }
.gal__stage { position: relative; }
.gal__track {
  display: flex; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  background: var(--photo);
}
.gal__track::-webkit-scrollbar { display: none; }
.gal__slide {
  flex: 0 0 100%; margin: 0;
  aspect-ratio: 4 / 5; max-height: 52svh;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; background: var(--photo);
}
.gal__slide img { width: 100%; height: 100%; object-fit: cover; }
.gal__slide--studio { background: #fff; padding: 8px 0; }
.gal__slide--studio img { object-fit: contain; }
.gal.is-swapping .gal__slide img { animation: swap .42s var(--ease) both; }
@keyframes swap { from { opacity: .2; transform: scale(1.02); } to { opacity: 1; transform: none; } }

.gal__arrow {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .94);
  display: none; place-items: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 16, 14, .08);
  transition: background-color .2s, scale .15s;
}
.gal__arrow svg { width: 20px; height: 20px; }
.gal__arrow:hover { background: #fff; }
.gal__arrow:active { scale: .94; }
.gal__arrow--prev { left: 14px; }
.gal__arrow--next { right: 14px; }
.gal__arrow[disabled] { opacity: .32; cursor: default; }

.gal__dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.gal__dots span { width: 6px; height: 6px; border-radius: 99px; background: #c9cdc6; transition: width .3s var(--ease), background-color .3s; }
.gal__dots span.is-on { width: 20px; background: var(--ink); }
.gal__thumbs { display: none; }

/* buy box */
.buy { padding-top: 14px; }
.buy__kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 8px; font-size: 13px; color: var(--muted);
}
.buy__kicker a {
  font-weight: 700; color: var(--green-deep); text-decoration: none;
  background: #edf7ee; padding: 3px 9px; border-radius: 999px;
}
.buy__kicker a:hover { background: var(--lime); color: var(--ink); }
.buy__kicker span::before { content: "· "; }

.buy__title {
  font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.3rem);
  font-weight: 800; font-stretch: 108%;
  line-height: 1.05; letter-spacing: -0.028em;
}
.buy__price { margin-top: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buy__price strong { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.buy__price span { color: var(--muted); font-size: 14.5px; }
.buy__lede { margin-top: 16px; color: var(--muted); font-size: 14.5px; max-width: 46ch; }

.opt { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.opt__label { padding: 0; margin-bottom: 6px; font-size: 14.5px; font-weight: 600; }
.opt__label--block { display: block; margin-bottom: 8px; }
.opt__label b { font-weight: 800; }
.opt__sub { color: var(--muted); font-weight: 500; }
.opt__sub::before { content: "· "; }
.opt__mood {
  margin: 0 0 10px;
  font-size: 13.5px; font-weight: 600; color: var(--green-deep);
}
.opt input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sw {
  position: relative; display: block; cursor: pointer;
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--photo);
  outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color .2s, translate .2s var(--ease);
}
.sw img { width: 100%; height: 100%; object-fit: cover; }
.sw:hover { translate: 0 -2px; }
.sw:has(input:checked) { outline-color: var(--ink); }
.sw:has(input:focus-visible) { outline-color: var(--green); }

/* model select dropdown */
.sel { position: relative; }
.sel select {
  width: 100%; min-height: 50px; padding: 0 42px 0 15px;
  appearance: none; -webkit-appearance: none;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.sel select:hover { border-color: #b5bab2; }
.sel select:focus { border-color: var(--ink); outline: none; }
.sel select.has-val { border-color: var(--ink); background: var(--soft); }
.is-error .sel select { border-color: var(--red); }
.sel__chev {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; pointer-events: none; color: var(--muted);
}
.opt__error { color: var(--red); font-size: 14px; font-weight: 600; margin-top: 8px; }
.opt__error:empty { display: none; }

.seg { display: grid; gap: 8px; }
.seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pack span {
  position: relative; display: grid; gap: 2px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: border-color .2s, background-color .2s, scale .12s;
}
.pack small { font-size: 13px; color: var(--muted); }
.pack b { font-size: 1.15rem; font-weight: 800; }
.pack em {
  position: absolute; top: -11px; right: 10px;
  font-style: normal; font-size: 11.5px; font-weight: 700;
  background: var(--lime); border: 1.5px solid var(--ink);
  padding: 2px 8px; border-radius: 99px;
}
.pack:hover span { border-color: #b9beb6; }
.pack:active span { scale: .98; }
.pack input:checked + span { border-color: var(--ink); background: var(--soft); box-shadow: inset 0 0 0 1px var(--ink); }
.pack input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px;
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .2s, translate .2s var(--ease), scale .12s;
}
.btn svg { width: 20px; height: 20px; transition: translate .2s var(--ease); }
.btn--buy { background: var(--ink); color: #fff; }
.btn--buy:hover { background: var(--green); }
.btn--buy:hover svg { translate: 3px 0; }
.btn--buy:active { scale: .98; }
.buy__cta { width: 100%; min-height: 56px; margin-top: 18px; font-size: 16.5px; }

.buy__note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 9px; font-size: 13px; color: var(--muted); }
.buy__note svg { width: 15px; height: 15px; }

.perks { list-style: none; margin: 20px 0 0; padding: 16px 0; border-block: 1px solid var(--line); display: grid; gap: 12px; }
.perks li { display: flex; gap: 12px; font-size: 14px; color: var(--muted); }
.perks svg { flex: none; width: 21px; height: 21px; color: var(--green); margin-top: 1px; }
.perks b { display: block; color: var(--ink); font-size: 14.5px; }

.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  list-style: none; cursor: pointer; padding: 15px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 700;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 22px; font-weight: 400; line-height: 1; transition: rotate .25s var(--ease); }
.acc details[open] summary::after { rotate: 45deg; }
.acc__body { padding-bottom: 15px; color: var(--muted); font-size: 14.5px; }

/* ---------- watch / @itsrawrk character strip ---------- */
.watch { padding: 0 0 48px; }
.watch__card {
  display: grid; gap: 18px; align-items: center;
  padding: 20px 18px;
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 4px 4px 0 var(--ink);
}
.watch__who { display: flex; align-items: flex-start; gap: 14px; }
.watch__icon {
  flex: none; width: 52px; height: 52px; padding: 5px;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
}
.watch__tag { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.watch__who h2 { font-size: clamp(1.25rem, 1rem + .8vw, 1.55rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin-top: 2px; }
.watch__sub { font-size: 14px; color: #242b23; margin-top: 4px; max-width: 44ch; }
.watch__links { display: flex; flex-wrap: wrap; gap: 8px; }
.sbtn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: #fff; color: var(--ink); border: 2px solid var(--ink);
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: transform .15s var(--ease), background-color .15s;
}
.sbtn svg { width: 16px; height: 16px; }
.sbtn:hover { transform: translateY(-2px); }
.sbtn--dark { background: var(--ink); color: #fff; }
.sbtn--dark:hover { background: var(--green-deep); border-color: var(--green-deep); }

/* ---------- all designs ---------- */
.all { background: var(--soft); padding-block: 52px 68px; border-top: 1px solid var(--line); }
.all__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 22px; }
.all__head h2 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem); font-weight: 800; font-stretch: 108%; letter-spacing: -0.03em; line-height: 1.05; }
.all__head p { color: var(--muted); font-size: 15px; }
.all__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dcard {
  display: grid; align-content: start; padding: 0 0 14px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: #fff; text-align: left; cursor: pointer;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: translate .25s var(--ease), box-shadow .25s, outline-color .2s, border-color .2s;
}
.dcard__img {
  display: block; aspect-ratio: 4 / 5; overflow: hidden;
  background: #fff; padding: 10px 8px 6px;
}
.dcard img {
  width: 100%; height: 100%; object-fit: contain;
  transition: scale .45s var(--ease);
}
.dcard__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 12px 0;
}
.dcard__name { font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.dcard__badge {
  flex: none; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  background: var(--soft); color: var(--muted);
}
.dcard__badge--rage { background: #edf7ee; color: var(--green-deep); }
.dcard__mood {
  padding: 4px 12px 0;
  font-size: 12.5px; color: var(--muted); line-height: 1.35;
}
.dcard:hover { translate: 0 -2px; box-shadow: 0 10px 30px rgba(14, 16, 14, .08); }
.dcard:hover img { scale: 1.04; }
.dcard:active { translate: 0; scale: .99; }
.dcard.is-current { border-color: var(--ink); outline-color: var(--ink); }

/* ---------- footer ---------- */
.foot { padding: 40px 0 calc(var(--bar-h) + 40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.foot__grid { display: grid; gap: 20px; }
.foot__logo { height: 34px; width: auto; }
.foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14.5px; font-weight: 600; }
.foot__legal { font-size: 13px; color: var(--muted); }

/* ---------- phone buy bar ---------- */
.bar {
  position: fixed; z-index: 30;
  left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 20px;
  box-shadow: 0 12px 36px rgba(14, 16, 14, .18);
  translate: 0 calc(100% + 28px);
  transition: translate .32s var(--ease);
}
.bar.is-on { translate: 0 0; }
.bar__img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; }
.bar__text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.bar__text b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__text span { font-size: 13px; color: var(--muted); }
.bar__btn { min-height: 46px; padding: 0 20px; font-size: 15px; }

/* ---------- notify sheet (shop not live yet) ---------- */
.sheet {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: 100%; max-width: 480px; max-height: none;
  margin: auto auto 0; overflow: visible;
}
.sheet::backdrop { background: rgba(14, 16, 14, .45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet[open] .sheet__card { animation: up .35s var(--ease) both; }
@keyframes up { from { translate: 0 40px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.sheet__card {
  position: relative; display: grid; gap: 12px;
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 26px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
.sheet__x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); display: grid; place-items: center; cursor: pointer; }
.sheet__x svg { width: 18px; height: 18px; }
.sheet__img { width: 72px; height: 72px; border-radius: 14px; }
.sheet h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.sheet p { color: var(--muted); font-size: 15px; }
.sheet p b { color: var(--ink); }
.sheet__row { display: flex; gap: 8px; margin-top: 4px; }
.sheet__row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px; font-size: 16px; background: #fff;
}
.sheet__row input:focus { border-color: var(--ink); outline: none; }
.sheet__row input[aria-invalid="true"] { border-color: var(--red); }
.sheet__row .btn { padding: 0 22px; }
.sheet__error { color: var(--red) !important; font-weight: 600; font-size: 14px !important; }
.sheet__status { color: var(--green-deep) !important; font-weight: 600; }
.sheet__error:empty, .sheet__status:empty { display: none; }
.sheet__note { font-size: 12.5px !important; }

.toast {
  position: fixed; z-index: 40; left: 50%; top: 72px; translate: -50% -10px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; max-width: calc(100% - 32px); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- tablet / desktop ---------- */
@media (min-width: 700px) {
  :root { --gut: 28px; }
  .all__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .dcard__meta { padding: 8px 16px 0; }
  .dcard__name { font-size: 15.5px; }
  .dcard__mood { padding: 4px 16px 0; font-size: 13.5px; }
  .watch__card { grid-template-columns: 1fr auto; padding: 24px 28px; }
}
@media (min-width: 960px) {
  .pdp { padding: 24px 0 64px; }
  .pdp__grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr); gap: 52px; align-items: start; }
  .gal { margin-inline: 0; position: sticky; top: 76px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; }
  .gal__stage { grid-column: 2; grid-row: 1; width: 100%; max-width: calc((100svh - 112px) * .8); }
  .gal__slide { aspect-ratio: 4 / 5; max-height: none; }
  .gal__slide--studio { padding: 0; }
  .gal__track { border-radius: var(--r-lg); border: 1px solid var(--line); }
  .gal__arrow { display: grid; }
  .gal__dots { display: none; }
  .gal__thumbs { grid-column: 1; grid-row: 1; display: grid; gap: 10px; }
  .gal__thumbs button {
    padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff;
    aspect-ratio: 4 / 5; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s, translate .2s var(--ease);
  }
  .gal__thumbs button:hover { translate: 2px 0; }
  .gal__thumbs button.is-on { border-color: var(--ink); outline-color: var(--ink); }
  .gal__thumbs img { width: 100%; height: 100%; object-fit: cover; }
  .buy { padding-top: 2px; }
  .buy__lede { margin-top: 16px; }
  .bar { display: none; }
  .foot { padding-bottom: 48px; }
  .foot__grid { grid-template-columns: auto 1fr; align-items: center; }
  .foot__links { justify-content: flex-end; }
  .foot__legal { grid-column: 1 / -1; }
  .sheet { margin: auto; }
  .sheet__card { border-radius: 24px; padding: 30px 28px 28px; }
  .watch { padding-bottom: 64px; }
  .all { padding-block: 80px 96px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- #todo helper: add #todo to the URL to see every placeholder ---------- */
.show-todo [data-todo] { outline: 2px dashed var(--red) !important; outline-offset: 3px; position: relative; }
.show-todo [data-todo]::after {
  content: "TODO: " attr(data-todo);
  position: absolute; left: 0; top: 100%; z-index: 60; margin-top: 4px;
  background: var(--red); color: #fff; font: 600 11px/1.3 var(--f);
  padding: 3px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none;
}
