/* Swinglo website. Colours mirror Packages/KBDesign/Sources/KBDesign/Tokens.swift ("Iron & Chalk", dark only). */
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #111214;
  --surface: #1c1e21;
  --raised: #2c2e31;
  --line: #3a3d42;
  --chalk: #f2efea;
  --chalk-2: #b4b1ab;
  --chalk-3: #96938e;
  --accent: #ff6b2c;
  --accent-strong: #ff8a55;
  --on-accent: #111214;
  --accent-tint: rgba(255, 107, 44, .14);
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--chalk);
  font: 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.display {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .005em;
  line-height: .92;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--chalk-2);
  margin: 0 0 14px;
}
.accent { color: var(--accent); }
.muted { color: var(--chalk-2); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(17, 18, 20, .86); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid #23252a; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--chalk); text-decoration: none; }
.brand:hover { color: var(--chalk); }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.topnav a:not(.btn) { color: var(--chalk-2); text-decoration: none; }
.topnav a:not(.btn):hover { color: var(--chalk); }
@media (max-width: 640px) { .topnav a:not(.btn) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-size: 21px; text-transform: uppercase; letter-spacing: .03em;
  text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--on-accent);
  transition: background-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--chalk-2); color: var(--chalk); }

/* Footer */
.site-footer { border-top: 1px solid #23252a; margin-top: 40px; padding: 36px 0 48px; color: var(--chalk-2); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--chalk-2); }
.site-footer a:hover { color: var(--chalk); }
.legal-note { width: 100%; font-size: 13px; color: var(--chalk-3); margin: 0; }

/* Legal and support pages */
.doc { max-width: 720px; margin: 0 auto; padding: 40px 20px 24px; }
.doc header { margin-bottom: 28px; }
.doc h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(44px, 9vw, 64px); line-height: .95; margin: 0 0 10px; letter-spacing: .01em; }
.doc h2 { font-size: 21px; margin: 40px 0 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 24px 0 4px; }
.doc .meta { color: var(--chalk-2); font-size: 15px; margin: 0; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc .summary { background: var(--surface); border-radius: 16px; padding: 4px 22px; margin: 22px 0; }
.doc .summary h2 { border: 0; margin-top: 16px; padding-top: 0; }
.doc details { background: var(--surface); border-radius: 14px; padding: 14px 18px; margin: 10px 0; }
.doc summary { font-weight: 700; cursor: pointer; }
.doc details[open] summary { margin-bottom: 6px; }
.doc .contact { background: var(--accent-tint); border-radius: 16px; padding: 16px 20px; margin: 16px 0 8px; }

/* ---------- Motion ---------- */
:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Scroll and load reveals. Uses the individual translate/scale properties, so hover transforms stay independent.
   Hidden only while html.reveal-on is set (JS present, motion allowed); html.reveal-done is the fallback. */
.reveal-on [data-reveal] {
  transition:
    opacity .75s var(--ease-out) var(--d, 0s),
    translate .75s var(--ease-out) var(--d, 0s),
    scale .75s var(--ease-out) var(--d, 0s),
    transform .3s var(--ease-out),
    box-shadow .3s var(--ease-out),
    background-color .3s var(--ease-out);
}
.reveal-on:not(.reveal-done) [data-reveal]:not(.in) { opacity: 0; translate: 0 28px; }
.reveal-on:not(.reveal-done) [data-reveal="rise"]:not(.in) { translate: 0 60px; }
.reveal-on:not(.reveal-done) [data-reveal="right"]:not(.in) { translate: 48px 12px; }
.reveal-on:not(.reveal-done) [data-reveal="scale"]:not(.in) { translate: none; scale: .9; }
.reveal-on:not(.reveal-done) [data-reveal="drop"]:not(.in) { translate: 0 -70px; }
.reveal-on [data-reveal="drop"] { transition-timing-function: var(--ease-spring); }

/* Buttons: a light sweep on hover, a press on tap */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  translate: -120% 0; transition: translate .7s var(--ease-out);
}
.btn.ghost::after { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); }
.topnav a:not(.btn), .site-footer a { transition: color .2s ease; }
.topbar { transition: box-shadow .3s ease, background-color .3s ease; }
.topbar.scrolled { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .9); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover::after { translate: 120% 0; }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: translateY(0) scale(.97); }
}

/* The Bell. Each group owns one transform: .jump (hop), .body (sway), .look (gaze), .lid (blink), .shape (mood). */
.bell { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bell svg { display: block; width: 100%; height: auto; overflow: visible; }
.bell .shadow { fill: #000; opacity: .45; transform-box: fill-box; transform-origin: center; animation: shadow-sway 2.4s ease-in-out infinite; }
.bell .jump { transform-origin: 50px 97px; }
.bell .body { transform-origin: 50px 97px; animation: bell-sway 2.4s ease-in-out infinite; }
.bell .look { transition: transform .28s var(--ease-out); }
.bell .eyes { fill: #111214; }
.bell .lid, .bell .shape { transform-box: fill-box; transform-origin: center; }
.bell .lid { transition: transform .07s ease-in; }
.bell .eyes.blink .lid { transform: scaleY(.08); }
.bell .shape { transition: transform .3s var(--ease-spring); }
.bell .shape rect { transition: opacity .14s ease; }
.bell .arc { fill: none; stroke: #111214; stroke-width: 1.6; stroke-linecap: round; opacity: 0; transition: opacity .14s ease; }
.bell .eyes[data-mood="alert"] .shape { transform: scale(.72, 1.9); }
.bell .eyes[data-mood="focus"] .shape { transform: scale(1.12, .45); }
.bell .eyes[data-mood="tired"] .shape { transform: translateY(1.2px) scale(1, .38); }
.bell .eyes[data-mood="wink"] .eye:last-child .shape { transform: scale(1.1, .2); }
.bell .eyes[data-mood="happy"] rect { opacity: 0; }
.bell .eyes[data-mood="happy"] .arc { opacity: 1; }
.bell .jump.hop { animation: bell-hop .62s var(--ease-out); }
.bell svg.hopping .shadow { animation: shadow-hop .62s var(--ease-out); }

@keyframes bell-sway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}
@keyframes shadow-sway {
  0%, 100% { transform: translateX(-2.5px) scaleX(.94); }
  50% { transform: translateX(2.5px) scaleX(.94); }
}
@keyframes bell-hop {
  0% { transform: none; }
  16% { transform: scale(1.1, .86); }
  46% { transform: translateY(-16px) scale(.94, 1.07) rotate(-4deg); }
  72% { transform: translateY(0) scale(1.08, .9); }
  86% { transform: scale(.98, 1.03); }
  100% { transform: none; }
}
@keyframes shadow-hop {
  0%, 100% { transform: none; opacity: .45; }
  46% { transform: scaleX(.6); opacity: .2; }
  72% { transform: scaleX(1.08); opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  .bell .body, .bell .shadow { animation: none; }
  .bell .look, .bell .shape, .bell .lid { transition: none; }
  .btn, .btn::after { transition: none; }
}
