:root {
  --bg:        #0B0E11;
  --panel:     #12161B;
  --panel-2:   #181D24;
  --line:      #232A33;
  --line-dim:  #1A2026;
  --trace:     #3BD16F;
  --trace-dim: #1F6B3C;
  --amber:     #E8A33D;
  --amber-dim: #6B4D1D;
  --paper:     #F0EDE4;
  --paper-dim: #9BA3AD;
  --red:       #E8543D;

  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}



/* ============ REVEAL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* ============ TYPING EFFECT ============ */
.code-typing-container {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.code-typing-container.active {
  opacity: 1;
  transform: translateY(0);
}
.type-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--trace);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Faint PCB trace grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dim) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }

::selection { background: var(--trace-dim); color: var(--paper); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ============ TYPE SYSTEM ============ */
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--trace);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--trace);
  box-shadow: 0 0 8px var(--trace);
  border-radius: 1px;
  flex-shrink: 0;
}

h1, h2, h3 { font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; }

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--paper);
}
.section-sub {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--paper-dim);
  max-width: 560px;
  margin-bottom: 56px;
}

section { padding: 110px 0; position: relative; }

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}
.rule.trace {
  border-top: 1px dashed var(--trace-dim);
}

/* ============ NAV ============ */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,14,17,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo .dot { color: var(--trace); }
.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper-dim);
}
.nav-links a { text-decoration: none; transition: color 0.15s; }
.nav-links a:hover { color: var(--trace); }
.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--trace-dim);
  color: var(--trace);
  padding: 7px 14px;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-cta:hover { background: var(--trace); color: var(--bg); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ============ HERO ============ */
.hero {
  padding: 90px 0 70px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
}

.hero-title {
  font-size: clamp(30px, 4.8vw, 56px);
  line-height: 1.08;
  color: var(--paper);
}
.hero-title .accent { color: var(--trace); }
.hero-desc {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--paper-dim);
  margin: 22px 0 32px;
  max-width: 480px;
}
.hero-features {
  list-style: none;
  margin: 0 0 32px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-features li {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-features .check {
  color: var(--trace);
  font-weight: bold;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--trace);
  color: #06120A;
}
.btn-primary:hover { 
  background: #4FE585; 
  transform: translateY(-2px); 
  box-shadow: 0 6px 20px rgba(59, 209, 111, 0.4); 
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--paper);
}
.btn-ghost:hover { 
  border-color: var(--paper-dim); 
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 44px;
  font-family: var(--mono);
}
.stat-num { font-size: 22px; color: var(--amber); font-weight: 700; }
.stat-label { font-size: 11px; color: var(--paper-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.hero-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.15); }
.hero-frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(11,14,17,0.5));
  pointer-events: none;
}
.hero-frame-tag {
  position: absolute;
  bottom: 12px; left: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
  background: rgba(11,14,17,0.7);
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid var(--line);
  z-index: 2;
}

/* ============ SPEC STRIP ============ */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 70px 0;
}
.spec-cell {
  padding: 20px 22px;
  background: var(--panel);
  transition: background 0.2s ease;
}
.spec-cell:hover {
  background: #1C222A;
}
.spec-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--trace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.spec-val {
  font-family: var(--mono);
  font-size: clamp(12px, 1.3vw, 15px);
  color: var(--paper);
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .spec-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ============ STORY & CHALLENGES ============ */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.challenge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.challenge-card:hover {
  transform: translateY(-4px);
  border-color: var(--trace);
}
.challenge-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--paper);
  margin-bottom: 12px;
}
.challenge-desc {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--paper-dim);
  line-height: 1.6;
}

/* ============ SCHEMATIC (signature element) ============ */
.schematic-section { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Bridge kaldirildi (Sinir cizgisi tasmis gibi gorunuyordu) */

.schematic-board {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 40px;
  margin-top: 20px;
}
.schematic-svg-wrap { position: relative; width: 100%; }
.schem-node {
  cursor: pointer;
}
.schem-node circle {
  fill: var(--panel-2);
  stroke: var(--trace-dim);
  stroke-width: 1.5;
  transition: all 0.2s;
}
.schem-node:hover circle, .schem-node.active circle {
  fill: var(--trace);
  stroke: var(--trace);
}
.schem-node text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--paper-dim);
  pointer-events: none;
}
.schem-node:hover text, .schem-node.active text { fill: var(--paper); }
.schem-line {
  stroke: var(--line);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.2s;
}
.schem-line.active { stroke: var(--trace); }

@media (max-width: 600px) {
  .schem-node text { font-size: 13px; }
  .schematic-board { padding: 22px 14px; }
}

.pin-readout {
  margin-top: 28px;
  border-top: 1px dashed var(--line);
  padding-top: 22px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
  min-height: 70px;
}
.pin-readout-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--trace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pin-readout-val {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--paper);
}
.pin-readout-val .pin-detail { color: var(--paper-dim); font-size: 12.5px; display: block; margin-top: 4px; }

.schem-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-dim);
  margin-top: 14px;
  text-align: center;
}

/* ============ ARCHITECTURE DIAGRAM ============ */
.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.arch-cell {
  background: var(--panel);
  padding: 28px 26px;
  transition: background 0.2s ease;
}
.arch-cell:hover {
  background: #1C222A;
}
.arch-core-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.arch-task {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--paper);
  padding: 9px 0;
  border-bottom: 1px solid var(--line-dim);
  display: flex;
  justify-content: space-between;
}
.arch-task:last-child { border-bottom: none; }
.arch-task .pri { color: var(--paper-dim); font-size: 12px; }
@media (max-width: 720px) {
  .arch-grid { grid-template-columns: 1fr; }
}

/* ============ GAMES ============ */
.game-list { display: flex; flex-direction: column; }
.game-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 32px;
  padding: 32px 24px;
  margin: 0 -24px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  transition: all 0.25s ease;
  border-radius: 12px;
}
.game-row:hover {
  background: var(--panel);
  transform: scale(1.01) translateX(4px);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 2;
  position: relative;
}
.game-row:first-child { border-top: 1px solid var(--line); }
.game-row:first-child:hover { border-top-color: transparent; }
@media (max-width: 780px) {
  .game-row { grid-template-columns: 1fr; gap: 14px; }
}
.game-idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--trace-dim);
}
.game-name {
  font-family: var(--mono);
  font-size: 19px;
  color: var(--paper);
  margin-bottom: 6px;
}
.game-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
  margin-right: 6px;
  margin-top: 8px;
}
.tag-new { background: var(--amber-dim); color: var(--amber); }
.tag-core { background: var(--line); color: var(--paper-dim); }
.game-desc {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--paper-dim);
}
.game-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-dim);
  text-align: right;
}
.game-meta .meta-line { margin-bottom: 4px; }
.game-meta .meta-val { color: var(--trace); }
@media (max-width: 780px) {
  .game-meta { text-align: left; }
}

/* ============ GAME GALLERY & LIGHTBOX ============ */
.game-content {
  /* display: flex; flex-direction: column; kaldirildi (tag'lerin uzamasini engellemek icin) */
  min-width: 0; /* Grid icinde tasma yapmamasi icin cok kritik! */
}
.gallery-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.game-gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
  flex-grow: 1;
}
.game-gallery::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.gallery-nav {
  width: 36px;
  height: 36px;
  background: rgba(11, 14, 17, 0.8);
  border: 1px solid var(--line);
  color: var(--paper-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s;
  flex-shrink: 0;
}
.gallery-nav.left {
  margin-left: -48px; /* 36px width + 12px gap = 48px, aligns gallery exactly with text */
}
.gallery-nav:hover {
  background: var(--trace);
  color: #000;
  border-color: var(--trace);
  transform: scale(1.1);
}

.game-shot-wrap {
  position: relative;
  width: 200px;
  height: 160px;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: zoom-in;
}
.game-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  image-rendering: pixelated;
  border-radius: 4px;
  display: block;
}
.game-shot-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  pointer-events: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.game-shot-wrap:hover::after {
  border-color: var(--trace);
}

/* Placeholder for new games without screenshots yet */
.gallery-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--paper-dim);
}

/* Lightbox */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--paper-dim);
  font-size: 48px;
  cursor: pointer;
  padding: 20px 30px;
  user-select: none;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.lb-nav:hover {
  color: var(--trace);
  transform: translateY(-50%) scale(1.15);
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(11,14,17,0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  width: 90vw;
  max-width: 800px;
  height: auto;
  border: 2px solid var(--trace);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  image-rendering: pixelated; 
}
.lightbox.active img {
  transform: scale(1);
}
@media (min-width: 768px) {
  .lightbox img {
    width: auto;
    height: 70vh;
  }
}
.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 32px;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.lightbox-close:hover { color: var(--trace); }

/* ============ BUILD / OS ============ */
  .feature-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }
  .feature-cell {
    grid-column: span 2;
    background: var(--panel);
    padding: 30px 26px;
    transition: background 0.2s ease;
  }
  .feature-cell:hover {
  background: #1C222A;
}
.feature-icon {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--trace);
  margin-bottom: 14px;
}
.feature-title {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--paper);
  margin-bottom: 10px;
}
.feature-desc {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--paper-dim);
}
@media (max-width: 780px) {
  .feature-grid { display: flex; flex-direction: column; }
}

/* ============ CODE BLOCK DECOR ============ */
.code-window {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.code-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.code-dot { width: 9px; height: 9px; border-radius: 50%; }
.code-titlebar span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-dim);
  margin-left: 8px;
}
.code-window pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 20px 22px;
  overflow-x: auto;
  color: var(--paper-dim);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.code-window pre::-webkit-scrollbar {
  display: none;
}
.code-window .kw { color: #C792EA; }
.code-window .fn { color: var(--trace); }
.code-window .cm { color: #5C6370; }
.code-window .nm { color: var(--amber); }
.code-window .str { color: #98C379; }

/* ============ ROADMAP ============ */
.roadmap-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 22px 24px;
  margin: 0 -24px;
  border-bottom: 1px solid var(--line-dim);
  transition: all 0.25s ease;
  border-radius: 12px;
}
.roadmap-row:hover {
  background: var(--panel);
  transform: scale(1.01) translateX(4px);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 2;
  position: relative;
}
.roadmap-row:last-child { border-bottom: none; }
.roadmap-row:last-child:hover { border-bottom-color: transparent; }
.roadmap-tag {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 0;
}
.roadmap-tag.done { color: var(--trace); }
.roadmap-tag.planned { color: var(--amber); }
.roadmap-text { font-family: var(--sans); font-size: 14.5px; color: var(--paper-dim); }
.roadmap-text strong { color: var(--paper); font-weight: 600; }

/* ============ FOOTER ============ */
footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--line);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 22px; font-family: var(--mono); font-size: 12.5px; color: var(--paper-dim); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--trace); }
.footer-sig { font-family: var(--mono); font-size: 12px; color: var(--paper-dim); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, .schem-node:focus-visible circle {
  outline: 2px solid var(--trace);
  outline-offset: 2px;
}



/* ============ CANVAS E-OS SIMULATOR ============ */
.eos-hardware {
  background: #111;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,0.9), inset 0 2px 10px rgba(255,255,255,0.05);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}
#eosCanvas {
  width: 400px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 160 / 128;
  background: #000;
  border: 2px solid #000;
  border-radius: 4px;
  box-shadow: 0 0 0 4px #222, inset 0 0 20px rgba(0,0,0,1);
  image-rendering: pixelated;
}
.eos-logo {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 4px;
  color: #444;
  font-weight: bold;
}

  /* MOBILE LAYOUT FIXES */

@media (max-width: 600px) {
  .spec-strip { grid-template-columns: 1fr !important; gap: 16px; }
  .wrap { padding: 0 20px !important; }
  .schematic-board { 
    overflow-x: auto; 
    margin: 0 -20px; 
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .schematic-svg { min-width: 700px; }
  .code-window { max-width: 100vw; box-sizing: border-box; }
}