/* ==========================================================================
   KUTAY OS — Base
   Reset, base element styles, and the a11y primitives every page relies on.
   No component/page-specific rules belong in this file.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: #4c515b transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 400 var(--fs-root)/1.5 var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

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

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
button:disabled { opacity: .4; cursor: default; }
button, a, input, textarea, select { touch-action: manipulation; }

svg { width: 20px; height: 20px; flex-shrink: 0; }

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

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

/* A single, consistent focus ring everywhere instead of browser defaults
   fighting the theme. :focus-visible so mouse clicks stay quiet. */
:focus { outline: none; }
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

/* ---- Accessibility helpers ---- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: var(--space-3);
  top: -60px;
  z-index: var(--z-toast);
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 14px/1 var(--font-sans);
  text-decoration: none;
  transition: top var(--dur-base) ease;
}
.skip-link:focus {
  top: var(--space-3);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Respect the OS-level "reduce motion" preference globally. Individual
   components may also check prefers-reduced-motion via JS to skip
   non-CSS animation work (canvas loops, etc). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Manual "reduce motion" toggle from the System app, independent of the OS
   setting. */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }

/* admin panel publishing: update note + analytics consent */
.os-update { position: fixed; z-index: 99990; left: 50%; top: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: rgba(16, 18, 22, .92); color: #f4efe6; font: 600 13px/1.2 var(--font-sans, system-ui); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 210, 122, .35); translate: -50% -14px; opacity: 0; transition: opacity .4s, translate .5s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none; }
.os-update.in { opacity: 1; translate: -50% 0; }
.os-update i { width: 10px; height: 10px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 0 0 rgba(255, 210, 122, .7); animation: osPing 1.4s ease-out infinite; }
@keyframes osPing { to { box-shadow: 0 0 0 12px rgba(255, 210, 122, 0); } }
.os-consent { position: fixed; z-index: 99991; left: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; background: rgba(16, 18, 22, .95); color: #f4efe6; font: 13px/1.45 var(--font-sans, system-ui); box-shadow: 0 18px 44px rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .12); }
.os-consent p { margin: 0 0 10px; }
.os-consent div { display: flex; gap: 8px; justify-content: flex-end; }
.os-consent button { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: inherit; font: 600 12.5px/1 inherit; cursor: pointer; }
.os-consent button[data-c="yes"] { background: #f4efe6; color: #15171b; border-color: #f4efe6; }
@media (prefers-reduced-motion: reduce) { .os-update { transition: none; } .os-update i { animation: none; } }

/* maintenance screen (admin panel › Bakım modu) */
html.os-maint-on body > *:not(.os-maint){visibility:hidden!important}
html.os-maint-on{overflow:hidden}
.os-maint{position:fixed;inset:0;z-index:2147483000;display:grid;place-items:center;padding:24px;background:radial-gradient(900px 600px at 50% 10%,#1d1a12,transparent),#0b0c10;color:#eef0f3;font:16px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;visibility:visible!important}
.os-maint-card{max-width:460px;text-align:center;display:grid;gap:12px;justify-items:center}
.os-maint-k{display:grid;place-items:center;width:56px;height:56px;border-radius:15px;background:linear-gradient(135deg,#ffd27a,#ff8a3c);color:#1a1408;font-weight:800;font-size:24px;margin-bottom:6px}
.os-maint h1{margin:0;font-size:clamp(26px,5vw,38px);letter-spacing:-.02em}
.os-maint p{margin:0;color:#a9b0bb}
.os-maint-until{font-size:14px;color:#ffd27a!important}
.os-maint a{color:#ffd27a;text-decoration:none;border-bottom:1px solid #ffd27a55;margin-top:6px}
.os-maint-frame{border:0;width:100vw;height:100vh;height:100dvh;padding:0;display:block;background:#07090d}
