/* ==========================================================================
   Niranjan Reddy · UI kit
   Tokens and reusable components, shared by every page. Page layouts live in
   styles.css; anything that is a control, a surface or a motion lives here.

   One interaction language, everywhere:
   - Pills lift 2px on hover (spring) and press to 96% on click.
   - Panels that are links lift 4px; their arrow nudges out.
   - Row links get a soft lilac pill on hover; the right mark turns into an arrow.
   - Foil (the holo film) is the only accent: dots, active states, highlights.
   - Focus is always a 2px ink ring, 3px out.
   - Reduced motion: final states only.
   See ui-kit.html for every component and its states.
   ========================================================================== */

:root {
  /* Colour */
  --ink: #120f1c;        /* text, pen point, ink pills */
  --paper: #f6f3fb;      /* pearl paper over the film */
  --card: #ffffff;
  --muted: #5d5870;
  --rule: #e2dcef;
  --tint: #ece6fa;       /* hover fill for row links */
  --foil: linear-gradient(115deg,#f7a8d8 0%,#b59cff 18%,#7fd4ff 36%,#8ef0c8 52%,#ffd59a 66%,#f7a8d8 82%,#b59cff 100%);
  --glass: color-mix(in srgb, var(--paper) 72%, transparent);
  /* Type */
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  /* Motion */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --soft: cubic-bezier(.16, 1, .3, 1);
  --inout: cubic-bezier(.65, 0, .35, 1);
  /* Shape */
  --pill-h: 48px;
  --radius: 22px;
  --shadow: 0 1px 0 var(--rule), 0 24px 50px -28px rgb(18 15 28 / .45);
  /* Layout */
  --max: 1120px;
  --pad: clamp(20px, 4vw, 48px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
body { margin: 0; color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font: 500 12.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .02em; }
@keyframes foil { to { background-position: 200% 0; } }

/* ---------- Pill: every button and button-like link ----------
   <a class="pill pill--ink">Let's talk <span class="dot"></span></a>
   Variants: --ink (primary), --glass (secondary, over film or paper), --line (outlined),
   --icon (round, icon only), --sm (40px). */
.pill {
  --h: var(--pill-h);
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  height: var(--h); padding: 0 22px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--body); color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .3s var(--spring), background-color .24s var(--soft), color .24s var(--soft), box-shadow .24s var(--soft);
}
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: scale(.96); transition-duration: .12s; }
.pill:focus-visible { border-radius: 999px; }
.pill--ink { background: var(--ink); color: var(--paper); }
.pill--glass { background: var(--glass); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); box-shadow: inset 0 0 0 1px rgb(18 15 28 / .08); }
.pill--line { background: rgb(246 243 251 / .4); box-shadow: inset 0 0 0 1.5px var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pill--icon { width: var(--h); padding: 0; }
.pill--sm { --h: 40px; padding: 0 18px; font-size: 14px; font-weight: 500; }
.pill--icon.pill--sm { padding: 0; }
.pill[aria-pressed="true"], .pill--foil { background: var(--foil); background-size: 200% 100%; animation: foil 6s linear infinite; }
.pill[aria-expanded="true"] { background: var(--card); }

/* Dot: a small foil point; grows when its pill is hovered */
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--foil); background-size: 300% 100%; animation: foil 6s linear infinite; transition: transform .4s var(--spring); }
.pill:hover .dot { transform: scale(1.6); }

/* Dots: the two-dot menu mark; stands up when its pill is expanded */
.dots { display: grid; grid-auto-flow: column; gap: 3px; transition: transform .5s var(--spring); }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
[aria-expanded="true"] > .dots { transform: rotate(90deg); }

/* Arrow: nudges out on hover of its parent link */
.arrow { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--spring); }
a:hover > .arrow, .panel:hover .arrow { transform: translate(3px, -3px); }

/* ---------- Wave: the sound line ----------
   <button class="pill pill--glass pill--icon" data-ui="wave" aria-pressed="false"><svg class="wave"><path/></svg></button>
   Straight when off. On click it starts to wave and keeps flowing; off settles it flat again. Drawn by ui.js. */
.wave { width: 28px; height: 20px; overflow: visible; }
.wave path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Roller: text that rolls through a list, like a counter wheel ----------
   <span class="roller" data-ui="roller" data-words="A|B|C" data-holds="3000|2200|2200">A</span>
   Put it in a .pill--sm --glass to get the role capsule. ui.js builds the words. */
.roller { display: inline-grid; align-items: center; height: 1.5em; overflow: hidden; perspective: 240px; transition: width .5s var(--soft); vertical-align: middle; }
.roller__word { grid-area: 1 / 1; justify-self: center; white-space: nowrap; transform-origin: 50% 50% -.75em; backface-visibility: hidden; transition: transform .7s var(--spring), opacity .45s var(--soft); }
.roller__word.is-enter { transform: rotateX(-90deg); opacity: 0; transition: none; }
.roller__word.is-out { transform: rotateX(90deg); opacity: 0; transition: transform .55s var(--inout), opacity .4s var(--soft); }

/* ---------- Panel: white card surface ----------
   Variants: --ink (dark, for the one strong action), --pad (padded content). Link panels lift. */
.panel { display: block; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.panel--pad { padding: 22px 26px 24px; display: grid; gap: 8px; }
.panel--ink { background: var(--ink); color: var(--paper); }
a.panel { transition: transform .4s var(--spring); }
a.panel:hover { transform: translateY(-4px); }
.panel__title { font: 600 21px/1.25 var(--display); letter-spacing: -.015em; }
.panel--action { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; font: 700 26px/1 var(--display); letter-spacing: -.02em; }
.panel--action small { font: 500 12px/1 var(--mono); opacity: .6; margin-left: 6px; letter-spacing: 0; }

/* ---------- Row link: big list link with a right-hand mark ----------
   <a class="row-link" href="#about">About<span class="row-link__mark"></span></a>
   The mark is a dot when aria-current is set, and an arrow on hover or focus. */
.row-links { padding: 10px; }
.row-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-radius: 999px; font: 700 30px/1.05 var(--display); letter-spacing: -.03em; text-decoration: none; transition: background-color .24s var(--soft); }
.row-link:hover, .row-link:focus-visible { background: var(--tint); }
.row-link__mark { position: relative; width: 22px; height: 22px; }
.row-link__mark::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .4s var(--spring); }
.row-link__mark::after { content: ""; position: absolute; inset: 0; 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; opacity: 0; transform: translateX(-8px); transition: transform .4s var(--spring), opacity .2s var(--soft); }
.row-link[aria-current] .row-link__mark::before { transform: scale(1); }
.row-link:hover .row-link__mark::before, .row-link:focus-visible .row-link__mark::before { transform: scale(0); }
.row-link:hover .row-link__mark::after, .row-link:focus-visible .row-link__mark::after { opacity: 1; transform: none; }

/* ---------- Stack: panels that drop in one after another (menus, popovers) ----------
   Add .is-open to show. Each child springs in 60 ms after the one before. */
.stack { display: grid; gap: 10px; visibility: hidden; pointer-events: none; transition: visibility 0s .45s; }
.stack.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.stack > * { opacity: 0; transform: translateY(-14px) scale(.97); transform-origin: 50% 0; transition: transform .3s var(--soft), opacity .2s var(--soft); }
.stack.is-open > * { opacity: 1; transform: none; transition: transform .6s var(--spring), opacity .25s var(--soft); }
.stack.is-open > :nth-child(2) { transition-delay: .06s; }
.stack.is-open > :nth-child(3) { transition-delay: .12s; }
.stack.is-open > :nth-child(4) { transition-delay: .18s; }

/* ---------- Tag: small mono chip for facts (domain, platform, tool) ----------
   <ul class="tags"><li class="tag">Travel</li></ul> */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--tint); font: 500 12px/1 var(--mono); color: var(--ink); white-space: nowrap; }

/* ---------- Text link: inline underline that draws in ---------- */
.text-link { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--soft); }
.text-link:hover, .text-link:focus-visible { background-size: 100% 1.5px; }

@media (prefers-reduced-motion: reduce) {
  .pill, .dot, .dots, .arrow, .roller, .roller__word, .panel, .row-link, .row-link__mark::before, .row-link__mark::after, .stack, .stack > *, .text-link { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}
