:root {
  --bg: #020805;
  --panel: #06140c;
  --panel-2: #0a1f14;
  --green: #00ff6a;
  --green-dim: #00b34a;
  --green-fade: rgba(0, 255, 106, 0.14);
  --amber: #ffb347;
  --amber-dim: #c4842a;
  --text: #c8ffd8;
  --muted: #6aa87c;
  --danger: #ff5a5a;
  --bezel: #12331f;
  --shadow: rgba(0, 0, 0, 0.55);
  --mono: "IBM Plex Mono", "Share Tech Mono", ui-monospace, monospace;
  --ui: "IBM Plex Mono", "Rubik", "Heebo", sans-serif;
  --copy: var(--ui);
  --rail: 248px;
  --dir: 1;
}

html[dir="rtl"] {
  --dir: -1;
}

html[lang="he"] {
  --ui: "Rubik", "Heebo", sans-serif;
  --copy: "Rubik", "Heebo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--copy);
  overflow: hidden;
}

.ltr {
  unicode-bidi: isolate;
}

#matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.38;
  pointer-events: none;
}

.scanlines, .vignette, .scan-sweep {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: multiply;
}
.scan-sweep {
  inset: auto 0 0 0;
  height: 22%;
  z-index: 3;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 255, 106, 0.07),
    transparent
  );
  animation: scan-sweep 8.5s linear infinite;
}
@keyframes scan-sweep {
  0% { transform: translateY(-120vh); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}
.vignette {
  box-shadow:
    inset 0 0 160px 36px rgba(0, 0, 0, 0.78),
    inset 0 0 40px 8px rgba(0, 255, 106, 0.04);
}

.crt {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  border-radius: 18px / 12px;
  box-shadow: inset 0 0 90px 28px rgba(0, 0, 0, 0.42);
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
  padding-inline: 14px;
  background: linear-gradient(#0d2818, #07150d);
  border-bottom: 2px solid var(--green-dim);
  box-shadow: 0 2px 0 #003b18, inset 0 1px 0 rgba(0, 255, 106, 0.25);
  font-family: var(--mono);
  font-size: 13px;
}
.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: led-pulse 2.4s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.prompt { color: var(--green); letter-spacing: 0.04em; }
.cursor-block {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--green);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.clock { color: var(--amber); font-variant-numeric: tabular-nums; }
.menu-toggle {
  display: none;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green-dim);
  font-size: 16px;
  padding: 2px 8px;
  cursor: pointer;
}
.lang-toggle {
  display: flex;
  border: 1px solid var(--green-dim);
}
.lang-toggle button {
  background: transparent;
  color: var(--muted);
  border: 0;
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}
.lang-toggle button.active {
  background: var(--green);
  color: #021409;
  font-weight: 600;
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 0;
}

.rail {
  background: linear-gradient(180deg, #08180e 0%, #04100a 100%);
  border-inline-end: 2px solid var(--bezel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-brand {
  padding: 18px 16px 12px;
  border-bottom: 1px solid #1a4a2c;
}
.brand-mark {
  color: var(--green-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
}
.brand-name {
  margin-block-start: 6px;
  color: var(--green);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
}
.brand-name span { color: var(--amber); }

.nav {
  flex: 1;
  overflow: auto;
  padding: 10px 8px 16px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 9px 10px;
  border: 1px solid transparent;
}
html[lang="he"] .nav a {
  font-family: var(--copy);
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
}
.nav a:hover { color: var(--green); background: var(--green-fade); }
.nav a.active {
  color: #021409;
  background: var(--green);
  border-color: var(--amber);
  box-shadow: calc(var(--dir) * 2px) 2px 0 #003b18;
}
.nav .idx {
  opacity: 0.55;
  min-width: 2.2em;
  font-family: var(--mono);
  letter-spacing: 0.06em;
}
.rail-foot {
  padding: 10px 12px 14px;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid #1a4a2c;
  font-family: var(--mono);
}
html[lang="he"] .rail-foot {
  font-family: var(--copy);
  letter-spacing: 0;
  font-size: 11px;
}

.terminal {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(6, 20, 12, 0.88), rgba(2, 8, 5, 0.92));
}
.window-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #0c2216;
  border-bottom: 1px solid #1a4a2c;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.dot {
  width: 9px; height: 9px;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.25);
}
.dot:nth-child(1) { background: var(--danger); }
.dot:nth-child(2) { background: var(--amber); }
.dot:nth-child(3) { background: var(--green-dim); }
.win-title { margin-inline-start: 8px; color: var(--green); letter-spacing: 0.04em; }

.terminal-body {
  flex: 1;
  overflow: auto;
  padding-block: 28px 48px;
  padding-inline: 32px;
}

.boot {
  margin-block-end: 8px;
}
.boot-line {
  font-family: var(--mono);
  color: var(--green-dim);
  font-size: 13px;
  margin: 0 0 6px;
  min-height: 1.2em;
}
html[lang="he"] .boot-line {
  font-family: var(--copy);
  letter-spacing: 0;
  font-size: 14px;
}
.hero-title {
  margin: 18px 0 8px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--green);
  text-shadow: 0 0 18px rgba(0, 255, 106, 0.35);
  letter-spacing: 0.04em;
  line-height: 1.1;
  font-weight: 700;
}
html[lang="he"] .hero-title {
  letter-spacing: 0;
  font-size: clamp(2.25rem, 5.6vw, 3.75rem);
  line-height: 1.2;
}
.hero-sub {
  color: var(--amber);
  font-family: var(--mono);
  margin: 0 0 22px;
}
html[lang="he"] .hero-sub {
  font-family: var(--copy);
  letter-spacing: 0;
  font-size: 1.05rem;
}
.lead {
  max-width: 62ch;
  line-height: 1.7;
  color: var(--text);
}
html[lang="he"] .lead {
  line-height: 1.85;
  font-size: 1.05rem;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--amber);
  text-transform: uppercase;
  margin: 0 0 10px;
}
html[lang="he"] .kicker {
  font-family: var(--copy);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 13px;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-block-start: 18px;
}
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--green-dim);
  box-shadow: calc(var(--dir) * 3px) 3px 0 #00180b;
  padding: 16px;
  min-height: 128px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--green);
  box-shadow:
    calc(var(--dir) * 4px) 4px 0 var(--green-dim),
    0 0 22px rgba(0, 255, 106, 0.22);
  transform: translate(calc(var(--dir) * -2px), -2px);
}
.card h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 1.05rem;
}
html[lang="he"] .card h3 { font-size: 1.12rem; }
.card p, .card span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
html[lang="he"] .card p { line-height: 1.65; font-size: 0.98rem; }
.tag {
  display: inline-block;
  margin-block-start: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: #021409;
  background: var(--amber);
  padding: 2px 6px;
  letter-spacing: 0.06em;
}
html[lang="he"] .tag { letter-spacing: 0.02em; }
.placeholder {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber-dim);
  margin-block-start: 8px;
}
html[lang="he"] .placeholder {
  font-family: var(--copy);
  letter-spacing: 0;
}
.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block-start: 14px;
}
.store-badge {
  display: inline-flex;
  height: 40px;
  text-decoration: none;
}
.store-badge img {
  height: 40px;
  width: auto;
  display: block;
}
.store-badge.play img {
  height: 58px;
  margin-block: -9px;
}
.web-demo {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 6px 8px;
  text-decoration: none;
}
.web-demo:hover { border-color: var(--green); color: var(--text); }

.photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-block-start: 16px;
}
.photo {
  aspect-ratio: 1;
  border: 1px solid var(--green-dim);
  background:
    repeating-linear-gradient(90deg, #06210f 0 8px, #083016 8px 16px),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(0,255,106,0.08) 8px 16px);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
}
.list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.list li {
  border-bottom: 1px dashed #1a4a2c;
  padding-block: 12px;
}
.list a { color: var(--green); }
.muted { color: var(--muted); }

@media (max-width: 800px) {
  body { overflow: auto; }
  .menu-toggle { display: inline-block; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    z-index: 6;
    inset-block: 40px 0;
    inset-inline-start: 0;
    width: min(86vw, 280px);
    transform: translateX(calc(var(--dir) * -105%));
    transition: transform 0.22s ease;
    box-shadow: calc(var(--dir) * 8px) 0 30px var(--shadow);
  }
  body.nav-open .rail { transform: translateX(0); }
  .terminal-body {
    padding-block: 20px 40px;
    padding-inline: 16px;
  }
}

.wakeup {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-inline: 10vw;
  background: #000;
  color: #5fffaf;
  font-family: "Share Tech Mono", var(--mono);
  cursor: pointer;
}
.wakeup[hidden] { display: none; }

body.wakeup-playing .crt,
body.wakeup-playing .scan-sweep,
body.wakeup-playing .scanlines,
body.wakeup-playing .vignette {
  visibility: hidden;
}
body.wakeup-playing #matrix-rain {
  opacity: 0.12;
}

.wakeup-line {
  margin: 0;
  font-size: clamp(1.35rem, 3.6vw, 2.35rem);
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(95, 255, 175, 0.45);
  white-space: pre;
}
.wakeup-cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  margin-inline-start: 0.08em;
  background: #5fffaf;
  box-shadow: 0 0 8px rgba(95, 255, 175, 0.7);
  vertical-align: -0.12em;
  animation: blink 0.9s steps(1) infinite;
}
.wakeup-line.is-knock .wakeup-cursor { display: none; }
.wakeup-skip {
  position: absolute;
  inset-inline-end: 22px;
  inset-block-end: 22px;
  background: transparent;
  border: 1px solid rgba(95, 255, 175, 0.35);
  color: #5fffaf;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  opacity: 0.72;
}
.wakeup-skip:hover { opacity: 1; }

@media (max-width: 800px) {
  .wakeup {
    justify-content: center;
    padding: 24px;
    padding-bottom: max(72px, env(safe-area-inset-bottom));
    text-align: center;
  }
  .wakeup-line {
    white-space: normal;
    text-align: center;
    max-width: min(100%, 22ch);
    font-size: clamp(1.2rem, 6.2vw, 1.75rem);
    letter-spacing: 0.03em;
    line-height: 1.4;
  }
  .wakeup-skip {
    inset-inline-end: max(16px, env(safe-area-inset-right));
    inset-block-end: max(16px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-block, .led, .scan-sweep, .wakeup-cursor { animation: none; }
  .scan-sweep { display: none; }
  #matrix-rain { display: none; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
