/* Perks Lifestyle: tokens, type, header, shared pieces. Plan: _work/design-plan.md */
@font-face { font-family: "Funnel Display"; src: url("../fonts/funnel-display.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Funnel Fallback"; src: local("Arial"); size-adjust: 105.2%; ascent-override: 95%; descent-override: 23.8%; line-gap-override: 0%; }
@font-face { font-family: "Figtree Fallback"; src: local("Arial"); size-adjust: 98.7%; ascent-override: 96.3%; descent-override: 25.3%; line-gap-override: 0%; }

:root {
  --ink: #121a3a;
  --ink-2: #1c2550;
  --ink-3: #2a3566;
  --sky: #eef3f9;
  --sky-2: #e2eaf4;
  --paper: #ffffff;
  --lime: #a6d22b;
  --lime-deep: #86b51a;
  --orange: #f4a01c;
  --orange-deep: #d9860c;
  --blue: #0b8fe3;
  --blue-text: #0a6db0;
  --grey: #5f6066;
  --line: #d3dcea;
  --display: "Funnel Display", "Funnel Fallback", Arial, sans-serif;
  --body: "Figtree", "Figtree Fallback", Arial, sans-serif;
  --r: 0 32px 0 0;          /* one corner only: top right (14 letters, mod 5 = 4) */
  --r-sm: 0 14px 0 0;
  --pill: 999px;            /* buttons: "Perks" 5 letters, mod 3 = 2 */
  --wrap: min(1320px, calc(100% - 64px));
  --head-h: 96px;
  --media-cap: min(76vh, 760px);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(2rem, 3.4vw, 3.6rem); }
h3 { font-size: clamp(1.3rem, 1.6vw, 1.7rem); line-height: 1.12; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { width: var(--wrap); margin-inline: auto; }
.lede { font-size: clamp(1.08rem, 1.25vw, 1.2rem); line-height: 1.55; color: #3a4266; }
.on-ink .lede, .on-ink p { color: #c9d1ea; }
.num { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; font-weight: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -120px; z-index: 100; padding: 12px 20px; min-height: 44px; background: var(--ink); color: var(--paper); font-weight: 700; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 12px; }
/* nav text waits for the web fonts so the swap never shifts it */
.js:not(.fonts-ok) .site-head .nav > a { opacity: 0; }
.site-head .nav > a { transition: opacity .3s var(--ease); }
::selection { background: var(--lime); color: var(--ink); }

/* buttons */
.btn {
  --bg: var(--lime); --fg: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  min-height: 54px; padding: 0 26px; border-radius: var(--pill); border: 0;
  background: var(--bg); color: var(--fg); font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
  isolation: isolate; overflow: hidden;
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--ink); border-radius: inherit; transform: translateY(101%); transition: transform .45s var(--ease); z-index: -1; }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--lime); }
.btn .arr, .arr { display: inline-block; width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.arr--inline { vertical-align: -.2em; }
.btn--arr::after {
  content: ""; width: 1.1em; height: 1.1em; flex: none; background: currentColor; transition: transform .35s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h13M11 5l5 5-5 5'/%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 20 20' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h13M11 5l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn--arr:hover::after { transform: translateX(4px); }
.btn:hover .arr { transform: translateX(4px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--paper); }
.on-ink .btn--ghost { --fg: var(--paper); box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.on-ink .btn--ghost::before { background: var(--paper); }
.on-ink .btn--ghost:hover, .on-ink .btn--ghost:focus-visible { color: var(--ink); }
.on-ink .btn:not(.btn--ghost)::before { background: var(--paper); }
.on-ink .btn:not(.btn--ghost):hover, .on-ink .btn:not(.btn--ghost):focus-visible { color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* header */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--head-h);
  display: flex; align-items: center; isolation: isolate;
}
.site-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(238, 243, 249, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(18, 26, 58, .08); opacity: 0; transition: opacity .4s var(--ease); }
.site-head.is-scrolled::before { opacity: 1; }
.site-head__in { width: var(--wrap); margin-inline: auto; display: flex; align-items: center; gap: 28px; }
.brand { display: block; flex: none; line-height: 0; }
.brand img { height: 72px; width: auto; transform-origin: left center; transition: transform .4s var(--ease); }
.site-head.is-scrolled .brand img { transform: scale(.78); }
.nav { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.nav a:not(.btn) {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; text-decoration: none; font-weight: 600; font-size: .98rem; color: var(--ink); white-space: nowrap;
}
.nav a:not(.btn)::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav a:not(.btn):hover::after, .nav a:not(.btn).is-current::after { transform: scaleX(1); transform-origin: left; }
.nav .btn { margin-left: 10px; min-height: 50px; }
/* fixed boxes, sized for the web font with slack, so a late font swap never moves the menu */
@media (min-width: 1101px) {
  .nav > a { flex: none; justify-content: center; }
  .nav > a:nth-child(1) { width: 128px; } .nav > a:nth-child(2) { width: 80px; } .nav > a:nth-child(3) { width: 90px; }
  .nav > a:nth-child(4) { width: 84px; } .nav > a:nth-child(5) { width: 86px; } .nav > a.btn { width: 236px; justify-content: center; }
}
.burger { display: none; margin-left: auto; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ink); cursor: pointer; position: relative; }
.burger span { position: absolute; left: 15px; right: 15px; height: 2px; background: var(--paper); transition: transform .35s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 20px; } .burger span:nth-child(2) { top: 25px; } .burger span:nth-child(3) { top: 30px; }
.menu-open .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1100px) {
  :root { --head-h: 84px; }
  .brand img { height: 62px; }
  .burger { display: block; z-index: 2; }
  .nav {
    position: fixed; inset: 0; z-index: 1; margin: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
    padding: 110px 32px 40px; background: var(--ink); visibility: hidden; opacity: 0; transition: opacity .35s var(--ease), visibility 0s .35s;
  }
  .nav a:not(.btn) { color: var(--paper); font-family: var(--display); font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 600; padding: 6px 0; }
  .nav a:not(.btn)::after { left: 0; right: 0; }
  .nav .btn { margin: 22px 0 0; }
  .menu-open .nav { visibility: visible; opacity: 1; transition: opacity .35s var(--ease); }
  .menu-open .site-head::before { opacity: 0; }
  .menu-open .brand { position: relative; z-index: 2; background: var(--sky); border-radius: var(--r-sm); }
}
@media (max-width: 640px) {
  :root { --wrap: calc(100% - 32px); --head-h: 76px; }
  .brand img { height: 58px; }
}

/* sections */
main > section { position: relative; }
.sec { padding-block: clamp(84px, 10vw, 140px); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 4vw, 56px); }
.on-ink { background: var(--ink); color: var(--paper); }
.frame { border-radius: var(--r); overflow: hidden; }

/* heading line masks (SplitText): pad and pull back so descenders never clip */
/* every line gets .25em above and .5em below; the negative margins collapse to -.75em between lines,
   so the text sits exactly where it would without the masks */
.split-line-mask { margin: -.25em -.15em -.75em; padding: .25em .15em .5em; }
.split-line-mask:last-child { margin-bottom: -.5em; }
[data-split] { display: flow-root; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-sm); background: var(--paper); font-weight: 600; font-size: .95rem; box-shadow: 0 1px 0 rgba(18,26,58,.06); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(166,210,43,.6); animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(166,210,43,.6); } 70%, 100% { box-shadow: 0 0 0 10px rgba(166,210,43,0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
