/* ==========================================================================
   Emby Technology — Base
   Fonts, design tokens, reset, typography, buttons and shared utilities.
   ========================================================================== */

/* ---------- Lenis smooth scroll (vendor, v1.1.13) ---------- */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand (from logo) */
  --navy: #071b3e;
  --navy-800: #0f2550;
  --slate: #7d8294;
  --cyan: #00ccff;
  --blue: #0157f4;
  --gradient: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 100%);

  /* Light theme surfaces */
  --bg: #f6f7f9;
  --bg-alt: #eef0f4;
  --surface: #ffffff;
  --line: rgba(7, 27, 62, 0.1);
  --line-strong: rgba(7, 27, 62, 0.18);

  /* Text */
  --text: var(--navy);
  --text-muted: #5b6275;
  --text-faint: #676d80; /* slate, deepened to pass WCAG AA on all surfaces */

  /* Type */
  --font-sans: "Satoshi", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(3.25rem, 8.6vw, 9.25rem);
  --fs-h1: clamp(2.75rem, 6vw, 6rem);
  --fs-h2: clamp(2.25rem, 4.6vw, 4.5rem);
  --fs-h3: clamp(1.375rem, 2vw, 1.75rem);
  --fs-lead: clamp(1.0625rem, 1.25vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  /* Layout */
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max-width: 1440px;
  --nav-h: 76px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  /* Elevation — long, soft shadows */
  --shadow-sm: 0 1px 2px rgba(7, 27, 62, 0.04), 0 4px 12px rgba(7, 27, 62, 0.04);
  --shadow: 0 2px 4px rgba(7, 27, 62, 0.03), 0 18px 48px -12px rgba(7, 27, 62, 0.12);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
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;
}

::selection {
  background: var(--navy);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Film grain — gives the flat light background a printed, tactile quality */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.045;
  background-image: 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='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
.display,
.h1,
.h2 {
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.display {
  font-size: var(--fs-display);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.h1 {
  font-size: var(--fs-h1);
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34em;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.label__index {
  color: var(--navy);
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* keep descenders from clipping inside line masks */
  padding-bottom: 0.08em;
}

/* SplitType line masks */
.line-mask {
  display: block;
  overflow: hidden;
  /* room for descenders */
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.line-mask > .line {
  display: block;
  will-change: transform;
}

/* ---------- Layout utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  height: var(--btn-h);
  padding: 0 0.5rem 0 1.625rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}

/* Fill that sweeps in on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.6s var(--ease-out);
}

.btn:hover::before {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Text roll: label slides up, a copy slides in from below */
.btn__text {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 1.3;
}

.btn__text span {
  display: block;
  transition: transform 0.55s var(--ease-out);
}

.btn__text span + span {
  position: absolute;
  inset: 0;
  transform: translateY(105%);
}

.btn:hover .btn__text span:first-child {
  transform: translateY(-105%);
}

.btn:hover .btn__text span + span {
  transform: none;
}

.btn__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.55s var(--ease-out), background-color 0.4s;
}

.btn__icon svg {
  width: 16px;
  height: 16px;
}

.btn:hover .btn__icon {
  transform: rotate(-45deg);
}

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

.btn--primary::before {
  background: var(--gradient);
}

.btn--primary .btn__icon {
  background: rgba(255, 255, 255, 0.12);
}

.btn--ghost {
  color: var(--navy);
  border: 1px solid var(--line-strong);
  padding-right: 1.625rem;
}

.btn--ghost::before {
  background: var(--navy);
}

.btn--ghost:hover {
  color: #fff;
  border-color: var(--navy);
}

.btn--sm {
  --btn-h: 44px;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.btn--sm .btn__icon {
  width: 32px;
  height: 32px;
}

/* Text link with animated underline */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Brand mark (8 spokes) ---------- */
.mark {
  overflow: visible;
}

.mark line {
  stroke: url(#emby-gradient);
  stroke-width: 8.53;
  stroke-linecap: round;
}

/* Hidden defs holder — must not be display:none or gradients stop rendering */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
