/* ──────────────────────────────────────────────────────────
   PVAY · Ranum Efterskole College – design system
   Navy and white, red calls to action, blue for selection,
   muted green labels, photo-led cards and a topographic
   texture. Ranum's own Accord Alternate for headings,
   Source Sans 3 for running text.
   ────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Accord Alternate';
  src: url('/fonts/AccordAlternate-Regular.woff2') format('woff2'), url('/fonts/AccordAlternate-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Accord Alternate';
  src: url('/fonts/AccordAlternate-Medium.woff2') format('woff2'), url('/fonts/AccordAlternate-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Accord Alternate';
  src: url('/fonts/AccordAlternate-Bold.woff2') format('woff2'), url('/fonts/AccordAlternate-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Accord Alternate';
  src: url('/fonts/AccordAlternate-ExtraBold.woff2') format('woff2'), url('/fonts/AccordAlternate-ExtraBold.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --navy-950: #041a2b;
  --navy-900: #09243a;
  --navy-800: #0f2e49;
  --navy-700: #123654;
  --navy-100: #e3ebf2;
  --navy-50: #f0f5fa;

  /* brand accents from the PVAY design */
  --cta: #ed0a3b;
  --cta-dark: #cf153d;
  --accent-blue: #0876c9;
  --accent-blue-soft: #edf5ff;
  --accent-green: #4c8275;

  --bg: #f7f9fa;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef2f6;
  --line: #dce3eb;
  --line-strong: #c4d1dd;
  --text: #102c49;
  --text-2: #4f657b;
  --text-3: #8596a8;
  --ink: var(--navy-900);
  --on-ink: #ffffff;
  --overlay: rgba(7, 21, 40, 0.55);
  --material: rgba(255, 255, 255, 0.9);

  /* category colours – validated as a set for colour-blind separation */
  --red: #e34948;
  --red-soft: #fdeeee;
  --green: #199e70;
  --green-soft: #e8f6f0;
  --orange: #eb6834;
  --orange-soft: #fdf0ea;
  --purple: #6250d6;
  --purple-soft: #efedfb;
  --blue: #2a78d6;
  --blue-soft: #eaf2fc;
  --pink: #d6336c;
  --pink-soft: #fceaf1;
  --teal: #1b98a8;
  --teal-soft: #e7f5f7;
  --indigo: #4f46e5;
  --indigo-soft: #eceafd;
  --yellow: #c98500;
  --yellow-soft: #fdf5e3;

  /* status – reserved for state, always paired with a label */
  --good: #15803d;
  --good-soft: #e3f6e9;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --bad: #c0362c;
  --bad-soft: #fde9e7;

  --accent: var(--red);
  --gold: #b7862a;
  --gold-soft: #fbf3e2;

  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 4px 12px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 2px 6px rgba(15, 27, 45, 0.06), 0 16px 40px rgba(15, 27, 45, 0.12);
  --ring: 0 0 0 1px var(--line);

  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font: 'Source Sans 3', 'Myriad Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Accord Alternate', 'Montserrat', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --font-read: 'Newsreader', Georgia, serif;

  --gutter: 20px;
  --topbar: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* aliases used across the scripts */
  --label: var(--text);
  --label-2: var(--text-2);
  --label-3: var(--text-3);
  --fill: var(--surface-3);
  --separator: var(--line);
  --paper: var(--surface-2);
  --card-shadow: var(--shadow);
  --tint: var(--ink);
  --danger: var(--bad);
  --success: var(--good);
  --warning: var(--warn);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + 16px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, not hidden: hidden would turn body into a scroll box and break sticky headers */
  overflow-x: clip;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid #48a5f5;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

.icon.filled {
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 13px;
}

.footnote {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ───────── category colours ───────── */

.c-red { --c: var(--red); --c-soft: var(--red-soft); }
.c-green { --c: var(--green); --c-soft: var(--green-soft); }
.c-orange { --c: var(--orange); --c-soft: var(--orange-soft); }
.c-purple { --c: var(--purple); --c-soft: var(--purple-soft); }
.c-blue { --c: var(--blue); --c-soft: var(--blue-soft); }
.c-pink { --c: var(--pink); --c-soft: var(--pink-soft); }
.c-teal { --c: var(--teal); --c-soft: var(--teal-soft); }
.c-indigo { --c: var(--indigo); --c-soft: var(--indigo-soft); }
.c-yellow { --c: var(--yellow); --c-soft: var(--yellow-soft); }
.c-gray { --c: var(--text-3); --c-soft: var(--surface-3); }

/* legacy "g-" classes: solid colour block */
.g-red, .g-orange, .g-green, .g-purple, .g-blue, .g-pink, .g-teal, .g-indigo, .g-yellow, .g-gray {
  background: var(--c);
}
.g-red { --c: var(--red); --c-soft: var(--red-soft); }
.g-green { --c: var(--green); --c-soft: var(--green-soft); }
.g-orange { --c: var(--orange); --c-soft: var(--orange-soft); }
.g-purple { --c: var(--purple); --c-soft: var(--purple-soft); }
.g-blue { --c: var(--blue); --c-soft: var(--blue-soft); }
.g-pink { --c: var(--pink); --c-soft: var(--pink-soft); }
.g-teal { --c: var(--teal); --c-soft: var(--teal-soft); }
.g-indigo { --c: var(--indigo); --c-soft: var(--indigo-soft); }
.g-yellow { --c: var(--yellow); --c-soft: var(--yellow-soft); }
.g-gray { --c: var(--text-3); --c-soft: var(--surface-3); }

/* tinted icon tile */
.app-icon[class] {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  border-radius: max(6px, calc(var(--size) * 0.25));
  display: grid;
  place-items: center;
  flex: none;
  color: var(--c, var(--text-2));
  background: var(--c-soft, var(--surface-3));
  font-size: calc(var(--size) * 0.48);
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--text-3));
  flex: none;
}

/* ───────── brand ───────── */

/* The official Ranum wordmark, used as a mask so it can take any colour. */
.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 230px;
  max-width: 100%;
  aspect-ratio: 2048 / 446;
  background: currentColor;
  -webkit-mask: url('/img/pvay/ranum-logo.png') left center / contain no-repeat;
  mask: url('/img/pvay/ranum-logo.png') left center / contain no-repeat;
}

/* ───────── shared PVAY pieces ───────── */

.kicker {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.small-rule {
  display: block;
  width: 39px;
  height: 2px;
  margin: 17px 0 14px;
  background: currentColor;
  opacity: 0.85;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-link .icon {
  font-size: 1.1em;
}

.topo {
  background-color: #fbfcfd;
  background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23e6edf2' stroke-width='1'%3E%3Cpath d='M-20 40C20 5 55 10 75 38s50 36 100-5M-25 50C20 15 55 20 75 48s50 36 105-5M-30 60C20 25 55 30 75 58s50 36 110-5M-20 125c30-35 70-30 90-2s50 36 100-5M-25 135c30-35 70-30 90-2s50 36 105-5M-30 145c30-35 70-30 90-2s50 36 110-5'/%3E%3C/g%3E%3C/svg%3E");
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 22px 0 18px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--navy-900);
  text-align: center;
}

.section-label::before,
.section-label::after {
  content: '';
  width: 68px;
  height: 1px;
  flex: none;
  background: #aebbc7;
}

/* photo hero with the logo and navigation on top */

.site-hero {
  position: relative;
  isolation: isolate;
  min-height: 420px;
  color: #fff;
  background: #0a2a41 var(--hero-img, none) center 47% / cover no-repeat;
  overflow: hidden;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 26, 43, 0.9) 0%, rgba(4, 26, 43, 0.66) 38%, rgba(4, 26, 43, 0.1) 78%),
    linear-gradient(0deg, rgba(4, 22, 36, 0.4), transparent 55%);
}

.site-hero.compact {
  min-height: 300px;
}

/* sits behind the gradient (::before) and the content; never changes the section's height */
.hero-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 88px;
  padding: var(--safe-top) clamp(20px, 4.4vw, 68px) 0;
}

.site-header .brand-logo {
  width: clamp(170px, 17vw, 236px);
  color: #fff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
  font-weight: 600;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.15s;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  text-decoration-color: currentColor;
}

.hero-content {
  max-width: 980px;
  padding: 30px clamp(20px, 4.4vw, 68px) 52px;
}

.hero-content .kicker {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(40px, 5.3vw, 70px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 15px rgba(0, 26, 42, 0.25);
}

.site-hero.compact .hero-title {
  font-size: clamp(34px, 4.4vw, 56px);
}

.hero-sub {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88);
}

.hero-desc {
  max-width: 560px;
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 26px;
}

.hero-actions .text-link {
  color: #fff;
}

/* footer */

.site-footer {
  background: var(--navy-900);
  color: #fff;
  padding: 18px clamp(20px, 3.4vw, 54px) calc(18px + var(--safe-bottom));
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1500px;
  min-height: 48px;
  margin: 0 auto;
}

.footer-inner .brand-logo {
  width: 190px;
  color: #fff;
}

.footer-divider {
  width: 1px;
  height: 42px;
  flex: none;
  background: #718294;
}

.footer-inner p {
  margin: 0;
  font-size: 14px;
  color: #e2e8ed;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.28em;
  white-space: nowrap;
  color: #d2dbe2;
}

.footer-links a {
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #fff;
}

@media (max-width: 760px) {
  .site-hero {
    min-height: 0;
    background-position: 58% center;
  }

  .site-header {
    height: 72px;
    padding: var(--safe-top) 20px 0;
  }

  .site-header .brand-logo {
    width: 150px;
  }

  .site-nav {
    gap: 16px;
    font-size: 13px;
  }

  .site-nav .wide-only {
    display: none;
  }

  .hero-content {
    padding: 34px 20px 38px;
  }

  .hero-title {
    font-size: clamp(36px, 10vw, 54px);
  }

  .hero-sub {
    font-size: 20px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .section-label {
    gap: 10px;
    font-size: 10px;
    letter-spacing: 0.17em;
  }

  .section-label::before,
  .section-label::after {
    width: 30px;
  }

  .footer-inner {
    flex-wrap: wrap;
    gap: 12px 14px;
  }

  .footer-inner .brand-logo {
    width: 150px;
  }

  .footer-divider {
    display: none;
  }

  .footer-inner p {
    flex-basis: 100%;
    font-size: 13px;
  }

  .footer-links {
    width: 100%;
    margin: 0;
    justify-content: space-between;
  }
}

/* ───────── layout ───────── */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.narrow {
  max-width: 860px;
}

/* ───────── top navigation ───────── */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--topbar);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.topnav-links {
  display: flex;
  gap: var(--s-5);
  margin-right: auto;
}

.topnav-links a {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.topnav-links a:hover {
  opacity: 1;
}

.topnav-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* transparent over a hero image until the page scrolls */
.topnav.over-hero {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  border-color: transparent;
  color: #fff;
}

.topnav.over-hero.scrolled {
  background: var(--material);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-color: var(--line);
  color: var(--text);
}

.topnav.over-hero.scrolled .btn.white {
  background: var(--navy-900);
  color: #fff;
}

@media (max-width: 760px) {
  .topnav-links {
    display: none;
  }
}

/* ───────── typography ───────── */

.page-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--text);
}

.page-sub {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--text-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
}

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

/* ───────── cards ───────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card.pad {
  padding: var(--s-5);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

/* ───────── buttons ───────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  background: var(--navy-900);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--navy-700);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn.large {
  height: 48px;
  font-size: 15px;
}

.btn.medium {
  height: 38px;
  padding: 0 var(--s-4);
  font-size: 14px;
}

.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  gap: 6px;
}

.btn.secondary,
.btn.tinted,
.btn.gray {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.secondary:hover:not(:disabled),
.btn.tinted:hover:not(:disabled),
.btn.gray:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--text-3);
}

.btn.white {
  background: #fff;
  color: var(--navy-900);
}

.btn.white:hover:not(:disabled) {
  background: var(--navy-50);
}

.btn.plain {
  background: transparent;
  color: var(--text-2);
  padding: 0 var(--s-3);
}

.btn.plain:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}

.btn.destructive {
  background: var(--surface);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
}

.btn.destructive:hover:not(:disabled) {
  background: var(--bad-soft);
}

.btn.accent,
.btn.vote {
  background: var(--red);
}

.btn.accent:hover:not(:disabled),
.btn.vote:hover:not(:disabled) {
  background: color-mix(in srgb, var(--red) 88%, #000);
}

.btn.red {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 5px 14px rgba(184, 11, 52, 0.14);
}

.btn.red:hover:not(:disabled) {
  background: var(--cta-dark);
  box-shadow: 0 7px 18px rgba(184, 11, 52, 0.22);
  transform: translateY(-1px);
}

.btn.gold {
  background: var(--gold);
  color: #fff;
}

.btn.gold:hover:not(:disabled) {
  background: color-mix(in srgb, var(--gold) 88%, #000);
}

.btn .icon {
  font-size: 1.15em;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: inline-grid;
  place-items: center;
  color: var(--text-2);
  font-size: 18px;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.icon-btn.outline {
  border: 1px solid var(--line-strong);
}

.round-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}

.round-btn:hover {
  background: var(--surface-3);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  opacity: 0.8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ───────── form controls ───────── */

.form {
  display: grid;
  gap: var(--s-5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ff-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ff-label .opt {
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}

.ff-hint {
  font-size: 12px;
  color: var(--text-2);
}

.ff-count {
  justify-self: end;
  margin-top: -2px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.input,
.textarea,
select.input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid #d6dfe8;
  outline: 0;
  background: var(--surface);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5a6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.textarea {
  display: block;
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
  min-height: 96px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.textarea:hover {
  border-color: var(--text-3);
}

.input:focus,
.textarea:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-700) 15%, transparent);
}

.input.code {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-field.invalid .input,
.form-field.invalid .textarea {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 12%, transparent);
}

.form-field.invalid .ff-label {
  color: var(--bad);
}

.invalid {
  animation: shake 0.36s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search .icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  font-size: 16px;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line-strong);
  outline: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
}

.search input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-700) 15%, transparent);
}

.search input::placeholder {
  color: var(--text-3);
}

/* chips (checkbox / radio pills) */

.chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip:hover {
  border-color: var(--text-3);
}

.chip[aria-pressed='true'],
.chip[aria-checked='true'] {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}

.chip .count {
  font-size: 12px;
  opacity: 0.6;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.select-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-pill select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 34px 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  outline: 0;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}

.select-pill .icon {
  position: absolute;
  right: 12px;
  font-size: 13px;
  pointer-events: none;
  color: var(--text-2);
}

.select-pill.active select {
  border-color: var(--navy-900);
  box-shadow: inset 0 0 0 1px var(--navy-900);
}

/* switch */

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--line-strong);
  transition: background 0.2s;
}

.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease);
}

.switch input:checked + span {
  background: var(--good);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* segmented */

.segmented {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line);
  user-select: none;
  max-width: 100%;
}

.segmented.block {
  display: grid;
  width: 100%;
}

.segmented button {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 var(--s-4);
  border-radius: var(--r-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s;
}

.segmented button[aria-pressed='true'] {
  color: var(--text);
  font-weight: 600;
}

.segmented .thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: var(--r-xs);
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}

/* underline tabs */

.tabs {
  display: flex;
  gap: var(--s-5);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--navy-900);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.tab-btn[aria-selected='true'] {
  color: var(--text);
  font-weight: 600;
}

.tab-btn[aria-selected='true']::after {
  transform: scaleX(1);
}

.tab-btn .count {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tab-btn .voted-dot {
  color: var(--red);
  font-size: 13px;
}

/* ───────── badges & status ───────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}

.badge .icon {
  font-size: 12px;
}

.badge.green, .badge.good { background: var(--good-soft); color: var(--good); }
.badge.orange, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.red, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gold { background: var(--gold); color: #fff; }
.badge.solid { background: rgba(7, 21, 40, 0.75); color: #fff; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 12px;
  font-weight: 600;
}

.status-pill .dot {
  color: #4ade80;
}

/* ───────── countdown ───────── */

.countdown {
  display: flex;
  gap: var(--s-4);
}

.countdown > div {
  display: grid;
  justify-items: center;
  min-width: 36px;
}

.countdown b {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.countdown small {
  font-size: 10px;
  color: var(--text-2);
}

/* ───────── media thumbnails ───────── */

.thumb-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--surface-3);
}

.thumb-media > img,
.thumb-media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-media,
.a-media,
.w-media,
.mini,
.mv-thumb {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.g-media > .thumb-media,
.a-media > .thumb-media,
.w-media > .thumb-media {
  position: absolute;
  inset: 0;
}

.thumb-media .play {
  position: absolute;
  left: 8px;
  bottom: 8px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  background: rgba(7, 21, 40, 0.65);
  pointer-events: none;
}

.thumb-text {
  display: flex;
  flex-direction: column;
  padding: var(--s-4);
  height: 100%;
  background: var(--surface-2);
  color: var(--text);
}

.thumb-text .t-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-2);
}

.thumb-text .t-title {
  font-family: var(--font-read);
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: var(--s-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumb-text .t-body {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumb-file {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--s-2);
  color: #fff;
  text-align: center;
  padding: var(--s-3);
}

.thumb-file .icon {
  font-size: 32px;
}

.thumb-file span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.count-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  background: rgba(7, 21, 40, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.count-badge i {
  width: 1px;
  height: 10px;
  margin: 0 3px;
  background: rgba(255, 255, 255, 0.35);
}

.file-block {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-5);
  text-align: center;
}

.file-block > .icon {
  font-size: 40px;
}

.theme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--navy-50);
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 600;
}

.reader {
  font-family: var(--font-read);
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 64ch;
}

/* ───────── lists ───────── */

.group {
  margin: 0 0 var(--s-6);
}

.group-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 var(--s-2);
}

.group-footer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  margin: var(--s-2) 0 0;
}

.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 52px;
  padding: 0 var(--s-4);
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.row + .row,
.row + .row-wrap,
.row-wrap + .row,
.row-wrap + .row-wrap {
  border-top: 1px solid var(--line);
}

.row-wrap {
  position: relative;
  padding: var(--s-3) var(--s-4);
}

button.row,
a.row {
  color: inherit;
  transition: background 0.15s;
}

button.row:hover,
a.row:hover {
  background: var(--surface-2);
}

.row-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--c-soft, var(--surface-3));
  color: var(--c, var(--text-2));
  font-size: 15px;
  flex: none;
}

.row-label {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
}

.row-label small {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.row-value {
  color: var(--text-2);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.row-chevron {
  color: var(--text-3);
  font-size: 15px;
}

.row.destructive {
  color: var(--bad);
  justify-content: center;
  font-weight: 600;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--s-4);
  gap: var(--s-3);
}

.field + .field,
.field + .row,
.row + .field {
  border-top: 1px solid var(--line);
}

.field > label {
  width: 140px;
  flex: none;
  font-size: 14px;
  color: var(--text-2);
}

.field input,
.field select {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  padding: 0;
}

.field input::placeholder {
  color: var(--text-3);
}

/* ───────── stars ───────── */

.stars {
  display: inline-flex;
  gap: 1px;
  color: #f5a524;
}

.stars .icon {
  font-size: 13px;
}

.stars .off {
  color: var(--line-strong);
}

.star-input {
  display: inline-flex;
  gap: 2px;
}

.star-input button {
  width: 30px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  font-size: 20px;
  color: var(--line-strong);
  transition: color 0.12s, transform 0.12s;
}

.star-input button:hover {
  transform: scale(1.12);
}

.star-input button.on {
  color: #f5a524;
}

.star-input button.on .icon,
.stars .icon.filled {
  fill: currentColor;
}

/* ───────── sheet / modal ───────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.sheet-backdrop.open {
  opacity: 1;
}

.sheet {
  position: fixed;
  z-index: 101;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-out);
  overflow: hidden;
}

.sheet.open {
  transform: translateY(0);
}

.sheet.dragging {
  transition: none;
}

.sheet-grabber {
  flex: none;
  height: 16px;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}

.sheet-grabber::after {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
}

.sheet-header {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-header .end {
  justify-self: end;
}

.sheet-header .start {
  justify-self: start;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-5) var(--gutter) calc(var(--s-5) + var(--safe-bottom));
}

.sheet-body.flush {
  padding: 0 0 calc(var(--s-5) + var(--safe-bottom));
}

.sheet-footer {
  flex: none;
  padding: var(--s-3) var(--gutter) calc(var(--s-3) + var(--safe-bottom));
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(var(--sheet-width, 560px), calc(100vw - 48px));
    max-height: min(900px, calc(100dvh - 64px));
    border-radius: var(--r-xl);
    transform: translate(-50%, -48%);
    opacity: 0;
    transition: transform 0.35s var(--ease-out), opacity 0.2s;
  }

  .sheet.open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  .sheet-grabber {
    height: 8px;
  }

  .sheet-grabber::after {
    display: none;
  }
}

/* ───────── alert ───────── */

.alert {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;
  width: min(380px, calc(100vw - 40px));
  transform: translate(-50%, -48%);
  opacity: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.alert.open {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.alert-content {
  padding: var(--s-5) var(--s-5) var(--s-3);
}

.alert h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.alert p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

.alert-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5) var(--s-5);
}

.alert-actions button {
  height: 38px;
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.alert-actions button:hover {
  background: var(--surface-2);
}

.alert-actions button.primary {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}

.alert-actions button.destructive {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

/* ───────── toast ───────── */

.toast-stack {
  position: fixed;
  z-index: 200;
  left: 0;
  right: 0;
  bottom: calc(24px + var(--safe-bottom));
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: 10px var(--s-4) 10px 14px;
  border-radius: var(--r);
  background: var(--navy-900);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.35s var(--ease-out), opacity 0.2s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

.toast .t-icon {
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #4ade80;
  flex: none;
}

.toast.error .t-icon { color: #fca5a5; }
.toast.love .t-icon { color: #fda4af; }
.toast.info .t-icon { color: #93c5fd; }

/* ───────── empty states ───────── */

.empty {
  text-align: center;
  padding: var(--s-8) var(--s-5);
  color: var(--text-2);
}

.empty .app-icon {
  margin: 0 auto var(--s-4);
  --size: 48px;
}

.empty h3 {
  margin: 0 0 var(--s-2);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.empty p {
  margin: 0 auto;
  max-width: 28em;
  font-size: 14px;
  line-height: 1.55;
}

/* ───────── progress overlay ───────── */

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 250, 0.96);
  opacity: 0;
  transition: opacity 0.25s;
}

.progress-overlay.show {
  opacity: 1;
}

.progress-box {
  width: min(440px, calc(100vw - 48px));
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.progress-pct {
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: var(--s-2);
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  margin: var(--s-5) 0 var(--s-3);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--navy-900);
  transition: width 0.25s var(--ease);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 13px;
  color: var(--text-2);
}

/* ───────── misc ───────── */

.check-anim {
  width: 56px;
  height: 56px;
}

.check-anim circle {
  fill: var(--good);
}

.check-anim path {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.45s 0.15s var(--ease) forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.fade-in {
  animation: fadeIn 0.45s var(--ease-out) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--line) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 16px;
  }
}
