/* THE 14 HOME (remus/site-14). Sits on css/shop.css and css/site12.css and uses their tokens only:
   MAT ground, BONE type, TIDE, EMBER, FLUSH, and PANEL, LINE and DIM as quiet tints. Exo 2 at 900 for the few big
   words, Space Mono for the small ones. Every picture of a garment is its print file lit on the cloth (img/home/*.webp);
   the app is the app's own frames on an iPhone. Motion is transform, opacity and clip-path, driven by the reader's own
   scroll or touch; none of it runs under prefers-reduced-motion, and the page is whole without JavaScript too. */

.h14 { --big: 900; --ease: cubic-bezier(.16, 1, .3, 1); --snap: cubic-bezier(.3, 1.45, .45, 1); }
.h14-main { overflow-x: clip; }

/* -- the header: on the home the small mark waits until the big one has gone by ------------------------------ */
.h14 .top { background: rgba(10, 10, 12, .78); }
.h14 .top .mark { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.h14:not(.past) .top .mark { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.h14 .top .nav { gap: clamp(18px, 5vw, 40px); }
.h14 .top .nav a { font: 700 11px/1 var(--mono); letter-spacing: .18em; color: var(--bone); }
.h14 .top .nav a:hover { color: var(--soft); }

/* the big words are fitted to their measure by js/home14.js; these sizes are that fit, so nothing jumps */
.drift { display: inline-block; will-change: transform; }

/* -- 1 · 2 · 3: the mark, how it is said, what it is ------------------------------------------------------------ */
.hx { padding: clamp(8px, 3vw, 24px) var(--gutter) 0; }
.hx-mark { margin: 0; font-size: inherit; }
.weave { position: relative; display: block; width: 100%; aspect-ratio: 1384 / 1132; touch-action: pan-y; }
.weave img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; }
.weave .row { will-change: transform; }
.weave.strung .weave-base, .weave:not(.strung) .row { visibility: hidden; }

.hx-say { margin: clamp(10px, 2.6vw, 16px) 0 0; font: 400 clamp(13px, 3.6vw, 16px)/1 var(--mono); letter-spacing: .14em; color: var(--soft); }
.hx-words { margin-top: clamp(28px, 8vw, 48px); }
.hx-line { margin: 0; font: var(--big) 20.1vw/.86 var(--ui); letter-spacing: -.035em; text-transform: uppercase; }
.hx-line .ln { display: block; overflow: hidden; padding-bottom: .04em; margin-bottom: -.04em; }
.hx-line .ln > span { display: inline-block; }

@media (min-width: 900px) {
    .hx { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 clamp(32px, 4vw, 72px); align-items: end; align-content: center;
          min-height: calc(100svh - var(--head)); padding-top: 24px; padding-bottom: clamp(72px, 14vh, 160px); max-width: 1600px; margin: 0 auto; box-sizing: border-box; }
    .hx-id { align-self: end; position: relative; }   /* the knit's box and REPEAT. share one bottom (Ric 2026-11-24: "same bottom alignment" on a desk) */
    .hx-id .hx-say { position: absolute; left: 0; top: 100%; }   /* /arz/ hangs under the mark, outside the shared bottom */
    .weave { width: min(100%, calc((100svh - var(--head) - 200px) * 1.2226)); }   /* the pair sits high in the hero, not at the screen's foot (Ric 2026-11-24) */
    .hx-words { margin: 0; padding-bottom: 0; }
    .hx-line { font-size: 7.1vw; }
}

/* -- the Zzzs: small FLUSH z rise out of the line into the hero, sway, grow a little and go (Ric 2026-11-24). js/home14.js
   makes a few and recycles them; transform and opacity only, nothing to click, none without script or under reduced
   motion, and paused off screen. They come out of the lockup (Ric 2026-11-24: "closer to the Roll. Recover. Repeat.
   lockup"): from the black just past ROLL., a short rise over it, never across a word and never into the knit. */
@media (max-width: 899px) { .weave { width: 84%; } }
.hx { position: relative; }
.zz { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.zz i { position: absolute; left: 0; top: 0; display: block; opacity: 0; color: var(--flush); will-change: transform, opacity; }
.zz svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* -- 4 · the app: the voice line once, as a poster; the app on an iPhone, the Z rising; the door under it ------ */
.ap { margin-top: clamp(96px, 26vw, 200px); }
.stamp { margin: 0; padding: 0 var(--gutter); font: var(--big) 29.8vw/.8 var(--ui); letter-spacing: -.04em; text-transform: uppercase; color: var(--bone); white-space: nowrap; }
.stamp .st { display: block; transform-origin: 30% 60%; }
.stamp .st:first-child .drift { transform: translate3d(calc((.5 - var(--s, .5)) * 6%), 0, 0); }
.stamp .st + .st .drift { transform: translate3d(calc((var(--s, .5) - .5) * 6%), 0, 0); }

.ap-col { width: min(76vw, 340px); margin: clamp(28px, 8vw, 48px) auto 0; }
.device { position: relative; margin: 0; padding: 3.2%; border-radius: 15.5% / 7.2%; background: var(--panel);
          box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px #000, 0 30px 80px -30px rgba(0, 0, 0, .9); }
.glass { position: relative; overflow: hidden; aspect-ratio: 660 / 1434; border-radius: 12.4% / 5.75%; background: var(--ground); isolation: isolate; }
.glass .zf { position: absolute; inset: 0; width: 100%; height: 100%; }
.glass .zf:not(.z5) { opacity: 0; }
.island { position: absolute; z-index: 2; left: 50%; top: 1.6%; width: 29%; height: 3.3%; transform: translateX(-50%); border-radius: 99px; background: var(--ground); }

.store { display: grid; place-items: center; align-content: center; gap: 3px; height: 62px; margin-top: 18px; border: 1.5px solid var(--bone);
         border-radius: 14px; background: var(--ground); color: var(--bone); transition: background .2s, color .2s; }
.store small { font: 700 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
.store b { font: 700 24px/1 var(--ui); letter-spacing: -.01em; }
.store:hover { background: var(--bone); color: var(--ground); }

@media (min-width: 900px) {
    .ap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(32px, 5vw, 96px);
          max-width: 1600px; margin: clamp(120px, 14vw, 200px) auto 0; padding: 0 var(--gutter); box-sizing: border-box; }
    .stamp { padding: 0; font-size: 17vw; }
    .ap-col { width: min(360px, calc((100svh - var(--head) - 150px) * .4335)); margin: 0; }
}

/* -- 5 · 6: the garments, each named once, its code beside it, every frame the same straight-on view on one grid ------------- */
.gx { margin-top: clamp(104px, 28vw, 200px); }
.gx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 var(--gutter); margin-bottom: clamp(20px, 5vw, 36px); }
.gx-name { margin: 0; font: var(--big) 14.4vw/.8 var(--ui); letter-spacing: -.035em; text-transform: uppercase; white-space: nowrap; }
#rugby .gx-name, #yours .gx-name { font-size: 26.4vw; }
/* the anchored range's one line per offering (DRAFT, remus/anchor-range 2026-11-25): what it is, when, what it costs */
.gx-terms { margin: clamp(14px, 3.6vw, 22px) 0 0; padding: 0 var(--gutter); font: 700 11px/1.5 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone); }
#yours .gx-head { margin-bottom: 0; }
.gx-code { flex: none; font: 700 11px/1 var(--mono); letter-spacing: .2em; color: var(--soft); padding-bottom: .3em; writing-mode: vertical-rl; transform: rotate(180deg); }

.grid { display: grid; gap: clamp(40px, 11vw, 64px); }
.pr { margin: 0; }
.pr figcaption { margin: 0 var(--gutter) 12px; font: 700 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }
.pr figcaption b { color: var(--bone); margin-right: .9em; }
.shot { position: relative; overflow: hidden; aspect-ratio: 8 / 7; background: var(--ground); }   /* the 4:5 straight-on render, its MAT margin trimmed; the garment (y 17 to 83%) is whole */
.shot img { position: absolute; left: 0; top: 50%; width: 100%; height: auto; transform: translateY(-50%) scale(calc(1.04 - .04 * var(--p, 1))); transform-origin: 50% 50%; }   /* cropped by its box, never squashed */

@media (min-width: 600px) {
    .grid.two { grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px) clamp(16px, 2.4vw, 32px); padding: 0 var(--gutter); }
    .grid.two .pr figcaption { margin-left: 0; margin-right: 0; }
    .grid.two .wide { grid-column: 1 / -1; justify-self: center; width: calc((100% - clamp(16px, 2.4vw, 32px)) / 2); }   /* a one-up frame is exactly one column of the pair, so every garment on the page is the same size (Ric 2026-11-24: "the 1 up garments are humungous, max size those containers") */
}
@media (min-width: 900px) {
    .gx { max-width: 1200px; margin-left: auto; margin-right: auto; }
    .gx-name, #rugby .gx-name, #yours .gx-name { font-size: 13.4vw; }
    .gx-code { writing-mode: horizontal-tb; transform: none; font-size: 12px; padding-bottom: .6em; }
}

.h14 .foot { margin-top: clamp(80px, 20vw, 160px); }

/* -- motion, only where it is welcome and only once JavaScript is here to finish it ---------------------------- */
@media (prefers-reduced-motion: no-preference) {
    .js .hx-line .ln > span { transform: translateY(104%); transition: transform .9s var(--ease); }
    .js .hx-line .ln:nth-child(1) > span { transition-delay: .55s; }
    .js .hx-line .ln:nth-child(2) > span { transition-delay: .65s; }
    .js .hx-line .ln:nth-child(3) > span { transition-delay: .75s; }
    .js .hx-say { opacity: 0; transition: opacity .7s var(--ease) 1.1s; }
    .js .woven .hx-say { opacity: 1; }
    .js .woven .hx-line .ln > span { transform: none; }
    .js .hx:not(.woven) .weave-base { opacity: 0; }

    .js .stamp .st { opacity: 0; transform: scale(1.6) rotate(-6deg); }
    .js .stamp.in .st { animation: stamp .42s var(--snap) forwards; }
    .js .stamp.in .st + .st { animation-delay: .16s; }

    /* the Z: rest, rise, rise, then the peak, which it holds; the rest frame waits until the phone is in view */
    .js .glass .zf:not(.z5) { opacity: 1; }
    .js .device.in .z1 { animation: zout .2s linear .35s forwards; }
    .js .device.in .z3 { animation: zout .2s linear .7s forwards; }
    .js .device.in .z4 { animation: zout .25s linear 1.05s forwards; }

    .js .pr .shot { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--ease); }
    .js .pr.in .shot { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) { .drift { transform: none !important; } .shot img { transform: translateY(-50%) !important; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.6) rotate(-6deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes zout { to { opacity: 0; } }

/* -- the knit, live: js/weave.js draws the app's own cloth on a canvas under the hero, the mark on the picture's box and the
   cloth's rows spilling full width past it. The picture stays for a browser with no script; once the canvas is drawing it
   is kept only for its box. The words sit over the cloth. */
.weave-cv { position: absolute; top: -40px; left: 0; z-index: 0; pointer-events: none; }
.weave.live img { visibility: hidden; }
.weave-live .hx-id, .weave-live .hx-words { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
    .weave-live .woven .hx-line .ln:nth-child(1) > span { transition-delay: .15s; }
    .weave-live .woven .hx-line .ln:nth-child(2) > span { transition-delay: .24s; }
    .weave-live .woven .hx-line .ln:nth-child(3) > span { transition-delay: .33s; }
    .weave-live .woven .hx-say { transition-delay: .1s; }
}
/* on a phone the hero is the first screen and nothing else: the knit at the top, the line at the foot, the next
   section below the fold, so the intro has the glass to itself (remus/site-16) */
@media (max-width: 899px) {
    .weave-live .hx { min-height: calc(100svh - var(--head)); display: flex; flex-direction: column; justify-content: space-between;
        box-sizing: border-box; padding-top: clamp(16px, 4svh, 40px); padding-bottom: clamp(16px, 3svh, 32px); }
    .weave-live .ap { margin-top: clamp(64px, 18vw, 120px); }
}
.weave-kv { position: absolute; left: -14px; top: -14px; pointer-events: none; }

/* -- Dec 1: the site line under the mantra, and the companion's line under the glass (Ric's picks from a sheet). -- */
.hx-sub { margin: clamp(16px, 4vw, 28px) 0 0; font: 400 clamp(16px, 4.4vw, 22px)/1.4 var(--ui); color: var(--soft); max-width: 30ch; }
.ap-say { margin: clamp(18px, 5vw, 28px) 0 clamp(14px, 4vw, 22px); font: 400 clamp(15px, 4vw, 18px)/1.5 var(--ui); color: var(--bone); }
