/* Crow page CSS. The system is the kit in /assets; this file holds only what
   the kit has no part for: the cut-out mats inside tiles, the order card's
   swatches and the cart. */

/* The label type: small, thin, capital and spaced. It is the voice of every
   label on the site (the bar, the buttons, the shelf and section labels, the
   footer); running text stays in the serif, in sentence case. */
:root { --label-track: .16em; }
.nav__link, .btn, .landing__foot h1, .landing__foot .link, .site-foot__col h2, .site-foot__col :is(a, span), .news h2, .news__row button,
.order .hero-copy > .t-small, .cart__head h2, .info__row > h2, .nav-icon__label {
  font-family: var(--font-text); font-size: var(--t-label); font-weight: 400; letter-spacing: var(--label-track); text-transform: uppercase;
}

/* The wordmark is Crow's own script, from the founders' vector file. */
.nav__logo svg { height: 26px; color: var(--ink); }
/* The bar's two words, a step heavier than the other labels. */
.nav .nav__link { font-weight: 500; }

/* The entrance to the home page: the screen starts plain white for half a
   second (so the wordmark does not arrive in the same instant as the white),
   the wordmark fades in slowly, holds, then the whole thing dissolves into the
   page. A fade only, so it runs for everyone; it takes no clicks, and plays
   once a visit. Timeline: 0-500ms white, 500-1200 mark in, hold, 1800-2600 out. */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); pointer-events: none; animation: intro-out 800ms ease-in-out 1800ms both; }
.intro__mark { width: min(46vw, 300px); height: auto; color: var(--ink); animation: intro-mark 700ms ease-in-out 500ms both; }
@keyframes intro-mark { from { opacity: 0; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
.intro-seen .intro { display: none; }

/* Opening the product page (a mat's tile, or any link to it): the link loads a
   whole new page, which used to blink white before the product appeared. The
   browser now holds the old page until the product page is ready and dissolves
   between the two, briefly. A fade only, like the entrance. Every other page
   change is left as it was: the head script in the layout skips the dissolve
   unless the page arrived at is the product page. Browsers that cannot do
   this load the page as before. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; animation-timing-function: ease-out; }

/* The header's icons: the account and the bag, each a 44px target with a 22px
   mark, the pair ending on the page's right line. */
.nav-icon { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity 150ms ease-out; }
@media (hover: hover) { .nav-icon:hover { opacity: .6; } }
.nav-icon:focus-visible { outline: 2px solid var(--action); outline-offset: -4px; }
.nav-icon__label { display: none; }
.nav-icon__count { position: absolute; top: 5px; right: 3px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 600 10px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.nav .nav__actions { gap: 0; margin-right: -11px; }
/* On a phone the icons stay in the bar, beside the menu button. */
@media (max-width: 1023px) {
  .nav.nav--split:not(.is-open) .nav__actions > .nav-icon { display: inline-grid; }
  .nav.nav--split:not(.is-open) .nav__actions { margin-right: 0; }
  /* In the open menu they are two plain words under the links. */
  .nav.is-open .nav__actions > .nav-icon { display: flex; justify-content: center; width: 100%; height: var(--btn-h); font-size: var(--t-body); }
  .nav.is-open .nav__actions { margin-right: 0; }
  .nav.is-open .nav-icon > svg, .nav.is-open .nav-icon__count { display: none; }
  .nav.is-open .nav-icon__label { display: inline; }
}

/* The landing screen: the mat alone, as large as the screen allows, with one
   small line under it. */
.landing > .landing__in { display: flex; flex-direction: column; gap: var(--s-6); }
/* The stage is what the screen leaves after the header, the paddings and the line. */
.landing__stage { flex: none; height: calc(100svh - 256px); min-height: 200px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.landing__mat { grid-area: 1 / 1; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.landing__mat > picture { display: contents; }
.landing__mat img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
/* A wide screen shows the round mat alone, turning slowly on its centre: one
   turn in 15.75 seconds, clockwise, the pace of the founders' spinning film.
   It is a picture, not a link: the shop, one click away, shows both mats. The
   two links below are the phone's, and are not on a wide screen at all. */
.landing__mat--standard, .landing__mat--round { display: none; }
.landing__spin img { max-height: 84%; border-radius: 50%; animation: landing-spin 15.75s linear infinite; }
@keyframes landing-spin { to { rotate: 360deg; } }
/* On a phone the round and the standard mat take turns, each held for three
   seconds and dissolved into the other over one. Only the one in view takes a
   tap. It is a fade alone, so it runs for everyone. */
@keyframes landing-swap {
  0%, 37.5% { opacity: 1; visibility: visible; }
  50%, 87.5% { opacity: 0; visibility: hidden; }
  100% { opacity: 1; visibility: visible; }
}
@media (max-width: 639px) {
  .landing__stage { height: calc(100svh - 200px); }
  .landing__spin { display: none; }
  .landing__mat--standard, .landing__mat--round { display: flex; }
  .landing__mat { animation: landing-swap 8s ease-in-out infinite; }
  .landing__mat--standard { animation-delay: -4s; }
}
.landing__foot { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-5); }
/* The kit gives a hero's text the hero's full height; this line is only as tall
   as its words, or it would lie over the footer and take its clicks. */
.landing > .landing__in > .landing__foot { height: auto; }
.landing__foot h1 { margin: 0; line-height: 1.4; }

/* A cut-out mat in a tile: whole, never cropped, on a panel a shade off the page. */
.lineup .tile__media { background: var(--surface); }
.lineup .tile__media > img { object-fit: contain; padding: 7%; }
/* A tile's name, in the shelf label's small spaced capitals. */
.lineup .tile__head > h3 { font: 400 var(--t-label)/1.4 var(--font-text); letter-spacing: .16em; text-transform: uppercase; }
.lineup { --tile-ratio: 1; }
.lineup.span-6 { --tile-ratio: 5 / 4; }
/* Stacked on a phone: each panel takes its mat's own height, so no gap opens above it. */
@media (max-width: 639px) {
  .lineup.span-6 { --tile-ratio: auto; }
  .lineup .tile__media > img { height: auto; padding: 8% 6%; }
  /* Each name stays close under its own panel, and the next panel starts well below it. */
  .lineup { gap: var(--s-3); }
  .grid > .lineup + .lineup { margin-top: var(--s-7); }
}

/* A shelf's label: the line's name small, capital and spaced, its note at the
   right, on a hairline. */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); font: 400 var(--t-label)/1.4 var(--font-text); letter-spacing: .16em; text-transform: uppercase; }
.shelf-head :is(h1, h2) { margin: 0; font: inherit; letter-spacing: inherit; }
.shelf-head span { color: var(--muted); }

/* A section that is only a few lines is as tall as its lines. */
main > .section.section--short { height: auto; min-height: 0; }

/* The footer: three link columns, then the newsletter. */
.site-foot { border-top: 1px solid var(--line); padding-block: var(--s-8); font-size: var(--t-body); }
.site-foot__in { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.site-foot__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
/* A column's heading stands apart from its links: heavier, on a hairline, with
   room under it. */
.site-foot__col h2, .news h2 { display: block; margin: 0 0 var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); line-height: 1.4; font-weight: 600; color: var(--ink); }
.news__label { display: block; }
.site-foot__col ul { display: grid; }
.site-foot__col :is(a, span) { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
.site-foot__col a { color: var(--ink); }
.site-foot__col span { color: var(--muted); }
@media (hover: hover) { .site-foot .site-foot__col a:hover { text-decoration: underline; text-underline-offset: 4px; } }

.news__row { display: flex; margin-top: var(--s-4); background: var(--surface); }
.news__row input { flex: 1; min-width: 0; height: 52px; padding: 0 var(--s-4); border: 0; background: none; color: var(--ink); font: inherit; }
.news__row input::placeholder { color: var(--muted); opacity: 1; }
.news__row input:focus { outline: none; }
.news__row:focus-within { box-shadow: inset 0 0 0 1px var(--ink); }
.news__row button { height: 52px; padding: 0 var(--s-4); border: 0; background: none; color: var(--ink); cursor: pointer; }
.news__row button:disabled { color: var(--muted); cursor: default; }
.news .form__status { margin-top: var(--s-3); }
@media (max-width: 1023px) {
  .site-foot__in { grid-template-columns: minmax(0, 1fr); }
  .news { max-width: 480px; }
}
/* On a phone the spaced capitals need room: two columns, the third under them. */
@media (max-width: 639px) {
  .site-foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); }
}

/* An information page (the FAQ, shipping and returns): each section is a
   label on the left and its short points on the right, on a hairline. */
.info__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-6); padding-block: var(--s-6); border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.info__row:first-child { padding-top: 0; }
.info__row > h2 { margin: 0; line-height: 1.75; }
.info__row > ul { display: grid; gap: var(--s-2); max-width: 60ch; margin: 0; padding: 0; list-style: none; }
.info__row a { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 767px) {
  .info__row { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding-block: var(--s-5); }
}

/* The order page: the mat whole beside the order card. */
.order__stage { display: grid; grid-template: minmax(0, 100%) / minmax(0, 100%); place-items: start center; min-height: 240px; }
.order .order__stage > .order__img { width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; object-position: center top; animation: order-in 300ms ease-out both; }
@keyframes order-in { from { opacity: 0; } }
/* Stacked (under 1024): the mat comes first, whole, then the order card. The
   page may run past one screen here so nothing is cut. */
@media (max-width: 1023px) {
  .order { height: auto; min-height: 100svh; }
  .order .hero-text { display: flex; flex-direction: column; gap: var(--s-6); }
  .order .hero-split > .order__stage { order: -1; flex: none; height: auto; min-height: 0; }
  .order .order__stage > .order__img { width: 100%; height: auto; max-height: 52svh; }
}

/* The product's name: at the size of a page title, a step under the kit's hero. */
.order h1 { font: 400 var(--t-h3)/1.2 var(--font-text); letter-spacing: var(--label-track); text-transform: uppercase; }
.order__price { font-variant-numeric: tabular-nums; }
.options { border: 0; padding: 0; margin: var(--s-6) 0 0; }
.options + .btn-row { margin-top: var(--s-7); }
/* The order card is in the label type, except the choices (the size and the
   colourway, with their labels), which are read and keep the serif. */
.options legend { padding: 0; font-size: var(--t-small); color: var(--muted); }
.options legend span { color: var(--ink); font-weight: 500; }

/* The size picker: three plain choices, the chosen one filled. */
.sizes { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.size { position: relative; cursor: pointer; }
.size input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; border-radius: var(--r-sm); cursor: pointer; }
.size span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line-strong, rgba(22, 21, 15, .3)); border-radius: var(--r-sm); font-size: var(--t-small); font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out; }
@media (hover: hover) { .size:hover span { border-color: var(--ink); } }
.size, .swatch, .stepper button, .news__row button { -webkit-tap-highlight-color: transparent; }
.size:has(input:checked) span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.size input:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.swatches__row { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.swatch { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; transition: box-shadow 150ms ease-out; }
@media (hover: hover) { .swatch:hover:not(:has(input:checked)) { box-shadow: inset 0 0 0 1px var(--line-strong, rgba(22, 21, 15, .3)); } }
/* The radio itself is the dot, so the keyboard focus lands on something seen. */
.swatch input { appearance: none; -webkit-appearance: none; width: 32px; height: 32px; margin: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px var(--line-strong, rgba(22, 21, 15, .3)); }
.swatch:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.swatch input:focus-visible { outline: 2px solid var(--action); outline-offset: 5px; }

.btn:disabled { opacity: .5; cursor: default; }
.form__status:empty { display: none; }

/* The cart: a panel from the right edge. */
.cart { margin: 0 0 0 auto; padding: 0; border: 0; width: min(100%, 440px); max-width: 100%; height: 100dvh; max-height: none; background: var(--bg, #ffffff); color: var(--ink, #16150f); }
.cart::backdrop { background: rgba(22, 21, 15, .32); }
/* It opens with a transition, so it follows a quick open and close. */
.cart { transition-property: opacity, translate; transition-duration: 260ms; transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
@starting-style { .cart[open] { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) { @starting-style { .cart[open] { translate: 24px 0; } } }
.cart__in { display: flex; flex-direction: column; height: 100%; }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-5); border-bottom: 1px solid var(--line); }
.cart__head h2 { line-height: 1.4; margin: 0; }
.cart__head { padding-block: var(--s-3); }
/* The close mark: a 44px target, pulled out so the mark sits on the panel's edge line. */
.cart__close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -13px; background: none; border: 0; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cart__remove { min-height: 44px; padding: 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: var(--t-small); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .cart__remove:hover, .cart__close:hover { color: var(--ink); } .cart__close:hover { background: var(--surface); } }
.cart__close:focus-visible, .cart__remove:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
/* The page behind an open cart does not scroll. */
html:has(.cart[open]) { overflow: hidden; }
.cart__empty { padding: var(--s-5); }
.cart__lines { flex: 1; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 0 var(--s-5); }
.cart__line { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.cart__thumb { width: 96px; height: 72px; object-fit: contain; }
.cart__name { display: flex; justify-content: space-between; gap: var(--s-4); font-weight: 500; margin: 0; font-variant-numeric: tabular-nums; }
.cart__meta { color: var(--muted); font-size: var(--t-small); margin: var(--s-1) 0 0; }
.cart__controls { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-3); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong, rgba(22, 21, 15, .3)); border-radius: var(--r-sm); }
.stepper button { width: 44px; height: 44px; background: none; border: 0; font: inherit; font-size: 18px; cursor: pointer; transition: background-color 150ms ease-out; }
@media (hover: hover) { .stepper button:hover { background: var(--surface); } }
.stepper button:active { background: var(--line); }
.stepper span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.cart__foot { padding: var(--s-5); padding-bottom: max(var(--s-5), env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: var(--s-2); }
.cart__foot .btn { width: 100%; margin-top: var(--s-3); }

/* On a phone the two actions are two full-width buttons, one filled, one outlined. */
@media (max-width: 639px) {
  .order .hero-copy { width: 100%; max-width: none; }
  .order .order__actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); width: 100%; }
  .order .order__actions .btn { width: 100%; height: 52px; }
  html .order .order__actions .btn--secondary { background: transparent; border: 1px solid var(--ink); text-decoration: none; }
  .cart__line { grid-template-columns: 88px minmax(0, 1fr); }
  .cart__thumb { width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .order .order__stage > .order__img { animation: none; }
  /* The turning mat is movement, not a fade: it stays still. */
  .landing__spin img { animation: none; }
}
