/* ============================================================
   Elevon — shared design tokens & chrome primitives
   Dark substrate · cream type · one hazard red · mono telemetry
   Used by the studio one-pager (styles.css) and the decks (deck/deck.css)
   ============================================================ */

:root {
  /* ---- substrate (dark, default) ---- */
  --bg:        #0b0d11;
  --bg-2:      #10131a;
  --bg-3:      #161a22;
  --fg:        #f3efe6;
  --fg-2:      #b7b2a7;
  --fg-3:      #908b81;
  --line:      rgba(243, 239, 230, 0.14);
  --line-2:    rgba(243, 239, 230, 0.07);
  --line-3:    rgba(243, 239, 230, 0.26);
  --red:       #d4213c;
  --red-deep:  #a9172d;
  --red-soft:  rgba(212, 33, 60, 0.16);
  --glow:      rgba(70, 104, 150, 0.16);
  --scrim:     rgba(4, 5, 8, 0.72);
  --shadow:    0 30px 80px -30px rgba(0, 0, 0, 0.75);

  /* ---- type ---- */
  --display: "Archivo", "Roboto", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sans:    "Roboto", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- rhythm ---- */
  --gutter:    clamp(20px, 3.4vw, 56px);
  --bar-h:     64px;
  --container: 1440px;

  /* ---- motion ---- */
  --ease:     cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* ---- light substrate ("Açık mod") ---- */
:root[data-theme="light"] {
  --bg:        #f3efe6;
  --bg-2:      #faf7f0;
  --bg-3:      #ece7dc;
  --fg:        #0b0d11;
  --fg-2:      #4f4a43;
  --fg-3:      #6e695f;
  --line:      rgba(11, 13, 17, 0.14);
  --line-2:    rgba(11, 13, 17, 0.07);
  --line-3:    rgba(11, 13, 17, 0.28);
  --red:       #cf1d37;
  --red-deep:  #a51529;
  --red-soft:  rgba(207, 29, 55, 0.10);
  --glow:      rgba(207, 29, 55, 0.08);
  --scrim:     rgba(11, 13, 17, 0.45);
  --shadow:    0 30px 80px -30px rgba(11, 13, 17, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: var(--red); color: #f3efe6; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }

/* visually hidden (screen-reader only) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------- skip link ---------------- */
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-200%);
  padding: 10px 14px;
  background: var(--fg); color: var(--bg);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.skip:focus { transform: none; outline: 2px solid var(--red); }

/* ---------------- atmosphere ---------------- */
/* film grain — unified physical texture over both substrates */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.055;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}
:root[data-theme="light"] .grain { mix-blend-mode: multiply; opacity: 0.07; }

/* blueprint column guides + vignette, fixed behind everything */
.gridlines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 88% 92%, var(--glow), transparent 60%),
    radial-gradient(900px 600px at 6% 6%, var(--red-soft), transparent 55%);
  opacity: 0.9;
}
.gridlines::before {
  content: "";
  position: absolute; inset: 0;
  margin: 0 auto;
  max-width: var(--container);
  background-image: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px calc(100% / 12));
  background-position: 0 0;
  border-right: 1px solid var(--line-2);
  opacity: 0.9;
}

/* corner registration marks */
.marks { position: fixed; inset: 0; z-index: 91; pointer-events: none; }
.marks i {
  position: absolute; width: 14px; height: 14px;
}
.marks i::before, .marks i::after {
  content: ""; position: absolute; background: var(--fg-3); opacity: 0.55;
}
.marks i::before { left: 50%; top: 0; width: 1px; height: 100%; }
.marks i::after  { top: 50%; left: 0; height: 1px; width: 100%; }
.marks i:nth-child(1) { top: 14px; left: 14px; }
.marks i:nth-child(2) { top: 14px; right: 14px; }
.marks i:nth-child(3) { bottom: 14px; left: 14px; }
.marks i:nth-child(4) { bottom: 14px; right: 14px; }

/* ---------------- micro-typography ---------------- */
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-2);
  line-height: 1.3;
  white-space: nowrap;
}
.label--dim { color: var(--fg-3); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; }
.sqm { display: inline-block; width: 7px; height: 7px; background: var(--red); flex: none; }

/* red square that punctuates a display headline */
.sq {
  display: inline-block;
  width: 0.42em; height: 0.42em;
  background: var(--red);
  margin-left: 0.14em;
  vertical-align: 0.02em;
}

/* ---------------- macro-typography ---------------- */
.display {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.012em;
  line-height: 0.9;
  color: var(--fg);
  text-wrap: balance;
}
.display--tight { letter-spacing: -0.02em; }

/* ---------------- controls ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-3); border-radius: 999px;
  background: transparent;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg); cursor: pointer; white-space: nowrap;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), transform 0.2s var(--ease);
}
.pill:hover { border-color: var(--fg); background: var(--bg-2); }
.pill:active { transform: translateY(1px); }
.pill:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.pill svg { width: 13px; height: 13px; flex: none; }
.pill--fill { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill--fill:hover { background: var(--red); border-color: var(--red); color: #f3efe6; }
.pill--red { background: var(--red); color: #f3efe6; border-color: var(--red); }
.pill--red:hover { background: var(--red-deep); border-color: var(--red-deep); color: #f3efe6; }
.pill--lg { height: 46px; padding: 0 22px; font-size: 12px; }
.pill--static { cursor: default; }
.pill--static:hover { border-color: var(--line-3); background: transparent; }

/* segmented pill (TR | EN) */
.seg { display: inline-flex; border: 1px solid var(--line-3); border-radius: 999px; height: 34px; overflow: hidden; }
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 0 13px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-3); transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.seg button + button { border-left: 1px solid var(--line-3); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { color: var(--bg); background: var(--fg); }
.seg button:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

/* round icon button */
.rbtn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-3); border-radius: 50%;
  background: transparent; color: var(--fg); cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), transform 0.25s var(--ease), opacity 0.3s var(--ease);
}
.rbtn svg { width: 18px; height: 18px; }
.rbtn:hover { border-color: var(--fg); background: var(--bg-2); }
.rbtn:active { transform: scale(0.96); }
.rbtn:disabled { opacity: 0.3; cursor: default; }
.rbtn:disabled:hover { border-color: var(--line-3); background: transparent; }
.rbtn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.rbtn--fill { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.rbtn--fill:hover { background: var(--red); border-color: var(--red); color: #f3efe6; }

/* ---------------- chrome bars ---------------- */
.bar {
  position: fixed; left: 0; right: 0; z-index: 60;
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 var(--gutter);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-2);
}
.bar--top { top: 0; }
.bar--bottom { bottom: 0; }
.bar__l { grid-column: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar__c { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.bar__r { grid-column: 3; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.bar .trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 4-column meta row (label over value) */
.meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.meta dt, .meta dd, .meta div { margin: 0; min-width: 0; }
.meta__k { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.meta__v { display: block; font-size: 15px; color: var(--fg); line-height: 1.4; }

/* hairline helpers */
.hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------------- reveal ---------------- */
[data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .marks i { display: none; }
  :root { --bar-h: 56px; }
}

/* print: always on paper-white with ink, regardless of the on-screen theme */
@media print {
  :root, :root[data-theme="light"] { --bg: #ffffff; --bg-2: #f6f4ee; --bg-3: #ece9e1; --fg: #0b0d11; --fg-2: #3d3933; --fg-3: #6e695f; --line: rgba(11, 13, 17, 0.18); --line-2: rgba(11, 13, 17, 0.09); --line-3: rgba(11, 13, 17, 0.3); --glow: transparent; --red-soft: transparent; }
  .grain, .marks, .gridlines, .bar, .skip { display: none !important; }
  body { background: #fff; color: #0b0d11; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
