/* CYD//SPOTIFY — ESP32 CYD Spotify ekranı
   Ground: ekran karası (ılık nötr bias) · Accent: CYD sarı PCB · Yeşil yalnızca "çalıyor" durumu */

:root {
  --ground: #141511;
  --surface: #1c1d19;
  --surface-2: #22231f;
  --ink: #e9e7dc;
  --ink-2: #a3a192;
  --rule: #2b2c27;
  --accent: #f2c14e;
  --playing: #1db954;
  --danger: #d98868;
  --radius: 6px;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ince baskı dokusu */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #141511; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark-box {
  display: grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 2.5px;
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 4px;
  padding: 5px 6px;
}
.mark-box span { display: block; background: #141511; border-radius: 1px; }
.mark-box span:nth-child(1) { height: 8px; }
.mark-box span:nth-child(2) { height: 14px; }
.mark-box span:nth-child(3) { height: 6px; }
.mark-box span:nth-child(4) { height: 11px; }
.mark-text { font-family: var(--font-mono); font-weight: 500; font-size: 14px; letter-spacing: 0.08em; }
.mark-text em { font-style: normal; color: var(--accent); }

.nav { display: flex; gap: 22px; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  transition: color 160ms ease, border-color 160ms ease;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ============ HERO ============ */
.hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: 84px 28px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 64px;
  align-items: center;
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 26px;
}

.lede {
  font-size: 1.06rem;
  color: var(--ink-2);
  max-width: 34rem;
  margin: 0 0 30px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--accent); color: #141511; }
.btn-solid:hover { background: #ffd34d; }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin: 0;
}

/* ============ CYD DEVICE MOCK ============ */
.device-wrap { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.device {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  /* sarı PCB üzerindeki siyah ekran */
}

.screen {
  background: #0b0c0a;
  border-radius: 4px;
  width: 352px;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  color: #e9e7dc;
  user-select: none;
}

.scr-top {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #1e1f1a;
  padding-bottom: 7px;
  margin-bottom: 10px;
}
.scr-brand { font-weight: 700; font-size: 12px; letter-spacing: 0.04em; color: #1db954; }

.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 12px; }
.eq i {
  display: block; width: 3px; background: #1db954; border-radius: 1px;
  height: 30%;
  animation: eq 900ms ease-in-out infinite alternate;
  animation-play-state: paused;
}
.device.is-playing .eq i { animation-play-state: running; }
.eq i:nth-child(1) { animation-delay: 0ms; }
.eq i:nth-child(2) { animation-delay: 180ms; }
.eq i:nth-child(3) { animation-delay: 90ms; }
.eq i:nth-child(4) { animation-delay: 260ms; }
.eq i:nth-child(5) { animation-delay: 140ms; }
@keyframes eq { from { height: 18%; } to { height: 100%; } }

.scr-net { margin-left: auto; color: #8b8c80; display: flex; align-items: center; }

.scr-main { display: flex; gap: 12px; flex: 1; min-height: 0; }

.art {
  position: relative;
  width: 128px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  align-self: center;
  background: #161712;
  border: 1px solid #23241e;
  border-radius: 3px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.art-ring {
  position: absolute;
  width: 96px; height: 96px;
  border: 14px solid #1db954;
  border-radius: 50%;
  opacity: 0.9;
}
.art-dot {
  position: absolute;
  width: 26px; height: 26px; border-radius: 50%;
  background: #f2c14e;
}
.art-mono {
  position: absolute;
  bottom: 6px; left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #6f7064;
  letter-spacing: 0.12em;
}

.scr-track { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 2px; }
.t-title { font-weight: 700; font-size: 15px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { font-size: 12.5px; color: #b9b8ab; margin: 0; }
.t-album { font-size: 10.5px; color: #77786c; margin: 0 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-lyric {
  font-size: 11.5px;
  color: #1db954;
  margin: 0;
  border-left: 2px solid #1db954;
  padding-left: 8px;
  min-height: 1.4em;
  transition: opacity 200ms ease;
}
.t-lyric.is-fading { opacity: 0; }

.scr-progress { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
.t-time { font-family: var(--font-mono); font-size: 10px; color: #8b8c80; font-variant-numeric: tabular-nums; }

.bar {
  flex: 1;
  height: 16px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}
.bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: #23241e;
  border-radius: 2px;
}
.bar-fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 34%;
  background: #1db954;
  border-radius: 2px;
  pointer-events: none;
}
.bar:hover::before { background: #2e2f28; }

.scr-ctrl { display: flex; align-items: center; justify-content: center; gap: 26px; }
.cbtn {
  background: transparent;
  border: none;
  color: #e9e7dc;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}
.cbtn:hover { color: #f2c14e; background: #16170f; }
.cbtn:active { transform: scale(0.92); }
.cbtn-play { color: #141511; background: #1db954; border-radius: 50%; width: 40px; height: 40px; }
.cbtn-play:hover { background: #1ed760; color: #141511; }
.cbtn .ic-play { display: none; }
.cbtn:not([aria-pressed="true"]) .ic-play { display: block; }
.cbtn:not([aria-pressed="true"]) .ic-pause { display: none; }

.device-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  text-align: center;
  max-width: 34ch;
}
.device-cap strong { color: var(--accent); font-weight: 500; }

/* ============ SECTIONS ============ */
.section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 96px 28px 0;
}
.section:last-of-type { padding-bottom: 96px; }

h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 40px;
  padding-top: 18px;
  border-top: 2px solid var(--accent);
  display: inline-block;
}

.section-lede { color: var(--ink-2); max-width: 44rem; margin: -18px 0 32px; }

/* ---- özellikler ---- */
.feat-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.feat {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 18px 22px;
  background: var(--surface);
  transition: background 180ms ease;
}
.feat:hover { background: var(--surface-2); }
.feat-no {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 26px;
}
.feat h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.feat p { font-size: 13px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.feat code { font-size: 11px; }

/* ============ KAYNAK KOD ============ */
.files {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.file-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 16px 15px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 160ms ease, background 160ms ease;
}
.file-card:hover { background: var(--surface-2); }
.file-card.is-active { border-color: var(--accent); background: var(--surface-2); }
.fc-name { font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; }
.file-card.is-active .fc-name { color: var(--accent); }
.fc-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fc-tag { font-style: normal; color: #141511; background: var(--accent); border-radius: 3px; padding: 0 5px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 1px; }
.fc-desc { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

.viewer {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #101110;
  overflow: hidden;
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.v-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); }
.v-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2); }
.v-actions { margin-left: auto; display: flex; gap: 8px; }
.v-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 11px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease;
}
.v-btn:hover { border-color: var(--accent); color: var(--accent); }
.v-btn.is-done { border-color: var(--playing); color: var(--playing); }

.code-scroll { max-height: 68vh; overflow: auto; }
.code { margin: 0; padding: 14px 0 18px; font-family: var(--font-mono); font-size: 12px; line-height: 1.72; }
.code .ln {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding: 0 16px 0 0;
}
.code .ln:hover { background: #16170f; }
.code .ln-no {
  color: #4a4b42;
  text-align: right;
  padding-right: 14px;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.tok-com { color: #6d6e61; font-style: italic; }
.tok-str { color: #a8c686; }
.tok-pre { color: #d1a054; }
.tok-kw  { color: #e08e79; }
.tok-num { color: #8fb8d8; }
.tok-type { color: #c5a3e0; }

/* ============ KURULUM ============ */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}
.step-no {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: transparent;
  -webkit-text-stroke: 1.1px var(--accent);
  line-height: 1;
  padding-top: 2px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--ink-2); max-width: 46rem; font-size: 14.5px; }
.step strong { color: var(--ink); font-weight: 600; }
.step-note { margin-top: 10px !important; font-size: 13px !important; color: #797a6e !important; }

.pin-table {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  background: #101110;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0 0;
  overflow-x: auto;
  color: #c9c8bb;
}

.scopes { margin-top: 12px !important; display: flex; flex-wrap: wrap; gap: 6px; }
.scopes code { font-size: 11px; }

/* ============ GÜVENLİK ============ */
.section-warn h2 { border-top-color: var(--danger); }
.warn-box {
  border: 1px solid #3a2c22;
  border-left: 3px solid var(--danger);
  background: #1b1512;
  border-radius: var(--radius);
  padding: 24px 26px;
  max-width: 52rem;
}
.warn-box p { margin: 0 0 6px; color: var(--ink); }
.warn-list { margin: 16px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.warn-list li { margin-bottom: 6px; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--rule);
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 28px 44px;
  color: var(--ink-2);
  font-size: 13px;
}
.footer p { margin: 0 0 6px; }
.footer strong { color: var(--ink); font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.06em; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent); }
.footer-note { font-family: var(--font-mono); font-size: 10.5px; color: #6d6e61; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; gap: 44px; }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .files { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .nav { gap: 12px; }
  .nav a { font-size: 12px; }
  .nav a:nth-child(4) { display: none; }
  .hero, .section, .footer { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 64px; }
  .feat-grid { grid-template-columns: 1fr; }
  .screen { width: 100%; }
  .device { width: 100%; }
  .step { grid-template-columns: 1fr; gap: 8px; }
  .step-no { font-size: 1.4rem; }
  code { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .eq i { animation: none; height: 60%; }
}
