@import "tailwindcss";

:root {
  --background: #f7f8f4;
  --surface: #ffffff;
  --surface-secondary: #f0f3ed;
  --surface-elevated: #ffffff;
  --foreground: #182018;
  --muted: #687269;
  --border: #dde3dc;
  --accent: #0b855b;
  --highlight: #a7e05e;
  --accent-strong: #086342;
  --accent-foreground: #f7f8f4;
  --primary: #0b855b;
  --primary-dark: #086342;
  --primary-light: #ddf5e9;
  --cta: #086342;
  --cta-foreground: #ffffff;
  --inverse: #f7f8f4;
  --inverse-muted: rgba(247, 248, 244, 0.72);
  --panel: #086342;
  --cta-panel: #182018;
  --shadow-color: rgba(24, 32, 28, 0.45);
  --section-hero: #f7f8f4;
  --section-features: #f2f5ef;
  --section-about: #f7f8f4;
  --section-discovery: #f0f3ed;
  --section-lists: #f7f8f4;
  --section-household: #f0f3ed;
  --section-ranking: #f7f8f4;
  --section-how: #f0f3ed;
  --section-story: #f7f8f4;
  --section-privacy: #f7f8f4;
  --section-cta: #f7f8f4;
  --section-faq: #f7f8f4;
  --section-footer: #eef2ea;
  --nav-bg: rgba(247, 248, 244, 0.4);
  --nav-bg-scrolled: rgba(247, 248, 244, 0.82);
}

html[data-theme="dark"] {
  --background: #142016;
  --surface: #19251a;
  --surface-secondary: #1d2b1e;
  --surface-elevated: #223223;
  --foreground: #f1f5ef;
  --muted: #aeb9ad;
  --border: rgba(210, 230, 210, 0.14);
  --accent: #55e6ad;
  --highlight: #55e6ad;
  --accent-strong: #2fcf92;
  --accent-foreground: #0e1a12;
  --primary: #2fcf92;
  --primary-dark: #7ee0b8;
  --primary-light: rgba(47, 207, 146, 0.14);
  --cta: #2fcf92;
  --cta-foreground: #0e1a12;
  --inverse: #f1f5ef;
  --inverse-muted: rgba(241, 245, 239, 0.72);
  --panel: #1a2e1e;
  --cta-panel: #1a3d2c;
  --shadow-color: rgba(8, 24, 12, 0.55);
  --section-hero: #142016;
  --section-features: #162218;
  --section-about: #162218;
  --section-discovery: #172319;
  --section-lists: #172319;
  --section-household: #142016;
  --section-ranking: #19261a;
  --section-how: #131c15;
  --section-story: #152117;
  --section-privacy: #142016;
  --section-cta: #172419;
  --section-faq: #152117;
  --section-footer: #101810;
  --nav-bg: rgba(20, 32, 22, 0.45);
  --nav-bg-scrolled: rgba(20, 32, 22, 0.82);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-muted: var(--muted);
  --color-border: var(--border);
  --color-surface: var(--surface);
  --color-surface-secondary: var(--surface-secondary);
  --color-surface-elevated: var(--surface-elevated);
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-dark);
  --color-primary-light: var(--primary-light);
  --color-accent: var(--accent);
  --color-highlight: var(--highlight);
  --color-accent-strong: var(--accent-strong);
  --color-accent-foreground: var(--accent-foreground);
  --color-cta: var(--cta);
  --color-cta-foreground: var(--cta-foreground);
  --color-inverse: var(--inverse);
  --color-inverse-muted: var(--inverse-muted);
  --color-panel: var(--panel);
  --color-cta-panel: var(--cta-panel);
  --font-sans: var(--font-inter), "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", sans-serif;
}

:root {
  --font-inter: "Inter", ui-sans-serif, system-ui, sans-serif;
}

@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));

html {
  background: var(--background);
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  /* Modal scroll-lock'ta scrollbar kaybolunca yatay layout shift olmasın */
  scrollbar-gutter: stable;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family:
    var(--font-sans),
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans",
    "Hiragino Sans GB",
    "Noto Sans JP",
    "Noto Sans KR",
    "Noto Sans Arabic",
    "Geeza Pro",
    "Apple Color Emoji",
    "Segoe UI Emoji",
    sans-serif;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Yüksek çözünürlüklü logo.png navbar/footer'da şişmesin (Next Image h-8/sm:h-9) */
.brand-logo {
  width: auto;
  height: 2rem;
  max-width: 2.25rem;
  max-height: 2rem;
  flex-shrink: 0;
  object-fit: contain;
}

@media (min-width: 640px) {
  .brand-logo {
    height: 2.25rem;
    max-height: 2.25rem;
    max-width: 2.5rem;
  }
}

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

.container-shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px -28px var(--shadow-color);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
}

.nav-shell {
  background: var(--nav-bg);
  overflow: visible;
}

/* scrollbar-gutter desteklenmeyen tarayıcılarda fixed navbar kaymasını önle */
html.is-scroll-locked .nav-shell {
  padding-right: var(--scrollbar-compensation, 0px);
}

.nav-shell.is-scrolled {
  background: var(--nav-bg-scrolled);
  border-color: var(--border);
  box-shadow: 0 8px 30px -24px var(--shadow-color);
}

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

  .reveal,
  .reveal-delay,
  .float-phone,
  .card {
    animation: none !important;
    transition: none !important;
  }

  .card:hover {
    transform: none;
  }

  .faq-item,
  .faq-question,
  .faq-answer,
  .faq-answer-content,
  .faq-icon-bar {
    transition: none !important;
  }

  .faq-answer-content {
    transform: none;
  }

  .theme-switch,
  .theme-switch-knob,
  .theme-switch-icon {
    transition: none !important;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes float-y {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

.reveal {
  animation: fade-up 0.7s ease both;
}

.reveal-delay {
  animation: fade-up 0.8s ease 0.12s both;
}

.float-phone {
  animation: float-y 4.5s ease-in-out infinite alternate;
}

/* iPhone mockup: dengeli cihaz oranı + dolu iç ekran yerleşimi */
.phone-preview {
  width: 100%;
  max-width: min(250px, calc(100% - 0.5rem));
  margin-inline: auto;
  container-type: inline-size;
  container-name: phone;
}

@media (min-width: 640px) {
  .phone-preview {
    max-width: 270px;
  }
}

@media (min-width: 1280px) {
  .phone-preview {
    max-width: 286px;
  }
}

.phone-preview-frame {
  /* 9/19.5 fazla uzundu; 9/18 doğal orta nokta */
  aspect-ratio: 9 / 18;
  display: flex;
  box-sizing: border-box;
  padding: clamp(0.42rem, 3.2cqi, 0.65rem);
  /* Kasa temadan bağımsız: her zaman koyu bezel */
  border: 1px solid #1c2220;
  border-radius: clamp(1.75rem, 13cqi, 2.4rem);
  background: #0b0f0d;
  box-shadow: 0 30px 80px -24px var(--shadow-color);
}

.phone-preview-screen {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: clamp(1.3rem, 10cqi, 1.9rem);
  background: var(--background);
}

.phone-preview-status {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem 0.2rem;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1;
}

.phone-preview-time,
.phone-preview-status-end {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
}

.phone-preview-time {
  text-align: start;
}

.phone-preview-island {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  z-index: 0;
  width: clamp(3.5rem, 34cqi, 4.85rem);
  height: 0.88rem;
  border-radius: 999px;
  background: #0b0f0d;
  transform: translateX(-50%);
  pointer-events: none;
}

.phone-preview-status-end {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
}

.phone-preview-signal {
  display: block;
  width: 0.9rem;
  height: 0.6rem;
  flex-shrink: 0;
  color: currentColor;
}

.phone-preview-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem 0.8rem;
}

.phone-preview-header {
  flex-shrink: 0;
}

.phone-preview-eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.3;
}

.phone-preview-title {
  margin: 0.15rem 0 0;
  color: var(--foreground);
  font-size: clamp(1.02rem, 6.8cqi, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.phone-preview-banner {
  margin-top: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.8rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.phone-preview-list {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.phone-preview-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface);
}

.phone-preview-item-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
}

.phone-preview-check {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
}

.phone-preview-check.is-checked {
  border-color: var(--primary);
  background: var(--primary);
}

.phone-preview-item-name {
  min-width: 0;
  overflow: hidden;
  color: var(--foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-preview-item-price {
  flex-shrink: 0;
  color: var(--muted);
}

.phone-preview-cta {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.7rem 0.7rem;
  border-radius: 0.85rem;
  background: var(--cta);
  color: var(--cta-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.theme-switch {
  --theme-switch-inset: 3px;
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  justify-items: stretch;
  width: 5.25rem;
  height: 2.5rem;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition:
    border-color 220ms ease,
    background-color 220ms ease;
}

.theme-switch:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.theme-switch-knob {
  position: absolute;
  top: var(--theme-switch-inset);
  right: auto;
  bottom: var(--theme-switch-inset);
  left: var(--theme-switch-inset);
  z-index: 0;
  box-sizing: border-box;
  width: calc(50% - var(--theme-switch-inset));
  height: auto;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-light) 82%, transparent);
  box-shadow: 0 0 2px color-mix(in srgb, var(--shadow-color) 30%, transparent);
  transition:
    transform 220ms ease-out,
    background-color 220ms ease;
  pointer-events: none;
}

.theme-switch[data-theme-mode="dark"] .theme-switch-knob {
  transform: translateX(100%);
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

.theme-switch-icon {
  position: relative;
  z-index: 2;
  grid-row: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 0;
  transition:
    color 220ms ease,
    opacity 220ms ease;
  pointer-events: none;
}

.theme-switch-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  margin: 0;
  flex-shrink: 0;
  overflow: visible;
}

.theme-switch-icon-sun {
  grid-column: 1;
  color: var(--accent-strong);
  opacity: 1;
}

.theme-switch-icon-moon {
  grid-column: 2;
  color: color-mix(in srgb, var(--muted) 70%, var(--foreground));
  opacity: 0.62;
}

.theme-switch[data-theme-mode="dark"] .theme-switch-icon-sun {
  color: color-mix(in srgb, var(--muted) 55%, var(--accent));
  opacity: 0.6;
}

.theme-switch[data-theme-mode="dark"] .theme-switch-icon-moon {
  color: color-mix(in srgb, var(--accent) 35%, #f4faf6);
  opacity: 1;
}

.hero-section {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--section-hero);
  border: 0;
  box-shadow: none;
}

/* Mobilde gizle; tablet (768px+) ve masaüstünde göster */
.hero-phone {
  display: none;
}

@media (min-width: 768px) {
  .hero-phone {
    display: block;
  }
}

.hero-section::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  z-index: 1;
  height: 72px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--section-hero) 0%, transparent) 0%,
    var(--section-features) 100%
  );
}

@media (min-width: 768px) {
  .hero-section::after {
    height: 120px;
  }
}

.features-section {
  position: relative;
  background: var(--section-features);
  border: 0;
  box-shadow: none;
}

.faq-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 1.25rem;
  transition:
    border-color 200ms ease,
    background-color 200ms ease;
}

.faq-item:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--surface-secondary);
}

.faq-item[data-open="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: var(--surface);
}

.faq-question {
  color: var(--foreground);
  transition: color 200ms ease;
}

.faq-item[data-open="true"] .faq-question {
  color: var(--primary-dark);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 300ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 250ms ease-out;
}

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

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

.faq-answer-content {
  transform: translateY(-4px);
  transition: transform 300ms ease-out;
}

.faq-answer[data-open="true"] .faq-answer-content {
  transform: translateY(0);
}

.faq-icon {
  position: relative;
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: var(--muted);
}

.faq-item[data-open="true"] .faq-icon {
  color: var(--primary-dark);
}

.faq-icon-bar {
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  width: 0.75rem;
  height: 1.75px;
  margin-inline-start: -0.375rem;
  margin-top: -0.875px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 300ms ease-out,
    opacity 250ms ease-out;
}

.faq-icon-bar-v {
  transform: rotate(90deg);
}

.faq-item[data-open="true"] .faq-icon-bar-v {
  opacity: 0;
  transform: rotate(90deg) scaleX(0);
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 12.5rem;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 12px 32px -24px var(--shadow-color);
  animation: lang-pop 160ms ease-out both;
}

.lang-popover-menu {
  inset-inline: 0;
  width: 100%;
  max-width: none;
}

.lang-popover-divider {
  margin: 0.25rem 0.25rem;
  border-top: 1px solid var(--border);
}

.lang-option {
  display: flex;
  min-width: 0;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.25;
  text-align: start;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.lang-option:hover {
  background: var(--surface-secondary);
}

.lang-option.is-active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.lang-option-all {
  font-weight: 500;
}

.lang-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  isolation: isolate;
}

.lang-modal-root[hidden] {
  display: none !important;
}

.lang-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 10, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease;
}

html[data-theme="dark"] .lang-modal-backdrop {
  background: rgba(8, 12, 10, 0.42);
}

.lang-modal-root.is-open .lang-modal-backdrop {
  opacity: 1;
}

.lang-modal {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(760px, 100%);
  max-height: min(78vh, 720px);
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 60px -28px var(--shadow-color);
  opacity: 0;
  transform: scale(0.96);
  transform-origin: center center;
  transition:
    opacity 200ms ease,
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lang-modal-root.is-open .lang-modal {
  opacity: 1;
  transform: scale(1);
}

.lang-modal-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

.lang-modal-search {
  flex-shrink: 0;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
}

.lang-modal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 28px;
  justify-content: center;
  align-items: start;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 0 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
}

.lang-modal-list .lang-option {
  width: auto;
  min-height: 38px;
  justify-content: flex-start;
  padding-inline: 0.5rem;
}

.lang-modal-empty {
  grid-column: 1 / -1;
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .lang-modal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lang-modal-root {
    padding: 16px;
  }

  .lang-modal {
    width: 100%;
    max-height: min(80vh, 720px);
    padding: 20px 16px 16px;
    border-radius: 1.25rem;
  }

  .lang-modal-list {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 8px 0;
  }
}

@keyframes lang-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-popover,
  .lang-modal-root,
  .lang-modal-backdrop,
  .lang-modal {
    animation: none !important;
    transition: none !important;
  }

  .lang-modal {
    transform: none;
  }
}

.cookies-badge {
  position: fixed;
  z-index: 45;
  left: max(1rem, env(safe-area-inset-left, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 6px 18px -14px var(--shadow-color);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.back-to-top {
  position: fixed;
  z-index: 44;
  inset-inline-end: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent) 12%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, var(--background));
  color: var(--primary-dark);
  box-shadow: 0 10px 24px -18px var(--shadow-color);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.4rem);
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.back-to-top-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.back-to-top:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface-elevated);
  color: var(--accent-strong);
  box-shadow: 0 12px 28px -16px var(--shadow-color);
}

.back-to-top:active {
  transform: scale(0.96);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

html[data-theme="dark"] .back-to-top {
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent) 30%);
  background: color-mix(in srgb, var(--surface-elevated) 88%, #0c1510);
  color: var(--primary);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .back-to-top:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--surface-elevated);
  color: var(--highlight);
}

@media (min-width: 768px) {
  .back-to-top {
    inset-inline-end: max(1.25rem, env(safe-area-inset-right, 0px));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
    transform: none;
  }

  .back-to-top:active {
    transform: none;
  }
}

.cookies-badge-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  flex-shrink: 0;
}

.cookies-badge:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface-elevated);
}

.cookies-badge:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.cookies-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
}

.cookies-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 20, 12, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease;
}

html[data-theme="dark"] .cookies-modal-backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.cookies-modal {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100% - 32px));
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: 0 22px 48px -28px var(--shadow-color);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.cookies-modal-root.is-open .cookies-modal-backdrop,
.cookies-modal-root.is-open .cookies-modal {
  opacity: 1;
}

.cookies-modal-root.is-open .cookies-modal {
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .cookies-badge,
  .cookies-modal-backdrop,
  .cookies-modal {
    transition: none !important;
  }

  .cookies-modal {
    transform: none;
  }
}

.legal-page {
  background: var(--background);
}

.legal-toc {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  padding: 0.75rem;
}

.legal-toc-toggle {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.legal-toc-panel {
  margin-top: 0.35rem;
  max-height: min(70vh, 36rem);
  overflow: auto;
  padding: 0.25rem;
}

.legal-prose a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 1024px) {
  .legal-toc {
    padding: 1rem;
  }

  .legal-toc-panel {
    margin-top: 0;
    max-height: calc(100vh - 9rem);
  }
}
