/* keremvatandas.com — Phosphor Tarot */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #030503;
  --card: #070b07;
  --term: #050a05;
  --green: #39ff14;
  --green-soft: #b8f5b0;
  --green-dim: #4f8f4f;
  --green-mute: #2f5f2f;
  --cyan: #4fe3d4;
  --white: #ffffff;
  --frame: rgba(57, 255, 20, 0.45);
  --frame-inner: rgba(57, 255, 20, 0.16);
  --glow-card: 0 0 18px rgba(57, 255, 20, 0.08), inset 0 0 26px rgba(57, 255, 20, 0.05);
  --glow-card-hover: 0 0 36px rgba(57, 255, 20, 0.28), 0 22px 40px rgba(0, 0, 0, 0.7), inset 0 0 26px rgba(57, 255, 20, 0.08);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --card-w: 128px;
  --card-h: 192px;
  --card-gap: 22px;
  --icon: 56px;
  --icon-deb-w: 66px;
  --icon-deb-h: 40px;
  --glyph: 36px;
  --prompt-gap: 28px;
  --ease: 280ms ease;
}

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

html { color-scheme: dark; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  color: var(--green-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- atmosfer katmanları ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; }
.fx-grid {
  z-index: 0;
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.fx-vignette {
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}
.fx-scan {
  z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

/* ---------- üst şerit ---------- */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 0 20px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--green-dim);
}
.brand { padding-top: 2px; }
.lang { display: flex; align-items: center; gap: 6px; letter-spacing: 0.08em; }
.lang-btn {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 4px 6px;            /* dokunma hedefi ≥ 24px (WCAG 2.2 target-size) */
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--green-dim);
  cursor: pointer;
  transition: color var(--ease);
}
.lang-btn:hover { color: #9fe39a; }
.lang-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.lang-btn[aria-pressed="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}
.lang-sep { color: var(--green-mute); }

/* ---------- sahne ---------- */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 40px;
  transition: filter var(--ease);
}
/* Popup durumu dialog[open] özniteliğinden türetilir: JS ile kopyalanan sınıf yok, close olayına bağımlılık yok.
   Modal dialog sayfanın kalanını zaten inert yapar; pointer-events gerekmez. */
body:has(dialog[open]) .stage { filter: blur(1.5px) brightness(0.45); }

.deck {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--card-gap);
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--card-w);
  height: var(--card-h);
  padding: 0;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--frame);
  box-shadow: var(--glow-card);
  color: var(--green);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--frame-inner);
  pointer-events: none;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-14px);
  border-color: var(--green);
  box-shadow: var(--glow-card-hover);
}
.card:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.icon {
  width: var(--icon);
  height: var(--icon);
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.75));
}
.icon-debiva { width: var(--icon-deb-w); height: var(--icon-deb-h); }
.glyph {
  font-size: var(--glyph);
  font-weight: 700;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.75));
}
.label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 15px;
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}
.num { position: absolute; font-size: 8px; color: rgba(57, 255, 20, 0.55); }
/* numara ve glif CSS içeriğidir: görünür metin ile erişilebilir ad çelişmez (WCAG 2.5.3) */
.num::before { content: attr(data-n); }
.glyph::before { content: attr(data-glyph); }
.num-tl { top: 9px; left: 10px; }
.num-br { bottom: 9px; right: 10px; transform: rotate(180deg); }

.prompt { margin: var(--prompt-gap) 0 0; font-size: 12.5px; color: #8fc98f; }
.prompt-user { color: var(--green); }
.cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  margin-left: 3px;
  vertical-align: -1px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- about: terminal penceresi ---------- */
.term {
  position: relative;
  width: min(500px, 92vw);
  max-height: 85vh;
  max-height: 85dvh;
  padding: 0;
  margin: auto;
  border: 1px solid rgba(57, 255, 20, 0.55);
  background: var(--term);
  color: var(--green-soft);
  box-shadow: 0 0 40px rgba(57, 255, 20, 0.18), 0 30px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.term[open] { display: flex; flex-direction: column; animation: pop 220ms ease-out; }
.term::backdrop { background: rgba(2, 5, 2, 0.55); }
/* dialog top layer'da olduğu için sayfa scanline'ı onu örtmez; kendi katmanı var */
.term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}
@keyframes pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  background: #0a140a;
  border-bottom: 1px solid rgba(57, 255, 20, 0.3);
  font-size: 10.5px;
  color: #6f9f6f;
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #1f5a1f; }
.dots i:first-child { background: #3a7a3a; }
.term-title { flex: 1; margin-left: 6px; }
.term-close {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 6px;
  min-height: 24px;
  font: inherit;
  color: var(--green-dim);
  cursor: pointer;
}
.term-close:hover,
.term-close:focus-visible { color: var(--green); }
.term-close:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.term-body {
  margin: 0;
  padding: 14px 16px 16px;
  font: inherit;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
}
.term-body .p { color: var(--green); }
.term-body b { color: var(--white); font-weight: 700; }
.term-body .dir { color: var(--cyan); }
.term-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.term-body a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- 404 ---------- */
.err { text-align: center; }
.err h1 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--green); }
.err p { margin: 0 0 14px; font-size: 12.5px; color: var(--green-dim); }
.err a { color: var(--cyan); }

/* ---------- kırılımlar ---------- */
@media (max-width: 899px) {
  :root {
    --card-w: 112px;
    --card-h: 168px;
    --card-gap: 18px;
    --icon: 50px;
    --icon-deb-w: 58px;
    --icon-deb-h: 36px;
    --glyph: 32px;
  }
}
@media (max-width: 640px) {
  :root {
    --card-w: min(40vw, 150px);
    --card-h: calc(var(--card-w) * 1.5);
    --card-gap: 14px;
    --icon: 42px;
    --icon-deb-w: 50px;
    --icon-deb-h: 30px;
    --glyph: 28px;
    --prompt-gap: 20px;
  }
  .deck { display: grid; grid-template-columns: repeat(2, var(--card-w)); }
  .prompt { font-size: 11px; }
  .top { font-size: 10px; }
}
@media (max-height: 520px) {
  .stage { justify-content: flex-start; }
}

/* ---------- hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover,
  .card:focus-visible { transform: none; }
  .cursor { opacity: 1; }
}
