/* ---------- Theme ---------- */

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-muted: #f6f7f9;
  --surface: #ffffff;
  --text: #18181b;
  --text-mid: #52525b;
  --text-soft: #8a8a93;
  --border: #e3e4e8;
  --ink: #16161a;
  --ink-hover: #313138;
  --accent: #3b5fd1;
  --accent-soft: #eef1fb;
  --led-ok: #2a9d6f;
  --shadow-card: 0 1px 2px rgba(20, 20, 25, 0.04);
  --shadow-window: 0 1px 3px rgba(20, 20, 25, 0.05), 0 16px 40px rgba(20, 20, 25, 0.07);
}

:root[data-theme="dark"] {
  --bg: #0c0d10;
  --bg-muted: #14151a;
  --surface: #161519;
  --text: #f1f1f3;
  --text-mid: #a6a6b0;
  --text-soft: #6c6c76;
  --border: #26262c;
  --ink: #f1f1f3;
  --ink-hover: #d6d6da;
  --accent: #7c97f2;
  --accent-soft: #181d30;
  --led-ok: #4cc394;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-window: 0 1px 3px rgba(0, 0, 0, 0.4), 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-mid);
  -webkit-font-smoothing: antialiased;
}

body { padding-top: 80px; }

a { color: inherit; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

img { max-width: 100%; display: block; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 80px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  flex-shrink: 0;
}

/* FIX 7: logo-img için boyut tanımlandı — önceden yoktu */
.logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.logo-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--ink);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: var(--accent);
}

/* FIX 8: nav-right için flex layout eklendi — önceden tanımsızdı */
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: flex-end;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.primary-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.15s;
}
.primary-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 24px 7px 11px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.lang-select:hover { border-color: var(--text-soft); }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.lang-arrow {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-soft);
  pointer-events: none;
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--text-soft); color: var(--text); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }

.nav-toggle {
  display: none;
  width: 32px; height: 32px;
  flex-direction: column; justify-content: center; gap: 4px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 11px 0;
  font-size: 14.5px; font-weight: 500;
  color: var(--text-mid); text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--ink-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text-soft); }

.btn-small { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero ---------- */

.hero { padding: 84px 24px 56px; }

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero-copy h1 {
  font-size: 41px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 18px;
}

.hero-desc {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-mid);
  max-width: 440px;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}
.hero-meta .mono { color: var(--text-mid); }
.dot-sep { opacity: 0.6; }

.window-frame {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-window);
}

.window-frame img { width: 100%; }

/* ---------- Sections ---------- */

.section { padding: 88px 24px; }
.section-muted { background: var(--bg-muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: 1120px; margin: 0 auto; }

.section-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 12px;
  max-width: 560px;
}

.section-desc {
  font-size: 15.5px;
  color: var(--text-mid);
  max-width: 480px;
  line-height: 1.6;
  margin: 0 0 48px;
}

/* ---------- Features ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.feat-card {
  background: var(--surface);
  padding: 28px 26px;
  transition: background-color 0.2s;
}
.feat-card:hover { background: var(--bg-muted); }

.feat-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.feat-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mid);
  margin: 0;
}

/* ---------- Changelog ---------- */

.log-list { display: flex; flex-direction: column; }

.log-entry {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.log-entry:first-child { border-top: 1px solid var(--border); }

.log-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  padding: 0;
}

.log-version {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.log-date { color: var(--text-soft); font-size: 12.5px; }

/* FIX 4+9: summary artık log-changes içinde, head'in hemen altında değil.
   log-summary stil tanımı body içinde render edilebilmesi için korundu. */
.log-summary {
  font-size: 14px;
  color: var(--text-mid);
  margin: 0 0 10px;
}

.log-toggle {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 12px;
  transform: rotate(0deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.log-entry.open .log-toggle { transform: rotate(180deg); }

/* FIX 9: display: block garantisi eklendi — max-height animasyonu için zorunlu */
.log-changes {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.log-changes ul {
  margin: 0 0 4px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-changes li {
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.55;
}

.log-loading { font-size: 14px; color: var(--text-soft); }

/* ---------- Download ---------- */

.download-section { text-align: center; }
.download-inner { display: flex; flex-direction: column; align-items: center; }
.download-inner .section-title,
.download-inner .section-desc { max-width: 460px; }

.download-meta {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-soft);
}
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy h1 { font-size: 34px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .primary-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-small { display: none; }
  .hero { padding: 64px 20px 44px; }
  .hero-copy h1 { font-size: 29px; }
  .hero-desc { max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .section { padding: 64px 20px; }
  .section-title { font-size: 24px; max-width: none; }
  .section-desc { max-width: none; margin-bottom: 36px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}