/* ============================================================
   pingtheguy.com — green-phosphor CRT terminal
   ============================================================ */

/* ---------- Fonts (bundled locally, zero external requests) ---------- */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("../fonts/vt323-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #050805;
  --bg-2: #071007;
  --green: #35f07a;
  --green-soft: #8bf7b0;
  --green-dim: rgba(53, 240, 122, 0.62);
  --green-faint: rgba(53, 240, 122, 0.30);
  --green-ghost: rgba(53, 240, 122, 0.10);
  --amber: #f0c435;
  --red: #ff5f56;
  --glow: 0 0 4px rgba(53, 240, 122, 0.55), 0 0 11px rgba(53, 240, 122, 0.28);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --accent: "VT323", "JetBrains Mono", monospace;
  --maxw: 74ch;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--green); text-decoration: none; }
a:hover, a:focus-visible { color: var(--green-soft); }
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============================================================
   CRT SCREEN SHELL
   ============================================================ */
.crt {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 5vw, 48px) 96px;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg) 60%, #020402 100%);
}
.wrap { max-width: 900px; margin: 0 auto; }

/* Scanlines */
.crt__scan {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 60;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.16) 3px,
    rgba(0,0,0,0.16) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0;
}
/* Vignette + moving glow bar */
.crt__vignette {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 55;
  background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
}
.crt__flicker {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 58;
  background: rgba(53, 240, 122, 0.03);
  opacity: 0;
}

/* ---------- Mode: FULL (home) ---------- */
body.mode-full .crt__scan { opacity: 1; }
body.mode-full .crt__vignette { opacity: 1; }
body.mode-full .crt__flicker { opacity: 1; animation: flicker 4.5s steps(30) infinite; }
body.mode-full .crt { animation: powerOn 900ms ease-out both; }
body.mode-full .glow, body.mode-full .term { text-shadow: var(--glow); }

/* ---------- Mode: CALM (sub-pages) ---------- */
body.mode-calm .crt__scan { opacity: 0.35; }
body.mode-calm .crt__vignette { opacity: 0.55; }
body.mode-calm { line-height: 1.7; }

/* ---------- Mode: OFF (privacy) ---------- */
body.mode-off .crt__scan,
body.mode-off .crt__vignette,
body.mode-off .crt__flicker { opacity: 0 !important; animation: none !important; }
body.mode-off { line-height: 1.9; }

@keyframes flicker {
  0%, 96%, 100% { opacity: 0; }
  97% { opacity: 0.5; }
  98% { opacity: 0.1; }
  99% { opacity: 0.7; }
}
@keyframes powerOn {
  0%   { transform: scaleY(0.004) scaleX(1); filter: brightness(3) blur(1px); opacity: 0.9; }
  22%  { transform: scaleY(0.02) scaleX(1); filter: brightness(2.4); }
  45%  { transform: scaleY(1) scaleX(1.02); filter: brightness(1.8); }
  70%  { transform: scaleY(1) scaleX(1); filter: brightness(1.15); }
  100% { transform: none; filter: none; opacity: 1; }
}

/* ============================================================
   TERMINAL TEXT
   ============================================================ */
.term { font-family: var(--mono); }
.prompt-sym { color: var(--green-soft); }
.arrow { color: var(--green-dim); }
.dim { color: var(--green-dim); }
.muted { color: var(--green-faint); }
.err { color: var(--red); }

/* easter egg */
.bunny {
  font-family: inherit;
  font-size: 1.05em;
  line-height: 1.25;
  margin: 6px 0 0;
  white-space: pre;
}
.warn { color: var(--amber); }

/* Cursor */
.cursor {
  display: inline-block;
  width: 0.62ch; height: 1.05em;
  vertical-align: -0.16em;
  background: var(--green);
  margin-left: 2px;
  box-shadow: var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* ---------- Home: terminal session ---------- */
.session { font-size: clamp(14px, 2.4vw, 18px); }
.session .line { white-space: pre-wrap; word-break: break-word; margin: 0; }
.session .block { margin-bottom: 1.35em; }
.line--cmd { color: var(--green-soft); }
.line--out { color: var(--green); }
.whoami .line--out { color: var(--green); }

/* nav command list */
.nav-cmds { margin: 0.4em 0 0; padding: 0; list-style: none; }
.nav-cmds li { margin: 0; }
.cmd-link {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.4ch 1.2ch;
  padding: 0.35em 0.6em;
  margin: 0.15em -0.6em;
  border-radius: 4px;
  transition: background 120ms ease, transform 120ms ease;
}
.cmd-link:hover, .cmd-link:focus-visible {
  background: var(--green-ghost);
  color: var(--green-soft);
  transform: translateX(3px);
}
.cmd-link .c { color: var(--green-soft); font-weight: 700; }
.cmd-link .desc { color: var(--green-dim); }

/* Live prompt */
.liveprompt {
  display: flex; align-items: center; gap: 0.6ch;
  margin-top: 1.6em;
  padding-top: 1.1em;
  border-top: 1px dashed var(--green-faint);
  font-size: clamp(14px, 2.4vw, 18px);
}
.liveprompt label { color: var(--green-soft); white-space: nowrap; }
.liveprompt input {
  flex: 1 1 auto;
  min-width: 4ch;
  background: transparent;
  border: none;
  color: var(--green);
  font-family: var(--mono);
  font-size: inherit;
  padding: 0;
  caret-color: var(--green);
}
.liveprompt input:focus { outline: none; }
.echo { margin: 0.1em 0 0; }
.echo .line { white-space: pre-wrap; }

/* ============================================================
   SUB-PAGE CHROME
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 14px;
  color: var(--green-dim);
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--green-faint);
}
.topbar .path { color: var(--green-soft); }
.topbar nav { display: flex; gap: 4px 6px; flex-wrap: wrap; }
.topbar nav a {
  padding: 4px 9px; border-radius: 4px;
  border: 1px solid var(--green-faint);
  color: var(--green-dim);
  font-size: 13px;
}
.topbar nav a:hover, .topbar nav a:focus-visible {
  background: var(--green-ghost); color: var(--green-soft);
  border-color: var(--green-dim);
}
.topbar nav a[aria-current="page"] { color: var(--green); border-color: var(--green-dim); }

.page-head { margin: 34px 0 8px; }
.page-head .kicker { color: var(--green-dim); font-size: 14px; margin: 0 0 6px; }
.page-title {
  font-family: var(--accent);
  font-size: clamp(46px, 12vw, 104px);
  line-height: 0.92;
  margin: 0;
  color: var(--green);
  letter-spacing: 0.5px;
}
body.mode-full .page-title, body.mode-calm .page-title { text-shadow: var(--glow); }
.lede {
  max-width: var(--maxw);
  font-size: clamp(16px, 2.6vw, 20px);
  color: var(--green);
  margin: 18px 0 0;
}
.lede .dim { color: var(--green-dim); }

/* generic prose */
.prose { max-width: var(--maxw); }
.prose p { margin: 0 0 1.15em; }
.section { margin: 64px 0; }
.section > .prose { margin-left: 0; }

.sec-label {
  font-family: var(--accent);
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1;
  margin: 0 0 4px;
  color: var(--green);
}
.sec-hint { color: var(--green-dim); font-size: 13px; margin: 0 0 22px; }

/* Placeholder marker (clearly-marked, on theme) */
.ph {
  display: block;
  border-left: 3px solid var(--amber);
  background: rgba(240, 196, 53, 0.06);
  color: var(--amber);
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 5px 5px 0;
  font-size: 14px;
  line-height: 1.55;
}
.ph b { color: var(--amber); font-weight: 700; }
.ph.block { min-height: 60px; }

/* ============================================================
   iPhone frames (Motoyra)
   ============================================================ */
.shots {
  display: flex; flex-wrap: wrap; gap: clamp(20px, 5vw, 54px);
  align-items: flex-start;
}
.shot { flex: 0 0 auto; }
.shot__cap {
  font-family: var(--accent);
  font-size: 26px; line-height: 1; color: var(--green);
  margin: 18px 0 2px;
}
.shot__note { color: var(--green-dim); font-size: 13px; margin: 0; max-width: 30ch; }

.iphone {
  position: relative;
  width: min(288px, 72vw);
  aspect-ratio: 1284 / 2778;
  background: linear-gradient(155deg, #14181a, #05070a 60%);
  border-radius: 13% / 6%;
  padding: 2.6%;
  box-shadow:
    inset 0 0 0 2px rgba(53,240,122,0.10),
    0 0 0 1px #000,
    0 20px 60px rgba(0,0,0,0.7),
    0 0 40px rgba(53,240,122,0.10);
}
.iphone__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 10% / 4.6%;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1.5px #000;
}
.iphone__screen img { width: 100%; height: 100%; object-fit: cover; }
.iphone__island {
  position: absolute; top: 2.6%; left: 50%; transform: translateX(-50%);
  width: 32%; height: 3.1%;
  min-height: 16px;
  background: #000; border-radius: 999px; z-index: 3;
}
/* single-phone hero, larger */
.iphone--hero { width: min(320px, 80vw); }

/* Layout: alternating story rows */
.story-row {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  margin: 72px 0;
}
.story-row.rev { grid-template-columns: minmax(240px, 340px) 1fr; }
.story-row.rev .story-copy { order: 2; }
.story-row.rev .story-phone { order: 1; }
.story-phone { display: flex; justify-content: center; }

/* ============================================================
   Buttons / badges
   ============================================================ */
.btnrow { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--green-dim);
  border-radius: 6px;
  color: var(--green);
  background: var(--green-ghost);
  font-size: 15px; font-weight: 700;
  transition: background 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}
.btn:hover, .btn:focus-visible {
  background: rgba(53,240,122,0.16);
  color: var(--green-soft);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
.btn .sub { font-weight: 400; color: var(--green-dim); font-size: 12px; }
.btn--ghost { opacity: 0.85; }
.btn[aria-disabled="true"] {
  cursor: default; opacity: 0.7;
  border-style: dashed;
}
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; background: var(--green-ghost); }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px;
  border: 1px solid var(--amber); color: var(--amber);
  border-radius: 999px; margin-left: 8px;
}

/* ============================================================
   Code / terminal window (WhuffoBot)
   ============================================================ */
.win {
  border: 1px solid var(--green-faint);
  border-radius: 8px;
  background: rgba(2,8,4,0.75);
  overflow: hidden;
  margin: 26px 0;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
}
.win__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--green-faint);
  background: rgba(53,240,122,0.05);
}
.win__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green-faint); }
.win__title { margin-left: 8px; color: var(--green-dim); font-size: 12.5px; }
.win__body { padding: 18px clamp(14px,3vw,22px); font-size: 14px; overflow-x: auto; }
.win__body pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.win__body .c-cmd { color: var(--green-soft); }
.win__body .c-com { color: var(--green-dim); }
.win__body .c-key { color: var(--amber); }
.win__body .c-str { color: var(--green-soft); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  margin-top: 84px;
  padding-top: 22px;
  border-top: 1px solid var(--green-faint);
  color: var(--green-dim);
  font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
}
.footer a { color: var(--green-dim); }
.footer a:hover { color: var(--green-soft); }
.privacy-link { color: var(--green-faint); font-size: 12px; }

.closer {
  font-family: var(--accent);
  font-size: clamp(30px, 7vw, 60px);
  line-height: 1.05;
  color: var(--green);
  margin: 40px 0 8px;
  max-width: 20ch;
}
body.mode-calm .closer { text-shadow: var(--glow); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .story-row, .story-row.rev { grid-template-columns: 1fr; gap: 26px; }
  .story-row.rev .story-copy { order: 1; }
  .story-row.rev .story-phone { order: 2; }
  .crt { padding-bottom: 72px; }
}

/* ============================================================
   Reduced motion — kill flicker, scanlines animation, power-on
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body.mode-full .crt { animation: none; }
  body.mode-full .crt__flicker { animation: none; opacity: 0; }
  body.mode-full .crt__scan { opacity: 0.4; }
  .cursor { animation: none; opacity: 1; }
  * { scroll-behavior: auto !important; }
}

/* Fade used by JS transitions */
.swap-out { opacity: 0; transition: opacity 160ms ease; }
.swap-in { animation: swapIn 260ms ease both; }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .swap-in { animation: none; }
  .swap-out { transition: none; }
}

/* Ekran okuyucular ve arama motorlari icin gorunmez baslik */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
