/* Loopi site styles. Colours live in theme.css. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2-variations"),
       url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-brand); text-underline-offset: 0.18em; }
a:hover { color: var(--color-brand-hover); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--color-ink); color: var(--color-paper);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 10;
}
.skip-link:focus { top: 1rem; color: var(--color-paper); }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }

/* ---------- Type ---------- */

h1, h2, h3 {
  margin: 0;
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-stretch: 82%;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 8.2vw, 5.6rem); }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
h3 { font-size: 1.35rem; line-height: 1.15; font-stretch: 90%; font-variation-settings: "opsz" 24; }

p { margin: 0; max-width: 38em; }
.lede { font-size: clamp(1.125rem, 2.1vw, 1.3rem); color: var(--color-muted); max-width: 32em; }

/* ---------- Header ---------- */

.site-header { padding: 1.25rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.wordmark {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 1.9rem; font-weight: 800; line-height: 1;
  letter-spacing: -0.04em; font-stretch: 85%;
  font-variation-settings: "opsz" 48;
  color: var(--color-ink); text-decoration: none;
}
.wordmark:hover { color: var(--color-ink); }
.wordmark svg { width: 2.4rem; height: 1.56rem; flex: none; }

.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a:not(.btn) { color: var(--color-ink); font-weight: 600; text-decoration: none; }
.header-nav a:not(.btn):hover { color: var(--color-brand); }
@media (max-width: 40rem) { .header-nav a:not(.btn) { display: none; } }

/* ---------- Buttons and fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  border: 0; border-radius: 999px;
  background: var(--color-brand); color: var(--color-on-brand);
  font: inherit; font-weight: 650; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--color-brand-hover); color: var(--color-on-brand); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-small { min-height: 2.5rem; padding: 0 1.1rem; font-size: 0.95rem; }

.field { display: grid; gap: 0.35rem; }
.field label, .field legend { font-size: 0.95rem; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--color-muted); }

input[type="email"], input[type="text"] {
  width: 100%; min-height: 3rem; padding: 0 1rem;
  border: 1.5px solid var(--color-line); border-radius: 12px;
  background: var(--color-surface); color: var(--color-ink);
  font: inherit; font-size: 1rem;
}
input[type="email"]:focus, input[type="text"]:focus {
  outline: none; border-color: var(--color-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 25%, transparent);
}
input[aria-invalid="true"] { border-color: var(--color-error); }

/* Buy / sell / both choice */
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.choice legend { padding: 0; margin-bottom: 0.5rem; font-size: 0.95rem; font-weight: 600; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label.chip {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem;
  border: 1.5px solid var(--color-line); border-radius: 999px;
  background: var(--color-surface); cursor: pointer; font-weight: 550; font-size: 0.95rem;
}
.choice input:checked + label.chip {
  border-color: var(--color-ink); background: var(--color-ink); color: var(--color-paper);
}
.choice input:focus-visible + label.chip { outline: 3px solid var(--color-focus); outline-offset: 2px; }

.form-note { font-size: 0.875rem; color: var(--color-muted); }
.form-status { font-weight: 600; min-height: 1.5em; }
.form-status[data-state="error"] { color: var(--color-error); }
.form-status[data-state="success"] { color: var(--color-success); }

.hp { position: absolute; left: -9999px; }

/* ---------- Hero ---------- */

.hero { padding: 1.5rem 0 4rem; overflow: hidden; }
.hero-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 60rem) {
  .hero { padding: 3rem 0 6rem; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; }
}

.hero-copy { display: grid; gap: 1.5rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.55rem; justify-self: start;
  padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  border: 1.5px solid var(--color-line); border-radius: 999px;
  background: var(--color-surface);
  font-size: 0.9rem; font-weight: 600;
}
.status::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--color-brand);
}

.hero-form { display: grid; gap: 1rem; max-width: 30rem; margin-top: 0.5rem; }
.inline-submit { display: grid; gap: 0.6rem; }
@media (min-width: 30rem) {
  .inline-submit { grid-template-columns: 1fr auto; }
}

/* ---------- Clothes rail with price tags (the hero visual) ---------- */

.rail {
  position: relative;
  height: 23rem;
}
@media (min-width: 60rem) { .rail { height: 31rem; } }
.rail-bar {
  position: absolute; left: 0; right: 0; top: 1.25rem;
  height: 0.6rem; border-radius: 999px;
  background: var(--color-ink);
}
.rail-bar::before, .rail-bar::after {
  content: ""; position: absolute; top: -1.25rem;
  width: 0.6rem; height: 1.6rem; border-radius: 999px; background: var(--color-ink);
}
.rail-bar::before { left: 8%; }
.rail-bar::after { right: 8%; }

.hang {
  position: absolute; top: 1.55rem;
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0;
  animation: swing 2.6s cubic-bezier(.3, .6, .35, 1) both;
}
.hang::before {
  /* the string */
  content: ""; width: 2px; height: var(--drop, 3rem);
  background: var(--color-tag-deep);
}
.hang { width: 30%; }
.hang:nth-child(2) { left: 2%;  --drop: 2.4rem; --rest: -3deg; animation-delay: 0.05s; }
.hang:nth-child(3) { left: 35%; --drop: 6rem;   --rest: 2.5deg; animation-delay: 0.2s; }
.hang:nth-child(4) { left: 68%; --drop: 1.6rem; --rest: -1.5deg; animation-delay: 0.35s; }

@keyframes swing {
  0%   { transform: rotate(calc(var(--rest) + 14deg)); }
  30%  { transform: rotate(calc(var(--rest) - 8deg)); }
  55%  { transform: rotate(calc(var(--rest) + 4deg)); }
  78%  { transform: rotate(calc(var(--rest) - 1.5deg)); }
  100% { transform: rotate(var(--rest)); }
}
.hang { transform: rotate(var(--rest)); }
@media (prefers-reduced-motion: reduce) { .hang { animation: none; } }

.tag {
  --cut: 1.1rem;
  position: relative;
  width: 100%;
  min-width: 0;
  margin-top: -0.75rem;
  padding: 2.4rem 1.1rem 1.2rem;
  background: var(--color-tag);
  color: var(--color-on-tag);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%, 0 var(--cut));
  display: grid; gap: 0.15rem;
}
.tag::before {
  /* punched hole */
  content: ""; position: absolute; top: 0.85rem; left: 50%;
  width: 0.8rem; height: 0.8rem; margin-left: -0.4rem; border-radius: 50%;
  background: var(--color-paper);
  box-shadow: inset 0 0 0 2px var(--color-tag-deep);
}
.tag-item { font-weight: 600; line-height: 1.25; font-size: 0.98rem; overflow-wrap: anywhere; }
.tag-size { font-size: 0.88rem; opacity: 0.8; }
.tag-price {
  margin-top: 0.7rem; padding-top: 0.6rem;
  border-top: 1.5px dashed color-mix(in srgb, var(--color-on-tag) 35%, transparent);
  font-size: 2.3rem; font-weight: 800; line-height: 1;
  font-stretch: 78%; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}
.tag-note { font-size: 0.82rem; opacity: 0.8; }

.tag.is-sold { background: var(--color-surface); }
.tag.is-sold .tag-price { text-decoration: line-through; text-decoration-thickness: 3px; opacity: 0.5; }
.tag .sold-stamp {
  justify-self: start; margin-top: 0.4rem; padding: 0.15rem 0.55rem; border-radius: 6px;
  background: var(--color-brand); color: var(--color-on-brand); font-size: 0.82rem; font-weight: 700;
}

@media (min-width: 60rem) {
  .tag { padding: 2.8rem 1.3rem 1.4rem; }
  .tag-item { font-size: 1.1rem; }
  .tag-price { font-size: 3rem; }
}

@media (max-width: 34rem) {
  /* Two tags on small phones so each stays readable */
  .hang { width: 46%; }
  .hang:nth-child(2) { left: 1%; }
  .hang:nth-child(3) { left: auto; right: 1%; --drop: 4rem; }
  .hang:nth-child(4) { display: none; }
  .rail { height: 20rem; }
  .tag-price { font-size: 2.2rem; }
}

/* ---------- Sections ---------- */

.section { padding: 4.5rem 0; border-top: 1.5px solid var(--color-line); }
@media (min-width: 60rem) { .section { padding: 6.5rem 0; } }

.section-head { display: grid; gap: 1rem; margin-bottom: 2.5rem; align-content: start; }
.how-grid .section-head { margin-bottom: 0; }

/* How it works */
.how-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .how-grid { grid-template-columns: 0.8fr 1.2fr; gap: 4rem; } }

.tabs { display: inline-flex; padding: 0.3rem; gap: 0.25rem; border-radius: 999px; background: var(--color-surface); border: 1.5px solid var(--color-line); justify-self: start; }
.tabs button {
  min-height: 2.6rem; padding: 0 1.3rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--color-ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--color-ink); color: var(--color-paper); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.25rem 1rem;
  padding: 1.4rem 0; border-bottom: 1.5px solid var(--color-line);
}
.steps li:first-child { padding-top: 0; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-size: 2.6rem; font-weight: 800; line-height: 0.9;
  font-stretch: 75%; font-variation-settings: "opsz" 72;
  color: var(--color-brand);
}
.steps p { color: var(--color-muted); }
.steps[hidden] { display: none; }

/* Why Loopi */
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 48rem) { .points { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.points li { display: grid; gap: 0.6rem; align-content: start; }
.points li::before {
  content: ""; width: 1rem; height: 1rem; border-radius: 50%;
  border: 3px solid var(--color-tag-deep); margin-bottom: 0.4rem;
}
.points p { color: var(--color-muted); }

/* FAQ */
.faq { display: grid; max-width: 46rem; }
.faq details { border-bottom: 1.5px solid var(--color-line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.2rem 0; font-size: 1.15rem; font-weight: 650;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.7rem; height: 0.7rem;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg) translateY(-0.2rem); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-0.1rem, -0.1rem); }
.faq details p { padding: 0 0 1.4rem; color: var(--color-muted); }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- Waitlist: one big hanging tag ---------- */

.waitlist { padding: 2rem 0 5rem; }
.waitlist-hang { display: flex; flex-direction: column; align-items: center; }
.waitlist-hang::before {
  content: ""; width: 2px; height: 4rem; background: var(--color-tag-deep);
}
.big-tag {
  --cut: 2.5rem;
  position: relative; width: 100%; max-width: 44rem; margin-top: -1rem;
  padding: 4rem 1.5rem 2.5rem;
  background: var(--color-tag); color: var(--color-on-tag);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%, 0 var(--cut));
  display: grid; gap: 1.25rem;
}
@media (min-width: 48rem) { .big-tag { padding: 4.5rem 3.5rem 3rem; } }
.big-tag::before {
  content: ""; position: absolute; top: 1.4rem; left: 50%;
  width: 1.4rem; height: 1.4rem; margin-left: -0.7rem; border-radius: 50%;
  background: var(--color-paper); box-shadow: inset 0 0 0 3px var(--color-tag-deep);
}
.big-tag h2 { text-align: center; }
.big-tag > p { text-align: center; margin: 0 auto; }
.big-tag form { display: grid; gap: 1.1rem; margin-top: 0.5rem; }
.big-tag .form-note { color: inherit; opacity: 0.8; }
.big-tag .form-note a { color: inherit; }
.big-tag input[type="email"], .big-tag input[type="text"] { border-color: transparent; }
.big-tag .choice label.chip { border-color: transparent; }
.big-tag .choice input:checked + label.chip { background: var(--color-on-tag); color: var(--color-tag); }
.big-tag .form-status[data-state="success"] { color: var(--color-success); }
.big-tag .form-status[data-state="error"] { color: var(--color-error-deep); }
.big-tag input[aria-invalid="true"] { border-color: var(--color-error-deep); }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.submit-row .form-status { min-height: 0; }
.two-up { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .two-up { grid-template-columns: 1.4fr 1fr; } }

/* ---------- Footer ---------- */

.site-footer { padding: 2.5rem 0 3rem; border-top: 1.5px solid var(--color-line); font-size: 0.95rem; color: var(--color-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--color-ink); }

/* ---------- Simple text pages (privacy, 404) ---------- */

.page { padding: 2rem 0 5rem; }
.prose { max-width: 42rem; display: grid; gap: 1rem; }
.prose h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); margin-bottom: 0.5rem; }
.prose h2 { font-size: 1.6rem; margin-top: 1.5rem; font-stretch: 88%; }
.prose ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.prose .updated { color: var(--color-muted); }

.notfound { min-height: 60vh; display: grid; align-content: center; gap: 1.5rem; }
.notfound .tag { margin: 0; max-width: 14rem; transform: rotate(-3deg); }
