/* AInak web motion system v1: tokens, base styles and component CSS.
   Colours and fonts mirror brand/tokens.css (brand guide v1.2). Change brand values there first. */

@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url("../assets/fonts/rubik-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url("../assets/fonts/rubik-800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; font-weight: 100 900; font-display: swap; src: url("../assets/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* brand (same names and values as brand/tokens.css) */
  --ainak-main: #F7A51F;
  --ainak-hover: #FFC353;
  --ainak-pale: #FEF3D6;
  --ainak-background: #FAF7F2;
  --ainak-sand: #EDE5D8;
  --ainak-dark: #2C3C4A;
  --ainak-text: #1F140C;
  --ainak-orange-text: #A36B00;
  --ainak-white: #FFFFFF;
  --ainak-font-display: "Rubik", system-ui, sans-serif;
  --ainak-font-body: "Outfit", system-ui, sans-serif;
  --ainak-radius-card: 24px;
  --ainak-radius-input: 12px;
  --ainak-radius-chip: 8px;

  /* motion tokens (mirrored in ainak-web.js, see motion-rules.md) */
  --am-ease-out: cubic-bezier(.22, 1, .36, 1);
  --am-ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --am-dur-xs: 180ms;
  --am-dur-s: 350ms;
  --am-dur-m: 600ms;

  /* layout */
  --am-gutter: clamp(16px, 4vw, 56px);
  --am-nav-h: 64px;
  --am-soft: rgba(31, 20, 12, .64);      /* Text at 64%: secondary copy on light grounds */
  --am-line: rgba(31, 20, 12, .12);      /* Text at 12%: hairlines */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ainak-background);
  color: var(--ainak-text);
  font: 400 16px/1.5 var(--ainak-font-body);
  overflow-x: clip;                      /* clip, not hidden: hidden would break position: sticky */
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

.am-h1 { font: 800 clamp(40px, 5.2vw, 72px)/1.03 var(--ainak-font-display); letter-spacing: -.022em; text-wrap: balance; }
.am-h2 { font: 800 clamp(30px, 3.4vw, 48px)/1.08 var(--ainak-font-display); letter-spacing: -.018em; text-wrap: balance; }
.am-h3 { font: 800 24px/1.15 var(--ainak-font-display); letter-spacing: -.01em; }
.am-lead { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; color: var(--am-soft); max-width: 46ch; text-wrap: pretty; }
.am-on-dark { color: var(--ainak-white); }
.am-on-dark .am-lead { color: var(--ainak-pale); }

/* ---------- nav ---------- */
.am-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--am-nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--am-gutter);
}
.am-nav__logo img { height: 26px; width: auto; }
.am-nav--pill {
  inset: 12px var(--am-gutter) auto var(--am-gutter); height: 56px; padding: 0 8px 0 20px;
  background: var(--ainak-white); border-radius: 999px; box-shadow: 0 1px 0 var(--am-line);
}
/* glass: the page shows through, blurred. The one place backdrop-filter is allowed (see motion-rules.md). */
.am-nav--glass {
  max-width: 1232px; margin: 0 auto;
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .5), 0 12px 32px -16px rgba(31, 20, 12, .35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .am-nav--glass { background: rgba(255, 255, 255, .94); } }
/* liquid island: clear glass with a bright edge that takes the tint of the band below; shrinks to a small pill once you scroll.
   Needs the small script in the page that sets .is-small and data-tone. Static backdrop-filter only (see motion-rules.md). */
.am-nav--liquid {
  max-width: 1232px; margin: 0 auto; --nav-tint: rgba(255, 255, 255, .32);
  background: var(--nav-tint); -webkit-backdrop-filter: blur(10px) saturate(1.9) brightness(1.05); backdrop-filter: blur(10px) saturate(1.9) brightness(1.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -1px 1px rgba(255, 255, 255, .35), inset 0 0 0 1px rgba(255, 255, 255, .35), inset 0 0 18px rgba(255, 255, 255, .22), 0 10px 30px -14px rgba(31, 20, 12, .35);
  transition: max-width .55s var(--am-ease-out), height .55s var(--am-ease-out), top .55s var(--am-ease-out), background-color .35s var(--am-ease-out), color .35s var(--am-ease-out);
}
.am-nav--liquid .am-nav__logo { display: grid; }
.am-nav--liquid .am-nav__logo img { grid-area: 1 / 1; transition: opacity .3s var(--am-ease-out); }
.am-nav--liquid .am-nav__logo .is-dark-logo { opacity: 0; }
.am-nav--liquid.is-small { max-width: 400px; height: 50px; top: 16px; }
.am-nav--liquid[data-tone="orange"] { --nav-tint: rgba(255, 255, 255, .45); }
.am-nav--liquid[data-tone="sand"] { --nav-tint: rgba(255, 255, 255, .3); }
.am-nav--liquid[data-tone="dark"] { --nav-tint: rgba(44, 60, 74, .4); color: var(--ainak-white); }
.am-nav--liquid[data-tone="dark"] .is-dark-logo { opacity: 1; }
.am-nav--liquid[data-tone="dark"] .is-light-logo { opacity: 0; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .am-nav--liquid { --nav-tint: rgba(255, 255, 255, .94); } .am-nav--liquid[data-tone="dark"] { --nav-tint: rgba(44, 60, 74, .95); } }
@media (prefers-reduced-motion: reduce) { .am-nav--liquid { transition: none; } }
.am-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- buttons, chips ---------- */
.am-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: 0; border-radius: 999px;
  background: var(--ainak-main); color: var(--ainak-text);
  font: 600 16px/1 var(--ainak-font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--am-dur-xs) var(--am-ease-out);
}
.am-btn:hover { background: var(--ainak-hover); }
.am-btn--ghost { background: var(--ainak-white); box-shadow: inset 0 0 0 1px var(--ainak-text); }
.am-btn--ghost:hover { background: var(--ainak-pale); }
.am-btn--sm { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.am-btn svg { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 3px solid var(--ainak-text); outline-offset: 3px; border-radius: 8px; }
.am-on-dark :focus-visible, .am-on-dark:focus-visible { outline-color: var(--ainak-white); }

.am-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--ainak-pale); color: var(--ainak-text); font: 600 14px/1.2 var(--ainak-font-body);
}
.am-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ainak-main); }
.am-chip--dark { background: var(--ainak-dark); color: var(--ainak-pale); }
.am-chip--line { background: transparent; box-shadow: inset 0 0 0 1px rgba(254, 243, 214, .4); color: var(--ainak-pale); }

/* ---------- component: pin (pinned scrub section) ---------- */
.am-pin { position: relative; height: calc(100svh * (1 + var(--am-pin-length, 200) / 100)); }
.am-pin__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.am-pin--static { height: auto; }
.am-pin--static .am-pin__stage { position: relative; }

/* ---------- component: rise (masked word rise) ---------- */
.am-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em .04em .16em; margin: -.14em -.04em -.16em; }
.am-wi { display: inline-block; will-change: transform; }

/* ---------- component: type (typed text) ---------- */
.am-c { opacity: 0; }
.am-caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.18em; background: var(--ainak-main); animation: am-blink 1s steps(1) infinite; }
@keyframes am-blink { 50% { opacity: 0; } }

/* ---------- component: marker (highlighter sweep behind one short phrase) ---------- */
[data-am~="marker"], .am-marker { position: relative; display: inline-block; white-space: nowrap; z-index: 0; --am-m: 1; }
[data-am~="marker"]::before, .am-marker::before {
  content: ""; position: absolute; z-index: -1; left: -.08em; right: -.08em; bottom: .04em; height: .36em;
  background: var(--ainak-main); border-radius: .1em;
  transform: scaleX(var(--am-m)) rotate(-1deg); transform-origin: 0 50%;
}
.am-marker--full::before, [data-am~="marker"][data-am-style="full"]::before { top: .06em; bottom: .02em; height: auto; border-radius: .16em; }

/* ---------- component: counter ---------- */
[data-am~="counter"] { font-variant-numeric: tabular-nums; }

/* ---------- component: tilt / magnetic ---------- */
[data-am~="tilt"] { transform-style: preserve-3d; }
[data-am~="magnetic"] { will-change: transform; }

/* ---------- component: scenes (media scrolls, text stays pinned and swaps) ---------- */
.am-scenes { --scenes-bg: var(--ainak-background); display: grid; gap: 20px; }
.am-scenes__text { position: sticky; top: 76px; z-index: 3; order: -1; padding: 14px 0 16px; background: var(--scenes-bg); box-shadow: 0 -48px 0 var(--scenes-bg); display: grid; gap: 14px; }
.am-scenes__panels { display: grid; }
.am-scenes__media { display: grid; gap: clamp(28px, 8svh, 72px); padding-bottom: 8svh; }
.am-scenes__dots { display: flex; gap: 6px; }
.am-scenes__dots i { width: 28px; height: 4px; border-radius: 4px; background: var(--am-line); transition: background-color var(--am-dur-s) var(--am-ease-out); }
.am-scenes__dots i.is-on, .am-scenes__dots i.is-past { background: var(--ainak-main); }
.am-on-dark .am-scenes__dots i:not(.is-on):not(.is-past) { background: rgba(254, 243, 214, .2); }
.am-js [data-am-panel] { grid-area: 1 / 1; opacity: 0; transform: translateY(22px); pointer-events: none;
  transition: opacity var(--am-dur-s) var(--am-ease-out), transform var(--am-dur-m) var(--am-ease-out); }
.am-js [data-am-panel].is-past { transform: translateY(-22px); }
.am-js [data-am-panel].is-on { opacity: 1; transform: none; pointer-events: auto; transition-delay: 120ms; }
.am-js [data-am-scene] { opacity: .4; transform: scale(.96); transition: opacity var(--am-dur-m) var(--am-ease-out), transform var(--am-dur-m) var(--am-ease-out); }
.am-js [data-am-scene].is-on { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .am-scenes { grid-template-columns: 1.3fr 1fr; gap: clamp(40px, 6vw, 96px); }
  .am-scenes__text { order: 2; top: 0; height: 100svh; padding: 0; align-content: center; gap: 28px; background: none; box-shadow: none; }
  .am-scenes__media { gap: 12svh; padding-block: 16svh; }
}

/* ---------- pre-states: only when JS is running, so the page is complete without it ---------- */
.am-js [data-am~="reveal"]:not([data-am-children]) { opacity: 0; }
.am-js [data-am~="reveal"][data-am-children] > * { opacity: 0; }
.am-js [data-am~="rise"] { visibility: hidden; }
.am-js [data-am~="rise"].am-split { visibility: visible; }
.am-js [data-am~="marker"] { --am-m: 0; }
.am-js [data-am~="type"]:not([aria-label]) { visibility: hidden; }
.am-pin--static [data-am-step] { opacity: 1; }

/* the "sheet": the section after a pinned hero slides over it with rounded top corners */
.am-sheet {
  position: relative; z-index: 5; margin-top: -24px; border-radius: 24px 24px 0 0;
  background: var(--ainak-background); padding: clamp(56px, 9vw, 120px) var(--am-gutter);
}
.am-sheet--sand { background: var(--ainak-sand); }
.am-sheet__in { max-width: 1120px; margin: 0 auto; }
.am-cards { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 760px) { .am-cards { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.am-card { background: var(--ainak-white); border-radius: var(--ainak-radius-card); padding: 24px; }
.am-card p { color: var(--am-soft); margin-top: 8px; }

/* ---------- reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .am-caret { animation: none; }
  .am-btn { transition: none; }
  .am-js [data-am~="reveal"], .am-js [data-am~="reveal"] > * { opacity: 1 !important; }
  .am-js [data-am~="rise"] { visibility: visible; }
  .am-js [data-am~="marker"] { --am-m: 1; }
  .am-js [data-am-panel], .am-js [data-am-scene], .am-scenes__dots i { transition: none; }
  .am-js [data-am-scene] { opacity: 1; transform: none; }
}
