/* Adloom — white, quiet, small type. The visitor names their category, then sees only that work. */

:root {
  color-scheme: light only;
  --bg: #ffffff;
  --surface: #f3f3f1;
  --surface-2: #e9e9e6;
  --ink: #111111;
  --muted: #6b6b68;

  --sans: 'Instrument Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --small: 0.8125rem;
  --body: 1rem;
  --title: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  --question: clamp(2.25rem, 1.4rem + 3vw, 4rem);

  --margin: clamp(1.25rem, 3vw, 2.5rem);
  --gap: clamp(0.75rem, 1.1vw, 1rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-long: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; }
h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.05; text-wrap: balance; }
main { flex: 1; display: flex; flex-direction: column; }

/* links: an underline that appears on hover */
.bar__switch button, .bar__mail, .foot a, .next__mail, .next__other, .filter {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; text-decoration-color: transparent;
  transition: text-decoration-color 250ms ease, color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .bar__switch button:hover, .bar__mail:hover, .foot a:hover, .next__mail:hover, .next__other:hover, .filter:hover { text-decoration-color: currentColor; }
}

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.25rem var(--margin); background: var(--bg); font-size: 0.875rem; }
.bar__name { justify-self: start; font-family: var(--serif); font-size: 1.5rem; line-height: 1; letter-spacing: -0.01em; }
.bar__switch { display: flex; gap: 2rem; }
.bar__switch button { color: var(--muted); }
.bar__switch button[aria-current="page"] { color: var(--ink); text-decoration-color: currentColor; }
.bar__end { justify-self: end; display: flex; gap: 1.5rem; }
[data-view="choose"] .bar__switch { visibility: hidden; }

/* ---------- one view at a time ---------- */
.js .choose, .js .view { display: none; }
[data-view="choose"] .choose, [data-view="fashion"] #fashion, [data-view="optics"] #optics { display: flex; }

/* ---------- the question ---------- */
.choose { flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem var(--margin) 4rem; }
.choose__q { font-size: var(--question); max-width: 14em; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); width: min(100%, 52rem); margin-top: clamp(3rem, 6vw, 4.5rem); }
.pick { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 1.5rem 1rem; text-align: center; }
.pick__name { font-family: var(--serif); font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem); line-height: 1; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: transparent; transition: text-decoration-color 300ms ease; }
.pick__count { font-size: 0.875rem; color: var(--muted); }
.pick__arrow { margin-top: 0.75rem; transition: transform 300ms var(--ease); }
.pick:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .pick:hover .pick__name { text-decoration-color: currentColor; }
  .pick:hover .pick__arrow { transform: translateX(6px); }
}
.choose__note { margin-top: 2.5rem; font-size: 0.875rem; color: var(--muted); }

/* ---------- a category's films ---------- */
.view { flex-direction: column; padding: clamp(2rem, 5vw, 4rem) var(--margin) 0; }
.view__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; margin-bottom: clamp(2rem, 4vw, 3rem); }
.view__head h1 { grid-column: 1 / span 5; font-size: clamp(2.5rem, 1.6rem + 3vw, 4.5rem); }
.view__pitch { grid-column: 6 / span 4; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.view__pitch p { max-width: 34ch; }
.view__price { font-size: 0.875rem; color: var(--muted); }
.view__from { color: var(--ink); font-weight: 500; }
.view__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.view__alt { font-size: 0.875rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }
.view__mail { font-size: 0.8125rem; color: var(--muted); }
.copy { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: #c9c9c5; transition: text-decoration-color 200ms ease; }
.copy__done { margin-left: 0.5rem; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .copy:hover { text-decoration-color: currentColor; } }
.foot__end { display: flex; gap: 1.5rem; }
.foot .copy { color: var(--muted); font-size: inherit; }
.foot__wa { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.3em; }
.view__cta { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 1.25rem; background: var(--ink); color: var(--bg); font-size: 0.875rem; font-weight: 500; transition: transform 140ms var(--ease), opacity 200ms ease; }
.view__cta svg { transition: transform 300ms var(--ease); }
.view__cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .view__cta:hover svg { transform: translateX(4px); } }
.filters { grid-column: 10 / span 3; justify-self: end; display: flex; gap: 1.5rem; font-size: 0.875rem; }
.filter { color: var(--muted); }
.filter[aria-pressed="true"] { color: var(--ink); text-decoration-color: currentColor; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.25rem var(--gap); }
.film[hidden] { display: none; }
.film__play { display: block; width: 100%; aspect-ratio: 9 / 16; background: var(--surface); overflow: clip; }
.film__play video { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .film__play:hover video { transform: scale(1.025); } }
.film__meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; font-size: 0.875rem; }
.film__time { color: var(--muted); font-variant-numeric: tabular-nums; }

.next { display: flex; flex-direction: column; justify-content: flex-end; gap: 1.5rem; min-height: 14rem; padding: 0 0 2.25rem clamp(0rem, 2vw, 2rem); }
.next__say { font-family: var(--serif); font-size: var(--title); line-height: 1.1; max-width: 12em; }
.next__links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.75rem 2rem; }
.next__mail { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration-color: currentColor; }
.next__other { color: var(--muted); font-size: 0.875rem; }
.view { padding-bottom: clamp(4rem, 8vw, 6rem); }
.how { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); margin-top: clamp(5rem, 10vw, 8rem); }
.how h2 { grid-column: 1 / span 3; font-family: var(--serif); font-weight: 400; font-size: var(--title); line-height: 1.05; margin: 0; }
.how__steps { grid-column: 4 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap) clamp(1.5rem, 3vw, 3rem); margin: 0; padding: 0; list-style: none; }
.how__steps h3 { font-size: 1rem; font-weight: 500; margin: 0 0 0.5rem; }
.how__steps p { color: var(--muted); font-size: 0.9375rem; max-width: 30ch; }

/* ---------- footer ---------- */
.foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem var(--margin); font-size: var(--small); color: var(--muted); }

/* ---------- viewer ---------- */
.viewer { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; }
.viewer::backdrop { background: var(--bg); }
.viewer__close { justify-self: end; padding: 1.25rem var(--margin); font-size: 0.875rem; }
.viewer__video { height: 100%; width: auto; max-width: calc(100vw - 2 * var(--margin)); background: var(--surface); }
.viewer__bar { width: min(100%, 36rem); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.25rem var(--margin); font-size: 0.875rem; }
.viewer__step:first-child { justify-self: start; }
.viewer__step:last-child { justify-self: end; }
.viewer__step { color: var(--muted); transition: color 200ms ease; }
.viewer__title { font-family: var(--serif); font-size: 1.375rem; text-align: center; }
@media (hover: hover) and (pointer: fine) { .viewer__step:hover, .viewer__close:hover { color: var(--ink); } }

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .how h2 { grid-column: 1 / -1; margin-bottom: 2rem; }
  .how__steps { grid-column: 1 / -1; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view__head h1 { grid-column: 1 / -1; }
  .view__pitch { grid-column: 1 / span 8; margin-top: 1.25rem; }
  .filters { grid-column: 9 / span 4; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .how { display: block; }
  .how__steps { grid-template-columns: 1fr; gap: 1.75rem; margin-top: 1.75rem; }
  .bar { grid-template-columns: auto 1fr auto; padding-block: 1rem; }
  .bar__switch { justify-self: center; gap: 1.25rem; }
  .picks { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 0.5rem; }
  .film__meta { flex-direction: column; gap: 0; font-size: 0.8125rem; }
  .view__pitch { grid-column: 1 / -1; }
  .filters { grid-column: 1 / -1; justify-self: start; margin-top: 1.5rem; }
  .next { padding: 0 0 1.75rem; min-height: 0; }
  .next__say { font-size: 1.25rem; }
  .next__links { flex-direction: column; align-items: flex-start; }
  .foot { flex-direction: column; gap: 0.25rem; }
  .viewer__video { height: 100%; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .choose > *, .js .view__head, .js .film, .js .next { animation: rise 900ms var(--ease-long) both; }
  .js .picks { animation-delay: 120ms; }
  .js .choose__note { animation-delay: 220ms; }
  .js .film { animation-delay: calc(120ms + var(--i) * 70ms); }
  .viewer[open] .viewer__video { animation: settle 500ms var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes settle { from { opacity: 0; transform: scale(0.985); } }
