:root,
html[data-theme="day"] {
  --ink: #171717;
  --ink-soft: #525252;
  --ink-faint: #737373;
  --paper: #ffffff;
  --paper-muted: #f5f5f5;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #c43b3b;
  --accent-deep: #941f1e;
  --accent-soft: #fecaca;
  --accent-glow: rgba(196, 59, 59, 0.18);
  --hero-a: #171717;
  --hero-b: #262626;
  --hero-c: #1a1a1a;
  --hero-glow: rgba(196, 59, 59, 0.32);
  --tile-source-a: #404040;
  --tile-source-b: #262626;
  --tile-source-hover-a: #4a4a4a;
  --tile-source-hover-b: #2d2d2d;
  --tile-target-a: #482424;
  --tile-target-b: #2a1818;
  --topbar-a: rgba(38, 38, 38, 0.94);
  --topbar-b: rgba(23, 23, 23, 0.94);
  --grid-line: rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shell-max: 1200px;
  --header-h: 64px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --scroll-track: transparent;
  --scroll-thumb: rgba(0, 0, 0, 0.22);
  --scroll-thumb-hover: rgba(0, 0, 0, 0.38);
}

html.night,
html[data-theme="night"] {
  --ink: #f5f5f5;
  --ink-soft: #d4d4d4;
  --ink-faint: #a3a3a3;
  --paper: #171717;
  --paper-muted: #262626;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #c43b3b;
  --accent-deep: #941f1e;
  --accent-soft: #fecaca;
  --accent-glow: rgba(196, 59, 59, 0.22);
  --hero-a: #0f0f0f;
  --hero-b: #1c1c1c;
  --hero-c: #141414;
  --hero-glow: rgba(196, 59, 59, 0.34);
  --tile-source-a: #3a3a3a;
  --tile-source-b: #222222;
  --tile-source-hover-a: #464646;
  --tile-source-hover-b: #2c2c2c;
  --tile-target-a: #482424;
  --tile-target-b: #2a1818;
  --topbar-a: rgba(28, 28, 28, 0.94);
  --topbar-b: rgba(15, 15, 15, 0.94);
  --grid-line: rgba(255, 255, 255, 0.08);
  --scroll-track: transparent;
  --scroll-thumb: rgba(255, 255, 255, 0.22);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.38);
}

html[data-theme="ocean"] {
  --ink: #0b1c28;
  --ink-soft: #3d5a6c;
  --ink-faint: #6b8494;
  --paper: #f4f9fc;
  --paper-muted: #e4eef5;
  --line: rgba(15, 60, 90, 0.1);
  --accent: #0e7490;
  --accent-deep: #0a5a70;
  --accent-soft: #a5f3fc;
  --accent-glow: rgba(14, 116, 144, 0.2);
  --hero-a: #0b3a4a;
  --hero-b: #0e5a6e;
  --hero-c: #0a2f3d;
  --hero-glow: rgba(14, 116, 144, 0.36);
  --tile-source-a: #1a5568;
  --tile-source-b: #123e4c;
  --tile-source-hover-a: #226578;
  --tile-source-hover-b: #184a5a;
  --tile-target-a: #0f6f86;
  --tile-target-b: #0a4a5c;
  --topbar-a: rgba(14, 58, 74, 0.94);
  --topbar-b: rgba(11, 47, 61, 0.94);
  --grid-line: rgba(255, 255, 255, 0.1);
  --scroll-thumb: rgba(14, 116, 144, 0.35);
  --scroll-thumb-hover: rgba(14, 116, 144, 0.5);
}

html[data-theme="forest"] {
  --ink: #14201a;
  --ink-soft: #3f5648;
  --ink-faint: #6a7f72;
  --paper: #f5f8f4;
  --paper-muted: #e7eee5;
  --line: rgba(30, 70, 45, 0.1);
  --accent: #2f6b3b;
  --accent-deep: #245530;
  --accent-soft: #bbf7d0;
  --accent-glow: rgba(47, 107, 59, 0.2);
  --hero-a: #163222;
  --hero-b: #214a30;
  --hero-c: #12281b;
  --hero-glow: rgba(47, 107, 59, 0.36);
  --tile-source-a: #2a4f36;
  --tile-source-b: #1c3726;
  --tile-source-hover-a: #356342;
  --tile-source-hover-b: #244530;
  --tile-target-a: #2f6b3b;
  --tile-target-b: #1e4a2a;
  --topbar-a: rgba(33, 74, 48, 0.94);
  --topbar-b: rgba(18, 40, 27, 0.94);
  --grid-line: rgba(255, 255, 255, 0.1);
  --scroll-thumb: rgba(47, 107, 59, 0.35);
  --scroll-thumb-hover: rgba(47, 107, 59, 0.5);
}

html[data-theme="dusk"] {
  --ink: #2a1c14;
  --ink-soft: #6b4e3a;
  --ink-faint: #92725c;
  --paper: #fbf6f0;
  --paper-muted: #f0e6da;
  --line: rgba(90, 50, 25, 0.1);
  --accent: #c45c26;
  --accent-deep: #9a4519;
  --accent-soft: #fed7aa;
  --accent-glow: rgba(196, 92, 38, 0.2);
  --hero-a: #3a2218;
  --hero-b: #5a3424;
  --hero-c: #2c1a12;
  --hero-glow: rgba(196, 92, 38, 0.36);
  --tile-source-a: #5a3a28;
  --tile-source-b: #3d271c;
  --tile-source-hover-a: #6c4632;
  --tile-source-hover-b: #4a3124;
  --tile-target-a: #a04a22;
  --tile-target-b: #6a3118;
  --topbar-a: rgba(90, 52, 36, 0.94);
  --topbar-b: rgba(44, 26, 18, 0.94);
  --grid-line: rgba(255, 255, 255, 0.1);
  --scroll-thumb: rgba(196, 92, 38, 0.35);
  --scroll-thumb-hover: rgba(196, 92, 38, 0.5);
}

html[data-theme="slate"] {
  --ink: #1e2430;
  --ink-soft: #4b5568;
  --ink-faint: #748094;
  --paper: #f5f6f8;
  --paper-muted: #e8eaef;
  --line: rgba(40, 50, 70, 0.1);
  --accent: #4b5e80;
  --accent-deep: #3a4a66;
  --accent-soft: #c7d2fe;
  --accent-glow: rgba(75, 94, 128, 0.2);
  --hero-a: #1a2230;
  --hero-b: #2a3548;
  --hero-c: #151c28;
  --hero-glow: rgba(75, 94, 128, 0.36);
  --tile-source-a: #36445c;
  --tile-source-b: #253044;
  --tile-source-hover-a: #445570;
  --tile-source-hover-b: #314058;
  --tile-target-a: #4b5e80;
  --tile-target-b: #334560;
  --topbar-a: rgba(42, 53, 72, 0.94);
  --topbar-b: rgba(21, 28, 40, 0.94);
  --grid-line: rgba(255, 255, 255, 0.1);
  --scroll-thumb: rgba(75, 94, 128, 0.35);
  --scroll-thumb-hover: rgba(75, 94, 128, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
  border: 2px solid transparent;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

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

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

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

ion-icon {
  display: inline-block;
  vertical-align: middle;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Erişilebilirlik: içeriğe atla bağlantısı --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 0.75rem;
}

/* --- Erişilebilirlik: görünür klavye odağı --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Erişilebilirlik: hareket azaltma tercihi --- */
@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;
  }
}
