/* FOMO prototype: black on white, one typeface, nothing else. */
:root {
  --ink: #000;
  --paper: #fff;
  --muted: rgba(0, 0, 0, 0.42);
  --gap: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --zoom-gap: clamp(8px, 2vw, 32px); /* front and back photo in the zoom view; 0 on phones */
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- logo ---------- */
.masthead {
  display: flex;
  justify-content: center;
  padding: clamp(48px, 11vh, 132px) var(--gap) clamp(40px, 8vh, 96px);
}
.masthead img { width: clamp(220px, 44vw, 600px); height: auto; aspect-ratio: 704.62 / 189.11; }
.masthead--small { padding-bottom: clamp(32px, 6vh, 72px); }
.masthead--small img { width: clamp(150px, 22vw, 280px); }

main { flex: 1; }

/* ---------- shop grid ---------- */
.shop {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gap);
}
.item { display: block; cursor: zoom-in; }
.item__img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.item__name { margin-top: 10px; text-align: center; }
.item:hover .item__name,
.item:focus-visible .item__name { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 700px) {
  .shop { grid-template-columns: 1fr; gap: 48px; }
  .item__img { width: 88%; margin: 0 auto; }
}

/* ---------- zoom view ---------- */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--paper);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.zoom.is-open { visibility: visible; }

.zoom__close {
  position: fixed;
  top: 18px;
  right: var(--gap);
  z-index: 2;
  padding: 6px 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.zoom__close:hover { text-decoration: underline; text-underline-offset: 3px; }

.zoom__stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--zoom-gap);
  padding: 56px var(--gap) 0;
  min-height: 0;
}
.zoom__stage figure { margin: 0; flex: 0 1 auto; }
.zoom__stage img {
  width: min(44vw, 76dvh);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  cursor: zoom-out;
}
.zoom__stage.is-single img { width: min(70vw, 76dvh); }

.zoom__info {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 8px var(--gap) 40px;
  text-align: center;
}
.zoom__info p { margin: 0; }
.zoom__desc { color: var(--muted); }

.sizes { display: flex; gap: 6px; }
.sizes button {
  min-width: 40px;
  padding: 7px 8px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.sizes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.buy {
  min-width: 220px;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.buy:hover { background: var(--paper); color: var(--ink); }
.buy__note { min-height: 1.6em; color: var(--muted); }

/* the text fades in behind the flying image (the back photo has its own entrance: ::view-transition) */
.zoom__info,
.zoom__close { transition: opacity 0.35s var(--ease), transform 0.45s var(--ease); }
.zoom:not(.is-settled) .zoom__info,
.zoom:not(.is-settled) .zoom__close { opacity: 0; transform: translateY(8px); }
.zoom.is-settled .zoom__info { transition-delay: 0.16s; }


@media (max-width: 700px) {
  .zoom__stage {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--zoom-gap);
    padding: 56px 0 0;
    scrollbar-width: none;
  }
  .zoom__stage::-webkit-scrollbar { display: none; }
  .zoom__stage figure { flex: 0 0 100%; scroll-snap-align: center; }
  .zoom__stage img,
  .zoom__stage.is-single img { width: 100%; }
  .zoom__dots { display: flex; justify-content: center; gap: 6px; padding-top: 6px; }
  .zoom__dots span { width: 5px; height: 5px; border: 1px solid var(--ink); border-radius: 50%; }
  .zoom__dots span.is-on { background: var(--ink); }
}
@media (min-width: 701px) { .zoom__dots { display: none; } }
@media (max-width: 700px) { :root { --zoom-gap: 0px; } }

body.is-locked { overflow: hidden; }
html { scrollbar-gutter: stable; } /* locking the page scroll must not shift the layout */

/* zoom morph (View Transitions API, javascripts/fomo-shop.js): the shirt flies, the rest cross-fades */
::view-transition-group(fomo-shirt) { animation-duration: 0.5s; animation-timing-function: var(--ease); }
/* the front lies on top of the back: the back slides out from under it. This reads only with cut-out
   photos (transparent background): a white square would hide the back until it clears the square. */
::view-transition-group(fomo-shirt) { z-index: 2; }
::view-transition-group(fomo-back) { z-index: 1; }
/* opening: hidden under the front until the shirt has landed, then shoots out to its place */
::view-transition-new(fomo-back) { animation: fomo-back-out 0.5s var(--ease) 0.32s both; }
/* closing: slides back under the front first, then the shirt flies home */
::view-transition-old(fomo-back) { animation: fomo-back-in 0.22s cubic-bezier(0.5, 0, 0.75, 0) both; }
html.fomo-vt-close::view-transition-group(fomo-shirt),
html.fomo-vt-close::view-transition-old(fomo-shirt),
html.fomo-vt-close::view-transition-new(fomo-shirt) { animation-delay: 0.18s; }
/* closing, the rest mirrors the opening: the zoom view's text goes at once, the shop (logo, tiles,
   footer) fades in while the shirt flies home, not before it has left */
html.fomo-vt-close::view-transition-old(root) { animation-duration: 0.18s; }
html.fomo-vt-close::view-transition-new(root) { animation-delay: 0.18s; animation-duration: 0.5s; animation-fill-mode: both; }
@keyframes fomo-back-out {
  0% { opacity: 0; transform: translateX(calc(-100% - var(--zoom-gap))); }
  1% { opacity: 1; transform: translateX(calc(-100% - var(--zoom-gap))); }
  100% { opacity: 1; transform: none; }
}
@keyframes fomo-back-in {
  0% { opacity: 1; transform: none; }
  99% { opacity: 1; transform: translateX(calc(-100% - var(--zoom-gap))); }
  100% { opacity: 0; transform: translateX(calc(-100% - var(--zoom-gap))); }
}
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }
/* focus moved by the script after a mouse or finger zoom: no keyboard ring */
.is-quiet-focus:focus { outline: none; }
.item.is-quiet-focus:focus:not(:hover) .item__name { text-decoration: none; }

/* ---------- footer ---------- */
.site-foot {
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: clamp(72px, 14vh, 160px) var(--gap) 40px;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 12px clamp(20px, 4vw, 48px); }
.site-foot nav { display: flex; gap: clamp(20px, 4vw, 48px); }
.site-foot nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.site-foot nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

.signup { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.signup label { width: 100%; text-align: center; color: var(--muted); }
.signup input {
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  font: inherit;
  font-size: 16px;            /* no iOS zoom on focus */
  text-transform: none;
  letter-spacing: 0;
}
.signup button { padding: 8px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.legal { color: var(--muted); }
.withdraw { margin: 40px 0 0; text-align: center; }
.withdraw-link { display: inline-block; padding: 8px 14px; border: 1px solid var(--ink); }
.withdraw-link:hover { background: var(--ink); color: var(--paper); }

/* ---------- text pages ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 0 var(--gap); }
.page h1 { margin: 0 0 32px; font-size: inherit; font-weight: 400; text-align: center; }

.team { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px clamp(14px, 2vw, 28px); max-width: 1200px; margin: 0 auto; padding: 0 var(--gap); }
@media (max-width: 700px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.person__photo { aspect-ratio: 4 / 5; background: #f2f2f2; display: grid; place-items: center; color: var(--muted); }
.person h2 { margin: 12px 0 4px; font-size: inherit; font-weight: 400; }
.person p { margin: 0; color: var(--muted); text-transform: none; }

.terms { text-transform: none; font-size: 12px; line-height: 1.7; }
.terms h2 { margin: 36px 0 10px; font-size: 11px; font-weight: 400; text-transform: uppercase; }
.terms p { margin: 0 0 10px; }
.terms .tbd { border-bottom: 1px dashed var(--ink); }

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

/* ============================================================
   VOOG SITE ADDITIONS (not in prototype/style.css)
   The shop grid is filled by javascripts/fomo-shop.js; the cart link, the Voog sign-up form, the
   product page, the team slots and editor-only tweaks live here.
   ============================================================ */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.shop__message { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); }

/* sold-out and unavailable sizes, the buy button when a shirt is sold out */
.sizes button:disabled { color: var(--muted); border-color: var(--muted); text-decoration: line-through; cursor: default; }
.buy:disabled { background: var(--paper); color: var(--muted); border-color: var(--muted); cursor: default; }
.zoom__info h1 { margin: 0; font-size: inherit; font-weight: 400; }

/* the zoom view as a Voog product page (layouts/Product.tpl) */
.zoom--page { position: static; visibility: visible; overflow: visible; display: block; }
.zoom--page .zoom__close { display: none; }
.zoom--page .zoom__stage img { cursor: default; }
.zoom--page .zoom__stage { padding-top: 0; }

/* footer: cart link as a menu item, Voog form for the drop sign-up */
.site-foot .cart-link { display: none; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.site-foot .cart-link:disabled { cursor: default; }
html.fomo-cart-has-items .site-foot .cart-link { display: inline; }
.site-foot .cart-link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.site-foot .powered { color: var(--muted); }
.site-foot .powered:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.signup-area { text-align: center; }
.signup-area form { display: block; }
/* Voog's form markup: .form_area > (.form_fields > .form_field > label + input) + .form_submit.
   Narrow screens: the label on its own centred row, the field and OK under it. Wide screens: the whole
   footer is one row (below). The field uses the footer's own type: same size, capitals. */
.signup-area .form_area { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 8px; }
.signup-area .form_fields,
.signup-area .form_field { display: contents; }
.signup-area .form_field_label,
.signup-area .form_error,
.signup-area .form_notice { flex: 0 0 100%; text-align: center; }
.signup-area .form_submit { display: flex; }
.signup-area .form_submit input { margin: 0; }
.signup-area label,
.signup-area p { margin: 0; color: var(--muted); }
.signup-area input[type="text"],
.signup-area input[type="email"] {
  width: 220px; margin: 0; padding: 5px 8px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); font: inherit; font-size: 16px; /* phones: smaller text makes iOS zoom in on focus */
  line-height: 1.2; letter-spacing: inherit; text-transform: uppercase;
}
.signup-area input::placeholder { color: var(--muted); opacity: 1; text-transform: uppercase; }
.signup-area input[type="submit"],
.signup-area button { padding: 0 14px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font: inherit; letter-spacing: inherit; text-transform: uppercase; cursor: pointer; }
@media (min-width: 701px) {
  .signup-area input[type="text"],
  .signup-area input[type="email"] { padding: 3px 8px; font-size: inherit; line-height: 1.6; }
}
@media (min-width: 1000px) {
  .site-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px 56px; }
  .signup-area .form_area { flex-wrap: nowrap; }
  .signup-area .form_field_label { flex: 0 0 auto; align-self: center; margin-right: 8px; white-space: nowrap; }
}

/* ---------- shop on a desktop screen: logo, shirts and footer on one screen ----------
   When the shop is a single row (three products or fewer) and the window is at least 1000 x 560, the
   page is exactly one screen high, so the drop-list form is visible without scrolling. The logo and
   the footer keep their natural height (with smaller margins) and the shirts take what is left: main
   is a size container, and the grid narrows until its square tiles plus the name line (28px, its
   bottom margin removed) fit main's height (100cqh). The tiles stay square, so the zoom morph is
   unchanged. With more products or a lower window the page scrolls as before. Public view only: the
   editor keeps the scrolling page. */
@supports (height: 1cqh) and selector(:has(a)) {
  @media (min-width: 1000px) and (min-height: 560px) {
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) { height: 100dvh; }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) .masthead {
      padding-top: clamp(28px, 6vh, 96px);
      padding-bottom: clamp(20px, 4vh, 64px);
    }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) .masthead img { width: clamp(220px, min(44vw, 64vh), 600px); }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) main {
      flex: 1 1 0;
      min-height: 0;
      container-type: size;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) .shop {
      width: 100%;
      max-width: min(1440px, calc(3 * (100cqh - 30px) + 4 * var(--gap)));
    }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) .item__name { margin-bottom: 0; }
    html.public body.shop-page:not(:has(.shop > .item:nth-child(4))) .site-foot {
      padding-top: clamp(24px, 5vh, 80px);
      padding-bottom: clamp(20px, 4vh, 40px);
    }
  }
}

/* ---------- zoom view and product page on a desktop screen: photos, text and buy button on one screen
   The text block keeps its natural height and the photos take what is left: the photo row is a size
   container (its grid row is 1fr, so it gets the height the text leaves) and each photo is at most
   that high (100cqh, minus the 56px stage top padding under the close button) and still at most
   44vw (70vw alone). The product page (layouts/Product.tpl, for direct links) puts the small logo and
   the product on the first screen; main is one screen minus the logo block, so the footer starts
   right below the fold (the formula repeats the .masthead--small sizes: keep them in step). Windows
   lower than 560px and phones keep the old sizes and scroll. */
@supports (height: 1cqh) and selector(:has(a)) {
  @media (min-width: 701px) and (min-height: 560px) {
    .zoom:not(.zoom--page) > :has(> .zoom__stage) { container-type: size; }
    .zoom:not(.zoom--page) .zoom__stage { height: 100%; }
    .zoom__stage img { width: min(44vw, 76dvh, 100cqh - 56px); }
    .zoom__stage.is-single img { width: min(70vw, 76dvh, 100cqh - 56px); }
    .zoom__info { gap: 12px; padding-bottom: clamp(20px, 4vh, 40px); }

    html.public body.product-page .masthead { padding-top: clamp(28px, 6vh, 96px); padding-bottom: clamp(16px, 3vh, 48px); }
    html.public body.product-page main {
      flex: none;
      height: calc(100dvh - clamp(28px, 6vh, 96px) - clamp(150px, 22vw, 280px) * 189.11 / 704.62 - clamp(16px, 3vh, 48px));
      display: grid;
    }
    html.public body.product-page .zoom--page { display: grid; grid-template-rows: 1fr auto; min-height: 0; }
    html.public body.product-page .zoom--page > :has(> .zoom__stage) { container-type: size; }
    html.public body.product-page .zoom--page .zoom__stage { height: 100%; }
    html.public body.product-page .zoom--page .zoom__stage img { width: min(44vw, 100cqh); }
    html.public body.product-page .zoom--page .zoom__stage.is-single img { width: min(70vw, 100cqh); }
  }
}

/* text pages: the editor's headings and paragraphs inside .terms */
.terms h1, .terms h3 { margin: 36px 0 10px; font-size: 11px; font-weight: 400; text-transform: uppercase; }
.terms a { text-decoration: underline; text-underline-offset: 3px; }

/* team slots (layouts/Team.tpl): photo and text content areas */
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__photo:empty { min-height: 0; }
.person__text > :first-child { margin: 12px 0 4px; font-size: inherit; font-weight: 400; color: var(--ink); text-transform: uppercase; }
.person__text p { margin: 0; color: var(--muted); text-transform: none; }

/* editor only: keep Voog's content area chrome from collapsing the empty slots */
.editmode .person__photo { min-height: 120px; }
.editmode .site-foot .signup-area { min-height: 40px; outline: 1px dashed var(--muted); }

/* Voog chrome that does not belong to the design: the trial banner (shown to the site owner while the
   site is on a trial plan), Voog's own shopping-cart button and bar (FOMO has its own cart), and the
   reCAPTCHA badge of the Voog forms (attribution is in the terms, section 6). */
.edy-header-message-container { display: none !important; }
body.edy-header-message-visible { padding-top: 0 !important; }
.edy-ecommerce-shopping-cart-button,
.edy-ecommerce-shopping-cart-bar { display: none !important; }
.grecaptcha-badge { visibility: hidden !important; }
