/* ==========================================================================
   godkänd.app — Daylight Nordic Clarity Design System
   Shared stylesheet for landing page and /privacy, /support, /terms subpages
   ========================================================================== */

:root {
  /* Palette (OKLCH — Committed Daylight Clarity) */
  --bg-page: oklch(1.000 0.000 0);
  --bg-tint: oklch(0.972 0.012 252);
  --surface-elevated: oklch(0.986 0.005 252);

  --ink-primary: oklch(0.185 0.014 258);
  --ink-secondary: oklch(0.415 0.016 258);
  --ink-muted: oklch(0.515 0.014 258);

  --brand-blue: oklch(0.560 0.215 258);
  --brand-blue-hover: oklch(0.505 0.220 258);
  --brand-blue-tint: oklch(0.955 0.025 258);

  --signal-green: oklch(0.620 0.175 148);
  --signal-green-ink: oklch(0.450 0.155 148);
  --signal-green-tint: oklch(0.955 0.040 148);

  --signal-amber: oklch(0.750 0.165 72);
  --border-hairline: oklch(0.905 0.010 255);

  /* Typography */
  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii (strictly <= 16px for surfaces/cards; full pill for buttons) */
  --radius-card: 14px;
  --radius-dialog: 16px;
  --radius-icon: 9px;
  --radius-pill: 9999px;

  /* Spacing & Layout */
  --container-max: 1120px;
  --container-narrow: 760px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-move: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-press: 160ms;
  --dur-hover: 180ms;
  --dur-accordion: 280ms;
  --dur-modal-open: 240ms;
  --dur-modal-close: 160ms;

  /* Semantic z-index scale */
  --z-base: 1;
  --z-sticky: 20;
  --z-modal: 50;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

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

a {
  color: var(--brand-blue-hover);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-hover) ease;
}

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

[tabindex="-1"]:focus:not(:focus-visible) {
  outline: none;
}

.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;
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

.container {
  width: min(var(--container-max), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.container-narrow {
  width: min(var(--container-narrow), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* ==========================================================================
   Shared Buttons (.btn-*)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-hover) ease,
    border-color var(--dur-hover) ease,
    color var(--dur-hover) ease,
    transform var(--dur-press) var(--ease-out-expo);
}

.btn:active {
  transform: scale(0.97);
  transition-duration: 0ms;
}

.btn-primary {
  background-color: var(--brand-blue);
  color: var(--bg-page);
  box-shadow: 0 4px 10px oklch(0.560 0.215 258 / 0.20);
}

.btn-secondary {
  background-color: var(--bg-page);
  color: var(--ink-primary);
  border-color: var(--border-hairline);
}

.btn-compact {
  min-height: 44px;
  padding: 0 1.05rem;
  font-size: 0.9375rem;
}

.btn-header {
  min-height: 44px;
  padding: 0 1.05rem;
  font-size: 0.90625rem;
  gap: 0.45rem;
}

.btn-hero {
  min-height: 52px;
  padding: 0 1.5rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.btn-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background-color: var(--brand-blue-hover);
  }

  .btn-secondary:hover {
    background-color: var(--bg-tint);
    border-color: oklch(0.840 0.015 255);
  }
}

/* ==========================================================================
   Shared Header (.header) — Minimal Non-Sticky Top Bar
   ========================================================================== */

.header {
  position: relative;
  z-index: var(--z-base);
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border-hairline);
}

.header--hero {
  background: transparent;
  border-bottom: 0;
}

.header .container,
.header .header-inner {
  width: min(var(--container-max), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 76px;
  padding-block: 1rem;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-icon);
  border: 1px solid oklch(0.185 0.014 258 / 0.08);
  flex-shrink: 0;
}

.header-wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.625rem, 2.8vw, 1.5rem);
  min-width: 0;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.25rem;
  color: var(--ink-secondary);
  font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.header-link[aria-current="page"] {
  color: var(--ink-primary);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .header-link:hover {
    color: var(--ink-primary);
  }
}

@media (max-width: 374px) {
  .header-nav {
    gap: 0.5rem;
  }

  .header-link {
    font-size: 0.84375rem;
    padding-inline: 0.125rem;
  }
}

/* ==========================================================================
   Hero — Atmospheric Nordic Road Backdrop + Cohesive Phone Showcase
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-tint);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.hero-backdrop::before,
.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-backdrop::before {
  background: linear-gradient(
    180deg,
    oklch(0.975 0.012 252 / 0.96) 0%,
    oklch(0.975 0.012 252 / 0.91) 38%,
    oklch(0.975 0.012 252 / 0.52) 66%,
    oklch(0.975 0.012 252 / 0.16) 100%
  );
}

.hero-backdrop::after {
  background: linear-gradient(
    180deg,
    transparent 62%,
    oklch(1.000 0.000 0 / 0.92) 92%,
    var(--bg-page) 100%
  );
}

.hero-road-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.hero-grid {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.hero-copy {
  min-width: 0;
  animation: hero-settle 380ms var(--ease-out-expo) backwards;
}

.hero-title {
  font-size: clamp(2rem, 4.3vw, 3.7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.032em;
  color: var(--ink-primary);
  text-wrap: balance;
  max-width: 19ch;
}

.hero-subcopy {
  margin-top: 0.875rem;
  font-size: clamp(0.9875rem, 1.5vw, 1.125rem);
  line-height: 1.55;
  color: var(--ink-secondary);
  max-width: 48ch;
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.hero-trust {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-secondary);
  max-width: 44ch;
}

/* Hardware iPhone 16 Pro Showcase */
.hero-device {
  display: flex;
  justify-content: center;
  min-width: 0;
  animation: hero-settle 460ms var(--ease-out-expo) 60ms backwards;
}

.device-frame {
  position: relative;
  width: min(264px, 68vw);
  aspect-ratio: 1022 / 2082;
  filter: drop-shadow(0 18px 26px oklch(0.185 0.014 258 / 0.14));
  animation: device-float 6.5s ease-in-out infinite;
}

.device-bezel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* Exact hardware cutout mask matching iphone_frame.png (1022 x 2082) */
.device-screen {
  position: absolute;
  z-index: 2;
  left: 4.3%;
  top: 1.75%;
  width: 91.4%;
  height: 96.5%;
  border-radius: 12.5% / 5.8%;
  overflow: hidden;
  background-color: var(--bg-tint);
}

.device-video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: transparent;
}

.device-video[hidden] {
  display: none;
}

/* Fallback preview inside bezel while demo_hero.mp4 buffers */
.device-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15% 7% 7%;
  background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg-page) 45%);
  color: var(--ink-primary);
  pointer-events: none;
  user-select: none;
}

.device-fallback-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.device-fallback-progress span {
  height: 3px;
  border-radius: var(--radius-pill);
  background-color: oklch(0.905 0.010 255);
}

.device-fallback-progress span:first-child {
  background-color: var(--brand-blue);
}

.device-fallback-heading {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.device-fallback-sub {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--ink-secondary);
  line-height: 1.3;
}

.device-fallback-scene {
  flex: 1;
  margin-top: 0.625rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background-color: oklch(0.865 0.045 145);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-fallback-scene svg {
  width: 100%;
  height: 100%;
}

.device-fallback-prompt {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-pill);
  background-color: oklch(0.99 0.003 252 / 0.92);
  color: var(--ink-primary);
  font-size: 0.625rem;
  font-weight: 600;
  text-align: center;
}

.device-audio-toggle {
  position: absolute;
  z-index: 3;
  top: 7.4%;
  right: 4.5%;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.device-audio-toggle[hidden] {
  display: none;
}

.device-audio-pill {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background-color: oklch(0.185 0.014 258 / 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--bg-page);
  display: inline-grid;
  place-items: center;
  transition:
    background-color var(--dur-hover) ease,
    transform var(--dur-press) var(--ease-out-expo);
}

.device-audio-toggle:active .device-audio-pill {
  transform: scale(0.94);
}

.device-audio-icon {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 180ms ease,
    transform 180ms var(--ease-out-expo);
}

.device-audio-toggle[data-muted="true"] .device-audio-icon[data-icon="muted"],
.device-audio-toggle[data-muted="false"] .device-audio-icon[data-icon="unmuted"] {
  opacity: 1;
  transform: scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .device-audio-toggle:hover .device-audio-pill {
    background-color: oklch(0.185 0.014 258 / 0.90);
  }
}

@media (min-width: 768px) {
  .hero-subcopy {
    margin-top: 1.25rem;
  }

  .hero-actions {
    margin-top: 1.875rem;
    gap: 0.875rem;
  }

  .device-frame {
    width: clamp(278px, 25vw, 312px);
  }
}

@media (min-width: 900px) {
  .hero {
    min-height: clamp(660px, 86vh, 880px);
    display: flex;
    flex-direction: column;
  }

  .hero-backdrop::before {
    background: linear-gradient(
      100deg,
      oklch(0.975 0.012 252 / 0.96) 0%,
      oklch(0.975 0.012 252 / 0.86) 42%,
      oklch(0.975 0.012 252 / 0.24) 68%,
      transparent 100%
    );
  }

  .hero-grid {
    flex: 1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-content: center;
    padding-top: clamp(2.5rem, 5vw, 4.25rem);
    padding-bottom: clamp(3.5rem, 6vw, 5rem);
  }

  .hero-device {
    justify-content: flex-end;
    justify-self: end;
  }
}

@keyframes hero-settle {
  from {
    opacity: 0.92;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes device-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ==========================================================================
   Shared Editorial Section Typography & Asymmetric Rhythm
   ========================================================================== */

.section {
  padding-block: clamp(4rem, 7.5vw, 6.25rem);
  scroll-margin-top: 2rem;
}

.section-tint {
  background-color: var(--bg-tint);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

.section-heading {
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.section-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.section-process {
  padding-top: clamp(3rem, 5.5vw, 4.75rem);
}

@media (min-width: 900px) {
  .section-split {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
  }

  .section-split-aside {
    position: sticky;
    top: 2.5rem;
  }
}

/* ==========================================================================
   Section 2: Så funkar det — Pre-rendered Retina Lock-Screen Showcase
   ========================================================================== */

.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.lockscreen-stage {
  margin-inline: auto;
  width: min(320px, 84vw);
  filter: drop-shadow(0 16px 24px oklch(0.185 0.014 258 / 0.12));
  user-select: none;
}

.lockscreen-img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 900px) {
  .showcase-grid {
    grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
    grid-template-rows: auto auto;
    gap: 1.5rem clamp(2.5rem, 5vw, 4.5rem);
  }

  .showcase-media {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    justify-self: start;
    margin-inline: 0;
    width: min(312px, 100%);
  }

  .showcase-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .showcase-steps {
    grid-column: 2;
    grid-row: 2;
  }
}

.process-list {
  list-style: none;
  padding: 0;
}

.process-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 1.25rem;
  padding-block: clamp(1.5rem, 3vw, 2.125rem);
  border-top: 1px solid var(--border-hairline);
  align-items: start;
}

.process-item:last-child {
  border-bottom: 1px solid var(--border-hairline);
}

.process-marker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.15rem;
}

.process-num {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.process-icon {
  width: 24px;
  height: 24px;
  color: var(--brand-blue);
  flex-shrink: 0;
}

.process-icon--green {
  color: var(--signal-green-ink);
}

.process-title {
  font-size: clamp(1.1875rem, 1.9vw, 1.375rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.process-copy {
  margin-top: 0.5rem;
  color: var(--ink-secondary);
  max-width: 54ch;
  text-wrap: pretty;
}

@media (max-width: 520px) {
  .process-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.625rem;
  }
}

/* ==========================================================================
   Section 3: Standalone vs. Companion + Centered Editorial Facts Strip
   ========================================================================== */

.companion-block {
  max-width: 54rem;
  margin-inline: auto;
  text-align: center;
}

.companion-block .section-heading {
  max-width: 24ch;
  margin-inline: auto;
}

.companion-copy {
  margin: 1.25rem auto 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 58ch;
  text-wrap: pretty;
}

.facts-strip {
  margin-top: clamp(2.25rem, 4.5vw, 3rem);
  padding-top: clamp(1.875rem, 3.75vw, 2.375rem);
  border-top: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.facts-cell {
  padding: 1.125rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.375rem;
}

.facts-cell + .facts-cell {
  border-top: 1px solid var(--border-hairline);
}

.facts-value {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(1.875rem, 3vw, 2.375rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}

.facts-label {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-secondary);
}

@media (min-width: 680px) {
  .facts-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts-cell {
    padding: 0.375rem 1.5rem;
  }

  .facts-cell + .facts-cell {
    border-top: 0;
    border-left: 1px solid var(--border-hairline);
  }
}

/* ==========================================================================
   Section 4 & Shared FAQ Accordion (.faq-*)
   ========================================================================== */

.faq-list {
  border-top: 1px solid var(--border-hairline);
}

.faq-item {
  border-bottom: 1px solid var(--border-hairline);
}

.faq-question {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.faq-trigger {
  width: 100%;
  min-height: 56px;
  padding: 1.25rem 0;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  text-align: left;
  font-size: clamp(1.0625rem, 1.5vw, 1.15rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--dur-hover) ease;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ink-muted);
  transition:
    transform var(--dur-accordion) var(--ease-out-expo),
    color var(--dur-hover) ease;
}

.faq-item[data-open="true"] .faq-chevron {
  transform: rotate(45deg);
  color: var(--brand-blue);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-accordion) var(--ease-out-expo);
}

.faq-item[data-open="true"] .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.faq-answer {
  padding-bottom: 1.5rem;
  color: var(--ink-secondary);
  line-height: 1.65;
  max-width: 62ch;
  opacity: 0;
  transition: opacity 200ms ease;
}

.faq-item[data-open="true"] .faq-answer {
  opacity: 1;
  transition-delay: 40ms;
}

@media (hover: hover) and (pointer: fine) {
  .faq-trigger:hover {
    color: var(--brand-blue-hover);
  }
}

/* ==========================================================================
   Pre-Launch Modal (<dialog>)
   ========================================================================== */

.modal-dialog {
  margin: auto;
  padding: 0;
  width: min(460px, calc(100% - 2rem));
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-dialog);
  background-color: var(--bg-page);
  color: var(--ink-primary);
  opacity: 1;
  transform: scale(1);
  transform-origin: center;
  transition:
    opacity var(--dur-modal-open) var(--ease-out-expo),
    transform var(--dur-modal-open) var(--ease-out-expo);
}

.modal-dialog::backdrop {
  background-color: oklch(0.185 0.014 258 / 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity var(--dur-modal-open) ease;
}

@starting-style {
  .modal-dialog[open] {
    opacity: 0;
    transform: scale(0.96);
  }

  .modal-dialog[open]::backdrop {
    opacity: 0;
  }
}

.modal-dialog.is-closing {
  opacity: 0;
  transform: scale(0.96);
  transition-duration: var(--dur-modal-close);
}

.modal-dialog.is-closing::backdrop {
  opacity: 0;
  transition-duration: var(--dur-modal-close);
}

.modal-surface {
  padding: clamp(1.375rem, 3.5vw, 1.875rem);
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title {
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.modal-close-icon {
  margin: -0.375rem -0.375rem 0 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  transition:
    background-color var(--dur-hover) ease,
    color var(--dur-hover) ease;
}

.modal-body {
  margin-top: 0.875rem;
  display: grid;
  gap: 0.75rem;
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.modal-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (hover: hover) and (pointer: fine) {
  .modal-close-icon:hover {
    background-color: var(--bg-tint);
    color: var(--ink-primary);
  }
}

/* ==========================================================================
   Shared Footer (.footer)
   ========================================================================== */

.footer {
  background-color: var(--bg-tint);
  border-top: 1px solid var(--border-hairline);
  padding-block: clamp(2rem, 4.5vw, 2.75rem);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--ink-primary);
  font-weight: 500;
}

.footer-brand a {
  color: var(--ink-primary);
  text-decoration: none;
}

.footer-sep {
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
}

.footer-links a[aria-current="page"] {
  color: var(--ink-primary);
  font-weight: 600;
}

.footer-meta {
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover,
  .footer-brand a:hover {
    color: var(--brand-blue-hover);
    text-decoration: underline;
  }
}

@media (min-width: 768px) {
  .footer-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Shared Subpage & Legal Layout (.subpage-*, .legal-*)
   Consumed by privacy.html, support.html, terms.html
   ========================================================================== */

.subpage-main {
  padding-block: clamp(2.5rem, 6vw, 4.25rem);
  min-height: 65vh;
}

.subpage-header {
  padding-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--border-hairline);
}

.subpage-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.subpage-title {
  font-size: clamp(1.875rem, 3.8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.subpage-lead {
  margin-top: 0.875rem;
  font-size: clamp(1.03125rem, 1.6vw, 1.15rem);
  line-height: 1.58;
  color: var(--ink-secondary);
  max-width: 60ch;
  text-wrap: pretty;
}

.subpage-updated {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.subpage-content {
  padding-top: clamp(2rem, 4vw, 2.75rem);
}

.subpage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.subpage-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
}

.subpage-nav a[aria-current="page"] {
  color: var(--ink-primary);
  font-weight: 600;
}

.legal-prose {
  max-width: 65ch;
  color: var(--ink-secondary);
  line-height: 1.68;
}

.legal-section + .legal-section {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding-top: clamp(2rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--border-hairline);
}

.legal-prose h2,
.legal-section h2 {
  font-size: clamp(1.3125rem, 2.2vw, 1.5625rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin-bottom: 0.875rem;
}

.legal-prose h3,
.legal-section h3 {
  font-size: 1.09375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-prose p + p,
.legal-section p + p,
.legal-list + p {
  margin-top: 0.9375rem;
}

.legal-list {
  margin: 0.875rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.legal-list li::marker {
  color: var(--ink-muted);
}

.legal-summary {
  margin-bottom: 2.25rem;
  padding: 1.375rem 1.5rem;
  background-color: var(--bg-tint);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
}

.legal-summary-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 0.75rem;
}

.legal-dl {
  display: grid;
  gap: 0.875rem;
}

.legal-dl-row {
  display: grid;
  gap: 0.2rem;
}

.legal-dl dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.legal-dl dd {
  font-size: 0.96875rem;
  color: var(--ink-secondary);
}

.legal-table-wrap {
  margin-top: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
  background-color: var(--bg-page);
}

.legal-table th,
.legal-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

.legal-table th {
  font-weight: 600;
  color: var(--ink-primary);
  background-color: var(--surface-elevated);
}

.legal-table td {
  color: var(--ink-secondary);
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-contact {
  margin-top: 2.25rem;
  padding: 1.5rem;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  display: grid;
  gap: 0.625rem;
}

.legal-contact h2,
.legal-contact h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.legal-contact p {
  margin: 0;
  color: var(--ink-secondary);
}

@media (hover: hover) and (pointer: fine) {
  .subpage-back:hover,
  .subpage-nav a:hover {
    color: var(--brand-blue-hover);
  }
}

@media (min-width: 640px) {
  .legal-dl-row {
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
    gap: 1rem;
  }
}

/* ==========================================================================
   Scroll-Triggered Floating CTA (.floating-cta) — Sticky Top-Right
   ========================================================================== */

.floating-cta {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 1rem));
  right: max(var(--gutter), calc((100% - var(--container-max)) / 2));
  z-index: var(--z-sticky);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 260ms var(--ease-out-expo);
}

.floating-cta[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-floating {
  min-height: 44px;
  padding: 0 1.05rem;
  font-size: 0.90625rem;
  gap: 0.45rem;
  box-shadow:
    0 6px 18px oklch(0.560 0.215 258 / 0.24),
    0 2px 6px oklch(0.185 0.014 258 / 0.10);
}

/* ==========================================================================
   Reduced Motion (Mandatory Accessibility Guard)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .device-frame {
    animation: none !important;
  }

  .floating-cta {
    transform: none !important;
  }
}
