/* Self-hosted fonts — font-display:optional = zero CLS */
@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url(fonts/syne-var.woff2) format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 300;
  font-display: optional;
  src: url(fonts/dm-mono-300.woff2) format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url(fonts/dm-mono-400.woff2) format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url(fonts/dm-mono-500.woff2) format("woff2");
}

/* === KEPLY.CSS — Shared styles for keply.it === */

/* --- RESET + DARK THEME (default) --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root, [data-theme="dark"] {
  --bg: #08090d;
  --bg2: #0f1117;
  --bg3: #151720;
  --border: rgba(255,255,255,0.09);
  --border2: rgba(255,255,255,0.16);
  --text: #eeeef0;
  --muted: #8b91a1;
  --faint: #3a3d48;
  --noise-opacity: .3;
  --mono: 'DM Mono', monospace;
  --sans: 'Syne', sans-serif;
  --blue: #3b82f6;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --cta-text: #08090d;
  color-scheme: dark;
}

/* --- LIGHT THEME --- */
[data-theme="light"] {
  --bg: #f2f1ee;
  --bg2: #ebe9e5;
  --bg3: #e1ded8;
  --border: rgba(0,0,0,0.12);
  --border2: rgba(0,0,0,0.18);
  --text: #111216;
  --muted: #565d69;
  --faint: #bcc1c8;
  --noise-opacity: .05;
  --cta-text: #fff;
  color-scheme: light;
}

/* --- BASE --- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); overflow-x: hidden; line-height: 1.6;
  transition: background .4s ease, color .4s ease;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999; opacity: var(--noise-opacity);
  transition: opacity .4s ease;
}
::selection { background: rgba(59,130,246,.3); }

/* --- NAV --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 68px;
  transition: background .3s ease, border-color .3s ease;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.nav-scrolled {
  border-bottom-color: var(--border2);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-brand {
  font-family: var(--sans); font-size: 14px; font-weight: 800;
  letter-spacing: 2px; color: var(--text); text-decoration: none;
}
.nav-center { display: flex; gap: 32px; }
.nav-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--text); text-decoration: none;
  padding: 4px 0; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-link:hover { color: var(--blue); }
.nav-link.active { color: var(--text); border-bottom-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-lang { display: flex; align-items: center; gap: 0; }
.nav-lang-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); background: none;
  border: none; cursor: pointer; padding: 4px 6px; transition: color .2s;
}
.nav-lang-btn:hover, .nav-lang-btn.active { color: var(--text); }
.nav-lang-sep { color: var(--faint); font-family: var(--mono); font-size: 10px; }

/* --- THEME TOGGLE --- */
.theme-toggle {
  position: relative; width: 36px; height: 36px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s ease, border-color .3s ease, transform .2s ease;
}
.theme-toggle:hover { transform: scale(1.1); background: var(--bg3); }
.theme-toggle svg { width: 16px; height: 16px; transition: opacity .3s ease; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* --- NAV MOBILE --- */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 24px; height: 18px; position: relative; z-index: 1001;
}
.nav-hamburger span {
  display: block; width: 100%; height: 1.5px; background: var(--text);
  position: absolute; left: 0; transition: all .3s ease;
}
.nav-hamburger span:nth-child(1) { top: 0; }
.nav-hamburger span:nth-child(2) { top: 8px; }
.nav-hamburger span:nth-child(3) { top: 16px; }
.nav-hamburger.open span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { top: 8px; transform: rotate(-45deg); }
.nav-mobile {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  flex-direction: column; align-items: center; justify-content: center; gap: 32px;
  transition: opacity .3s ease; opacity: 0; pointer-events: none;
}
.nav-mobile.open { display: flex; opacity: .98; pointer-events: auto; }
.nav-mobile .nav-link { font-size: 14px; letter-spacing: 3px; }
.nav-mobile .nav-lang { margin-top: 32px; }
.nav-mobile .theme-toggle { margin-top: 16px; }

/* --- HERO --- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 80px 48px; position: relative;
}
.hero-logo { margin-bottom: 40px; opacity: 0; animation: up .9s var(--ease) both; }
.hero-wordmark {
  font-size: clamp(56px, 10vw, 120px); font-weight: 800;
  letter-spacing: -3px; line-height: .9;
  opacity: 0; animation: up .9s .1s var(--ease) both;
}
.hero-sub {
  font-family: var(--mono); font-size: 15px;
  color: var(--muted); letter-spacing: 1px; margin-top: 24px;
  opacity: 0; animation: up .9s .2s var(--ease) both;
}
.hero-rule {
  width: 56px; height: 1px; background: var(--border2);
  margin: 48px auto 0;
  opacity: 0; animation: up .9s .3s var(--ease) both;
}
.hero-scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: 3px;
  color: var(--muted); text-transform: uppercase;
  opacity: 0; animation: up .9s .5s var(--ease) both;
}

@keyframes up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- HERO COMPACT (inner pages) --- */
.hero-compact {
  padding: 160px 48px 80px; max-width: 1100px; margin: 0 auto;
}

/* --- SECTIONS --- */
.sect {
  padding: 132px 48px; border-top: 1px solid var(--border);
  max-width: 1100px; margin: 0 auto;
}
.sect-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 4px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 16px;
}
.sect-title {
  font-size: clamp(28px, 4vw, 48px); font-weight: 700;
  letter-spacing: -1.5px; line-height: 1.05; margin-bottom: 16px;
}
.sect-desc {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  line-height: 1.85; letter-spacing: .2px; max-width: 520px;
}

/* --- PROP GRID --- */
.prop-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; margin-top: 56px;
}
.prop-cell {
  background: var(--bg); padding: 36px 28px;
  transition: background .2s;
}
.prop-cell:hover { background: color-mix(in srgb, var(--bg3) 24%, var(--bg2)); border-color: var(--border2); transition: border-color .18s ease, background .18s ease; }
.prop-n {
  font-family: var(--mono); font-size: 40px; font-weight: 300;
  color: var(--faint); line-height: 1; margin-bottom: 16px;
}
.prop-h {
  font-size: 15px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 10px;
}
.prop-p {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  line-height: 1.85; letter-spacing: .2px;
}

/* --- APP GRID --- */
.app-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; margin-top: 56px;
}
.app-tile {
  background: var(--bg); padding: 36px 28px;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: background .2s; cursor: default;
}
.app-tile:hover { background: color-mix(in srgb, var(--bg3) 24%, var(--bg2)); border-color: var(--border2); transition: border-color .18s ease, background .18s ease; }
.app-tile-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px; width: 100%;
}
.app-tile-name {
  font-size: 13px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase;
}
.app-tile-sub {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  margin-top: 2px;
}
.app-tile-concept {
  font-family: var(--mono); font-size: 9px; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase;
  border-top: 1px solid var(--border); padding-top: 14px;
  width: 100%; margin-top: auto;
}

/* --- LIV BLOCK --- */
.liv-block {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; margin-top: 56px;
}
.liv-side {
  background: var(--bg); padding: 56px 48px;
}
.liv-side.accent {
  background: var(--bg2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.liv-quote {
  font-size: 22px; font-weight: 600; letter-spacing: -.5px;
  line-height: 1.4; margin-bottom: 20px;
}
.liv-detail {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  line-height: 2;
}
.liv-cap {
  font-family: var(--mono); font-size: 9px; letter-spacing: 3px;
  color: var(--muted); text-transform: uppercase;
}

/* --- TWO COLUMNS --- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.two-col-title {
  font-size: 15px; font-weight: 700; letter-spacing: .3px; margin-bottom: 12px;
}
.two-col-text {
  font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.9;
}

/* --- ECOSYSTEM BLOCKS --- */
.eco-block {
  display: grid; grid-template-columns: auto 1fr; gap: 48px;
  align-items: start; padding: 64px 0;
  border-top: 1px solid var(--border);
}
.eco-block-alt { direction: rtl; }
.eco-block-alt > * { direction: ltr; }
.eco-logo { flex-shrink: 0; }
.eco-name {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 2px;
}
.eco-sub {
  font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 16px;
}
.eco-desc {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  line-height: 1.9; margin-bottom: 16px; max-width: 480px;
}
.eco-features {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
}
.eco-features li {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding-left: 14px; position: relative;
}
.eco-features li::before { content: '\00B7'; position: absolute; left: 0; }
.eco-status {
  display: inline-block; font-family: var(--mono); font-size: 9px;
  letter-spacing: 2px; text-transform: uppercase; margin-top: 12px;
}
.eco-status-active { color: #22c55e; }
.eco-status-soon { color: var(--muted); }

/* --- FORMULA --- */
.formula-block {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 48px; text-align: center; margin: 56px 0;
}
.formula-eq {
  font-family: var(--sans); font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 700; letter-spacing: -.5px; line-height: 1.8;
}
.formula-op { color: var(--muted); font-weight: 400; margin: 0 12px; }
.formula-result { color: var(--blue); }

/* --- FULL-WIDTH BLOCK --- */
.full-block {
  background: var(--bg2); padding: 80px 48px; text-align: center;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  max-width: 1100px; margin: 0 auto;
}
.full-block-title {
  font-family: var(--sans); font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700; letter-spacing: -1px; margin-bottom: 16px;
}
.full-block-text {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  line-height: 1.9; max-width: 520px; margin: 0 auto;
}

/* --- APP ICON ROW --- */
.app-row {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; margin-top: 40px;
}
.app-row-item {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase;
}

/* --- DOWNLOAD CARD --- */
.dl-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 4px; padding: 56px 48px; text-align: center;
  max-width: 560px; margin: 56px auto 0;
}
.dl-card-name {
  font-family: var(--sans); font-size: 24px; font-weight: 700;
  letter-spacing: -.5px; margin: 16px 0 4px;
}
.dl-card-version {
  font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 16px;
}
.dl-card-desc {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  line-height: 1.9; margin-bottom: 32px;
}
.dl-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.dl-btn {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--cta-text); background: var(--blue);
  padding: 14px 36px; border-radius: 3px; text-decoration: none;
  transition: all .2s; width: 280px; text-align: center;
}
.dl-btn:hover { background: #5b9bf7; transform: translateY(-1px); }
.dl-btn-secondary {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text); background: transparent;
  border: 1px solid var(--border2);
  padding: 13px 36px; border-radius: 3px; text-decoration: none;
  transition: all .2s; width: 280px; text-align: center;
}
.dl-btn-secondary:hover { border-color: var(--text); transform: translateY(-1px); }
.dl-btn-disabled {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border);
  padding: 13px 36px; border-radius: 3px;
  width: 280px; text-align: center; cursor: default; opacity: .5;
}
.dl-requirements {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  margin-top: 24px; line-height: 1.8;
}

/* --- CTA --- */
.cta-sect {
  padding: 140px 48px; border-top: 1px solid var(--border);
  max-width: 1100px; margin: 0 auto; text-align: center;
}
.cta-title {
  font-size: clamp(24px, 3.5vw, 42px); font-weight: 700;
  letter-spacing: -1px; margin-bottom: 16px;
}
.cta-sub {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  margin-bottom: 40px; line-height: 1.9;
}
.cta-btn {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--cta-text); background: var(--blue);
  padding: 15px 32px; border-radius: 4px;
  text-decoration: none; transition: all .2s;
}
.cta-btn:hover { background: #4d8df7; transform: none; }

/* --- FOOTER --- */
.footer {
  padding: 48px; border-top: 1px solid var(--border);
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer-brand { font-size: 14px; font-weight: 800; letter-spacing: 2px; }
.footer-meta {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 1.6px; text-align: right; line-height: 1.8;
}

/* --- REVEAL --- */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- RESPONSIVE 900px --- */
@media (max-width: 900px) {
  .nav-center, .nav-right .nav-lang, .nav-right .theme-toggle { display: none; }
  .nav-hamburger { display: block; }
  .nav { padding: 0 24px; }
  .hero { padding: 60px 24px; }
  .hero-compact { padding: 120px 24px 60px; }
  .sect, .cta-sect { padding: 80px 24px; }
  .prop-grid, .app-grid { grid-template-columns: 1fr; }
  .liv-block { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .eco-block, .eco-block-alt { grid-template-columns: 1fr; direction: ltr; }
  .dl-btn, .dl-btn-secondary, .dl-btn-disabled { width: 100%; }
  .footer { flex-direction: column; gap: 16px; text-align: center; }
  .footer-meta { text-align: center; }
  .full-block { padding: 48px 24px; }
}

/* --- RESPONSIVE 600px --- */
@media (max-width: 600px) {
  .hero-wordmark { letter-spacing: -1px; }
  .prop-cell, .app-tile { padding: 28px 20px; }
  .liv-side { padding: 36px 24px; }
  .dl-card { padding: 36px 24px; }
}

/* --- PRINT --- */
[data-theme="light"] .prop-cell,
[data-theme="light"] .app-tile,
[data-theme="light"] .liv-side,
[data-theme="light"] .dl-card {
  box-shadow: 0 1px 0 rgba(0,0,0,0.025);
}

@media print {
  body { background: #fff; color: #111; }
  body::before { display: none; }
  :root { --bg: #fff; --bg2: #f5f5f3; --border: rgba(0,0,0,0.1); --text: #111; --muted: #666; --faint: #ddd; }
  .hero { min-height: auto; padding: 40px 0; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .nav, .theme-toggle { display: none; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  .hero-logo, .hero-wordmark, .hero-sub, .hero-rule, .hero-scroll { animation: none; opacity: 1; }
  .reveal { transition: none; opacity: 1; transform: none; }
  body, body::before { transition: none; }
}
