/* The castomo ecosystem footer (app/footer.js), ported from castomo.com's footer CSS. castomo.com's tokens are mapped to
   this page's (app/looks.css :root) and set on .foot only, so nothing leaks into the rest of the page. castomo.com sets
   its root font at 17px, so its rem sizes are given here in 17px units to keep the same type sizes. Directions are
   logical (inline-start/end) and the few physical transforms (arrows, the hue bar's growth) are mirrored under
   :dir(rtl), because the page gets right-to-left languages through <html dir="rtl">. */
.foot {
  --ink-3: var(--mute); --rule: rgba(27, 23, 18, .15); --rule-w: 1px; --paper-2: var(--card);
  --field: color-mix(in srgb, var(--ink) 7%, var(--paper));
  --accent: var(--bronze); --accent-ink: var(--bronze); --fill-hover: var(--bronze); --on-fill: #fff;
  --btn-bg: var(--ink); --btn-fg: var(--paper);
  --shadow: 0 1px 2px rgba(27, 23, 18, .06), 0 12px 32px -16px rgba(27, 23, 18, .25);
  --radius: 14px; --radius-pill: 999px;
  --t-1: calc(.875 * 17px); --t0: calc(1.0625 * 17px); --t2: calc(1.5625 * 17px); --t3: calc(1.95 * 17px);
  --ease: cubic-bezier(.2, .7, .2, 1); --dur: .18s; --spring: cubic-bezier(.34, 1.56, .64, 1);
  margin-top: clamp(64px, 10vw, 120px); border-top: var(--rule-w) solid var(--rule); background: var(--paper-2);
  padding: clamp(40px, 6vw, 64px) 0 32px; font-size: var(--t-1); line-height: 1.6; color: var(--ink-2); overflow-x: clip;
  content-visibility: auto; contain-intrinsic-size: auto 1200px;
}
.foot:empty { display: none; } /* until app/looks.js has rendered it */
.foot .wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

/* the brand column and the four link columns */
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
@media (max-width: 1080px) { .foot-grid { grid-template-columns: repeat(3, 1fr); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 600px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 370px) { .foot-grid { grid-template-columns: 1fr; } }
.foot h2 { font-size: var(--t-1); font-weight: 600; color: var(--ink); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li + li { margin-top: 8px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-brand .brand { margin-bottom: 12px; }
.foot-brand p { max-width: 30ch; }
.foot-help { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 20px; }

/* castomo.com's buttons */
.foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border-radius: var(--radius-pill); border: var(--rule-w) solid transparent; font-weight: 600; font-size: var(--t-1); line-height: 1.2; text-decoration: none; transition: transform var(--dur) var(--ease), background var(--dur), color var(--dur); }
.foot .btn:hover { transform: translateY(-1px); }
.foot .btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.foot .btn-primary:hover { background: var(--fill-hover); color: var(--on-fill); }
.foot .btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.foot .btn-ghost:hover { background: var(--field); color: var(--ink); }
.foot .btn svg { width: 18px; height: 18px; stroke-width: 2; }
.foot .btn .btn-ico { margin-inline-end: 1px; }

/* castomo.com's line icons and their hover motions (named by data-motion) */
.foot .ci { width: var(--ci-size, 24px); height: var(--ci-size, 24px); flex: none; overflow: visible; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: var(--ci-stroke, 1.6); stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 50%; }
.foot .ci[data-motion="pop"] { --ci-anim: foot-pop; --ci-dur: .5s; --ci-timing: var(--spring); }
.foot .ci[data-motion="wiggle"] { --ci-anim: foot-wiggle; --ci-dur: .6s; }
.foot .ci[data-motion="float"] { --ci-anim: foot-float; --ci-dur: 1.8s; --ci-timing: ease-in-out; }
.foot :is(a, button):is(:hover, :focus-visible) .ci[data-motion], .foot .ci[data-motion]:hover { animation: var(--ci-anim) var(--ci-dur, .7s) var(--ci-timing, var(--ease)) both; }
.foot-js .ci-draw:not(.ci-in) { stroke-dasharray: 1; stroke-dashoffset: 1; } /* app/footer.js adds ci-in when in view */
.foot .ci-draw.ci-in { stroke-dasharray: 1; animation: foot-draw 1.4s var(--ease) both; }
@keyframes foot-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes foot-pop { 0% { transform: none; } 50% { transform: scale(1.22); } 100% { transform: none; } }
@keyframes foot-wiggle { 0%, 100% { transform: none; } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@keyframes foot-float { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
@keyframes foot-mk-pop { 0% { opacity: 0; transform: scale(.45); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.foot-fam-ico { color: var(--accent-ink); --ci-stroke: .8; }

/* the two shelves: centred headings, then a full-bleed row of product cards that scrolls round endlessly */
.foot-family { position: relative; margin-top: clamp(48px, 7vw, 80px); padding-top: clamp(32px, 5vw, 48px); border-top: var(--rule-w) solid var(--rule); text-align: center; }
.foot-family + .foot-family { margin-top: clamp(8px, 2vw, 24px); padding-top: 0; border-top: 0; }
/* castomo.com's card-mark rule (.foot-family svg) also sizes these, so they are as big as the marks, not 40px */
.foot-family .foot-fam-ico { display: block; width: clamp(96px, 11vw, 100px); height: auto; aspect-ratio: 1; margin: 0 auto 6px; }
.foot-family h2 { font-size: var(--t3); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; text-transform: none; color: var(--ink); margin: 0 0 clamp(16px, 2.5vw, 28px); text-wrap: balance; }
.foot-family h2 span { display: block; margin-top: 6px; color: var(--ink-3); }
.foot-family ul { display: flex; gap: 20px; margin: 0 calc(50% - 50vw); padding: 12px calc(50vw - 50%) 28px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0; scrollbar-width: none; }
.foot-family ul::-webkit-scrollbar { display: none; }
.foot-family li { flex: 0 0 min(298px, 65.6vw); margin: 0; scroll-snap-align: center; }
.foot-family li + li { margin-top: 0; }
.foot-family a { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; justify-items: start; height: 100%; min-height: clamp(304px, 40vh, 368px); padding: clamp(24px, 3vw, 34px); overflow: hidden; color: var(--ink-2); background: rgba(1, 1, 1, .001); border: var(--rule-w) solid rgba(1, 1, 1, .001); box-shadow: var(--shadow); border-radius: calc(var(--radius) * 1.5); transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.foot-family strong { grid-row: 1; justify-self: center; font-size: var(--t-1); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--hue, var(--accent-ink)) 55%, #000); }
.foot-family span { grid-row: 2; margin-top: 10px; font-size: var(--t2); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.foot-family a > svg { grid-row: 3; align-self: center; justify-self: center; width: clamp(96px, 11vw, 100px); height: auto; aspect-ratio: 1; margin: 24px 0; }
.foot-family small { grid-row: 4; justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: var(--rule-w) solid var(--rule); border-radius: var(--radius-pill); font-size: var(--t-1); font-weight: 500; line-height: 1.2; color: var(--ink-2); transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.foot-family small::after { content: ""; display: inline-block; flex: none; width: .9em; height: .9em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform var(--dur) var(--ease); }
/* hover: the card lifts, the product's hue bar grows along its top, the domain pill fills with the hue and the mark's
   parts pop in one after another */
.foot-family a:hover, .foot-family a:focus-visible { color: var(--ink-2); transform: translateY(-4px); background: rgba(1, 1, 1, .031); border-color: rgba(1, 1, 1, .031); }
.foot-family a::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px; background: var(--hue, var(--accent)); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--dur) var(--ease); pointer-events: none; }
.foot-family a:hover::before, .foot-family a:focus-visible::before { transform: scaleX(1); }
.foot-family a:hover small, .foot-family a:focus-visible small { background: var(--hue, var(--accent-ink)); border-color: var(--hue, var(--accent-ink)); color: #fff; font-weight: 700; }
.foot-family a:hover small::after, .foot-family a:focus-visible small::after { transform: translateX(3px); }
.foot-family a > svg:not(.shelf-bg) > * { transform-box: fill-box; transform-origin: center; }
:is(.foot-family a:hover, .foot-family a:focus-visible) > svg:not(.shelf-bg) > * { animation: foot-mk-pop .64s cubic-bezier(.2, .7, .3, 1) both; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(2):nth-last-child(1) { animation-delay: .42s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(2):nth-last-child(2) { animation-delay: .21s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(3):nth-last-child(1) { animation-delay: .42s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(2):nth-last-child(3) { animation-delay: .14s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(3):nth-last-child(2) { animation-delay: .28s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(4):nth-last-child(1) { animation-delay: .42s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(2):nth-last-child(4) { animation-delay: .105s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(3):nth-last-child(3) { animation-delay: .21s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(4):nth-last-child(2) { animation-delay: .315s; }
.foot-family a > svg:not(.shelf-bg) > :nth-child(5):nth-last-child(1) { animation-delay: .42s; }
/* the mark again, large and faint in the card's far corner (app/footer.js clones it) */
.foot-family .shelf-bg { position: absolute; inset-block-end: -18%; inset-inline-end: -18%; width: 74%; height: auto; aspect-ratio: 1; margin: 0; opacity: .08; transform: rotate(-14deg); transition: transform .6s var(--ease), opacity var(--dur) var(--ease); pointer-events: none; }
.foot-family a > :not(.shelf-bg) { position: relative; }
.foot-family a:hover .shelf-bg, .foot-family a:focus-visible .shelf-bg { opacity: .14; transform: rotate(-6deg) scale(1.06); }
@media (prefers-contrast: more) { .foot-family a { --hue: var(--accent-ink) !important; } .foot-family .shelf-bg { display: none; } }
@media (max-width: 600px) { .foot-family ul { gap: 12px; } .foot-family a { min-height: 272px; } }

/* the shelves' previous / next buttons (app/footer.js adds them) */
.shelf-nav { display: flex; justify-content: flex-end; gap: 12px; }
.shelf-nav button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: var(--rule-w) solid var(--rule); border-radius: var(--radius-pill); background: var(--field); color: var(--ink); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.shelf-nav button::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.shelf-nav .shelf-prev::before { transform: scaleX(-1); }
.shelf-nav button:hover { background: var(--ink); color: var(--paper); }

/* right to left: the arrows point the other way and the hue bar grows from the right */
.foot-family a:dir(rtl)::before { transform-origin: 100% 50%; }
.foot-family small:dir(rtl)::after { transform: scaleX(-1); }
.foot-family a:hover small:dir(rtl)::after, .foot-family a:focus-visible small:dir(rtl)::after { transform: scaleX(-1) translateX(3px); }
.shelf-nav .shelf-next:dir(rtl)::before { transform: scaleX(-1); }
.shelf-nav .shelf-prev:dir(rtl)::before { transform: none; }

/* the company's legal line and the foot line */
.foot-legal { margin: 32px 0 0; padding-top: 20px; border-top: var(--rule-w) solid var(--rule); color: var(--ink-3); line-height: 1.7; }
.foot-line { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--ink-3); }
.foot-line a { display: inline-block; padding: 8px 0; }

@media (prefers-reduced-motion: reduce) {
  .foot *, .foot *::before, .foot *::after { transition: none !important; animation: none !important; }
  .foot .ci-draw { stroke-dashoffset: 0 !important; }
}
@media print { .foot { display: none !important; } }
