/* =====================================================================
   HeySwaey — base: tokens, type, buttons, menubar, reveal utilities.
   Type and colour follow HeyClicky: Inter at weight 500 with tight
   tracking, lowercase, and their blue (#0f7fff) with the aqua button.
   The menubar is the WebLume floating glass pill.
   ===================================================================== */

:root {
  /* HeyClicky blue */
  --electric: #0f7fff;
  --sky: #9ec5ff;
  --ice: #d6e6ff;
  --deep: #0a63d6;
  --indigo: #221898;
  --electric-rgb: 15, 127, 255;

  --paper: #f5f5f5;
  --white: #ffffff;
  --ink: #000000;
  --ink-2: #1c1c1e;
  --mute: rgba(0, 0, 0, 0.5);
  --mute-2: rgba(0, 0, 0, 0.42);
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.12);

  --tl-red: #ff5f57;
  --tl-yellow: #febc2e;
  --tl-green: #28c840;
  --sys-blue: #0a84ff;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-sign: "Mrs Saint Delafield", "Snell Roundhand", cursive;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-island: cubic-bezier(0.32, 1.25, 0.5, 1);

  --menubar-h: 52px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 48px);

  --shadow-win: inset 0 1px 0 #ffffffe6, 0 0 0 .5px #00000014, 0 1px 1px #0000000a, 0 8px 20px -8px #00000026, 0 28px 56px -28px #0000002e;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--menubar-h) + 28px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
::selection { background: rgba(var(--electric-rgb), 0.2); }
:focus-visible { outline: 2px solid var(--electric); outline-offset: 3px; border-radius: 8px; }

/* ---------- Type (HeyClicky scale: 500 weight, -0.03em) ---------- */
.wordmark-xl {
  margin: 0;
  font-size: clamp(76px, 12.6vw, 184px);
  line-height: 0.86;
  letter-spacing: -0.06em;
  font-weight: 600;
  color: var(--ink);
}
.h2 {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 500;
  text-wrap: balance;
}
.h3 {
  margin: 0;
  font-size: clamp(28px, 2.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.lede { margin: 0; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.35; letter-spacing: -0.03em; color: var(--ink); }
.sub { margin: 14px auto 0; max-width: 32em; font-size: 18px; line-height: 1.5; letter-spacing: -0.03em; color: var(--mute); text-wrap: pretty; }
.micro { margin: 12px 0 0; font-size: 12.5px; color: rgba(0,0,0,.4); letter-spacing: -0.02em; }
.label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 13px; color: rgba(0,0,0,.4); letter-spacing: 0; }
.center { text-align: center; }

.kbd {
  display: inline-grid; place-items: center;
  min-width: 1.7em; height: 1.7em; padding: 0 0.42em; margin: 0 0.12em;
  font: 600 0.78em/1 var(--font-sf);
  color: var(--ink-2);
  background: linear-gradient(#fff, #f1f1f4);
  border-radius: 0.42em;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,.18), 0 1.5px 0 rgba(0,0,0,.14);
  vertical-align: 0.08em;
}

/* Section eyebrow pill (WebLume / HeyClicky) */
.tag {
  display: inline-flex; align-items: center; height: 27px; padding: 0 13px;
  font: 600 11px/1 var(--font-sans); letter-spacing: 0.09em; text-transform: uppercase;
  color: rgba(0,0,0,.55);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.04);
}
.tag--dark { color: rgba(255,255,255,.75); background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.16); }
.tag--glass { color: rgba(0,0,0,.6); background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 4px 14px -6px rgba(10,40,90,.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------- Buttons ---------- */
.btn {
  --h: 42px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: var(--h); padding: 0 20px 1px 16px;
  font: 500 16px/1 var(--font-sans); letter-spacing: -0.03em;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform .2s var(--ease-spring), box-shadow .25s var(--ease-out), filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn > * { position: relative; z-index: 2; }
.btn:active { transform: scale(0.97); }
.btn-ico { width: 17px; height: 17px; flex: none; }
.btn .apple { width: 16px; height: 18px; margin-top: -2px; flex: none; }
.btn-sm { --h: 32px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
.btn-sm .apple { width: 12px; height: 14px; }
.btn-lg { --h: 48px; padding: 0 24px 1px 20px; font-size: 18px; }
.btn-lg .apple { width: 18px; height: 21px; }
.btn-block { display: flex; width: 100%; }

/* HeyClicky's aqua button, rebuilt in CSS */
.btn-gloss {
  color: #000;
  text-shadow: 0 2px 2px #fffc;
  background: linear-gradient(#edf4ff 0%, #d6e7ff 18%, #a2c7ff 50%, #99cbf8 80%, #a2d2f7 100%);
  border: 1px solid var(--indigo);
  box-shadow: 0 10px 24px #0000001f;
}
.btn-gloss::before { /* the gloss */
  content: ""; position: absolute; z-index: 1; top: 3px; left: 12px; right: 12px; height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.35) 100%);
  pointer-events: none;
}
.btn-gloss::after { /* the inner glow at the bottom */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  box-shadow: inset 0 -15px 2px -12px #ffffff8c, inset 0 -8px 10px -4px rgba(120, 200, 255, .55);
}
.btn-gloss:hover { transform: translateY(-1px); filter: brightness(1.03) saturate(1.08); box-shadow: 0 14px 30px #0000002b; }

/* WebLume glass button */
.btn-glass {
  color: #0a0a0a;
  background: linear-gradient(180deg, #ffffffd9 0%, #ffffff8c 45%, #ffffffb3 100%);
  backdrop-filter: blur(22px) saturate(190%); -webkit-backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid #ffffffe6;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 1px #00000014, inset 0 0 0 1px #ffffff4d, 0 1px 2px #0000001a, 0 8px 24px -10px #00000038;
}
.btn-glass::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 52%; border-radius: inherit; background: linear-gradient(180deg, #ffffffb3 0%, #ffffff00 100%); pointer-events: none; }
.btn-glass:hover { transform: translateY(-1.5px); }
.btn-white { color: var(--ink); background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 4px 14px -8px rgba(0,0,0,.25); }
.btn-white:hover { transform: translateY(-1px); }
.btn-ghost-dark { color: #fff; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.12); }

/* WebLume primary pill, in HeyClicky blue */
.pill-primary {
  color: #fff;
  background: linear-gradient(180deg, #3d97ff 0%, var(--electric) 55%, #0068e0 100%);
  box-shadow: inset 0 1px 0 #ffffff5c, 0 1px 2px rgba(15,127,255,.25), 0 6px 18px -6px rgba(15,127,255,.55);
  font-weight: 600;
  letter-spacing: -0.015em;
  padding: 0 15px;
}
.pill-primary:hover { transform: translateY(-1.5px); box-shadow: inset 0 1px 0 #ffffff66, 0 2px 4px rgba(15,127,255,.25), 0 12px 26px -8px rgba(15,127,255,.6); }

/* ---------- Menubar: the WebLume floating glass pill ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 12px var(--gutter);
  pointer-events: none;
}
.menubar-row {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; gap: 20px;
  height: var(--menubar-h);
  padding: 7px 10px 7px 22px;
  max-width: 1140px;
  margin-inline: auto;
  border-radius: 999px;
  background: #ffffff5e;
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid #ffffff99;
  box-shadow: inset 0 1px 0 #fffffff2, inset 0 -1px 0 #ffffff59, 0 1px 2px #0000000f, 0 14px 34px -14px #0a2a4a3d;
  transition: background-color .4s, color .4s, border-color .4s;
}
.menubar.on-dark .menubar-row { color: #f5f5f7; background: rgba(28, 28, 32, .55); border-color: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 14px 34px -14px rgba(0,0,0,.6); }
.menubar.on-dark .menu-items a, .menubar.on-dark .clock { color: rgba(255,255,255,.85); }
.menubar.on-dark .status-glyphs { color: rgba(255,255,255,.6); }
.menubar .left, .menubar .right { display: flex; flex: 1; align-items: center; gap: 18px; min-width: 0; }
.menubar .right { justify-content: flex-end; gap: 14px; }
.menubar .center { position: relative; display: flex; align-items: center; justify-content: center; }
.nav-wordmark { font-size: 14.5px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.menu-items { display: flex; align-items: center; gap: 18px; user-select: none; }
.menu-items a { font-size: 13.5px; color: #000000cc; transition: color .15s var(--ease-out); }
.menu-items a:hover, .menu-items a.active { color: #000; }
.status-glyphs { display: flex; align-items: center; gap: 13px; color: #0000008c; }
.status-glyphs svg { width: 15px; height: 15px; }
.status-glyphs .si--batt { width: 23px; height: 12px; }
.clock { font-size: 13.5px; color: #000000cc; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq { display: flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.eq i { width: 2px; height: 100%; background: currentColor; border-radius: 1px; transform-origin: bottom; animation: eq-bar .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .15s; } .eq i:nth-child(3) { animation-delay: .3s; } .eq i:nth-child(4) { animation-delay: .45s; }
@keyframes eq-bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* the animated face mark: just the strokes, no tile */
.mark {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 34px;
  border-radius: 12px;
  color: #000;
  transition: background-color .2s, color .2s;
}
.mark:hover { background: rgba(0,0,0,.05); color: var(--electric); }
.mark [data-face] { animation: mark-lean 9s ease-in-out infinite; }
.menubar.on-dark .mark { color: #fff; }
@keyframes mark-lean {
  0%, 8% { transform: skewX(0); }
  12.5%, 26% { transform: skewX(-7deg); }
  30.5%, 44% { transform: skewX(7deg); }
  48.5%, 100% { transform: skewX(0); }
}

.menu-toggle { display: none; width: 36px; height: 36px; border-radius: 50%; place-items: center; }
.menu-toggle svg { width: 20px; height: 20px; }
.menu-sheet {
  pointer-events: auto;
  max-width: 1140px; margin: 8px auto 0;
  display: grid; gap: 2px; padding: 10px;
  background: rgba(250,250,252,.94);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 22px; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 20px 50px -20px rgba(0,0,0,.35);
  color: var(--ink);
  animation: sheet-in .28s var(--ease-out);
}
.menu-sheet[hidden] { display: none; }
.menu-sheet a:not(.btn) { padding: 12px 14px; border-radius: 12px; font-size: 17px; font-weight: 500; }
.menu-sheet a:not(.btn):hover { background: rgba(0,0,0,.05); }
.menu-sheet .btn { margin-top: 6px; }
@keyframes sheet-in { from { opacity: 0; transform: scale(.97) translateY(-6px); } }

@media (max-width: 1100px) { .status-glyphs .eq, .status-glyphs .si-bt { display: none; } }
/* seven links: tighten them on narrower windows so the last one never slides under the centre mark */
@media (max-width: 1120px) { .menubar .left { gap: 14px; } .menu-items { gap: 12px; } .menu-items a { font-size: 13px; } }
@media (max-width: 960px) { .menu-items, .status-glyphs { display: none; } }
@media (max-width: 640px) {
  .menubar-row { padding: 6px 6px 6px 18px; gap: 10px; }
  .clock, .menubar .right .btn-sm { display: none; }
  .menu-toggle { display: grid; }
}

/* ---------- Reveal on scroll ---------- */
.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out) var(--d, 0s), transform 1s var(--ease-out) var(--d, 0s); }
.reveal-scale { opacity: 0; transform: translateY(28px) scale(.97); transition: opacity 1s var(--ease-out) var(--d, 0s), transform 1.1s var(--ease-out) var(--d, 0s); }
.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-up, .reveal-scale { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Face (face.js) ---------- */
[data-face] { display: inline-grid; place-items: center; flex: none; }
.face-svg { overflow: visible; display: block; }
.face-svg path { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.face-glow { filter: drop-shadow(0 0 1.5px rgba(219,240,255,.95)) drop-shadow(0 0 5px rgba(107,179,255,.75)); }
.face-ink path { stroke: currentColor; }
