:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --panel-muted: #f3f4f6;
  --text: #1f2a37;
  --text-soft: #6b7280;
  --border: #e5e7eb;
  --accent: #22c55e;
  --accent-soft: #d1fae5;
  --terminal-bg: #000000;
  --terminal-text: #00ff00;
}

html[data-theme="dark"] {
  --bg: #0b0d0b;
  --panel: #121512;
  --panel-soft: #171b17;
  --panel-muted: #1d231d;
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --border: #26302a;
  --accent: #00ff66;
  --accent-soft: rgba(0, 255, 102, 0.15);
  --terminal-bg: #000000;
  --terminal-text: #7cff00;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* HEADER */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #000;
  flex: 0 0 auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-soft);
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--panel-muted);
}

#langToggle {
  min-width: 42px;
  padding: 0 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.theme-icon-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 18px;
}

.site-version {
  font-size: 12px;
  color: var(--text-soft);
  min-width: 28px;
  text-align: left;
}

/* HERO */
.hero {
  padding-top: 12px;
}

.hero-title {
  font-size: 32px;
  margin-bottom: 12px;
}

.hero-description {
  color: var(--text-soft);
  margin-bottom: 20px;
  max-width: 760px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
}

/* GRID */
.features-preview {
  padding-top: 18px;
}

.two-column-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: stretch;
}

/* FEATURES */
.feature-panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  height: 100%;
}

.section-title {
  font-size: 22px;
  margin-bottom: 14px;
}

.feature-list {
  padding-left: 22px;
}

.feature-list li {
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* PREVIEW */
.preview-panel {
  min-width: 0;
}

.preview-window {
  background: var(--panel);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  height: 100%;
}

.preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.preview-label {
  font-size: 14px;
  color: var(--text-soft);
}

/* WINDOWS BUTTONS */
.preview-window-controls {
  display: flex;
  gap: 2px;
  margin-right: -6px;
}

.win-btn {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  position: relative;
}

.win-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.win-btn.minimize::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 1px;
  background: var(--text-soft);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.win-btn.close::before,
.win-btn.close::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 1px;
  background: var(--text-soft);
  top: 50%;
  left: 50%;
}

.win-btn.close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.win-btn.close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.win-btn.close:hover {
  background: #e81123;
}

.win-btn.close:hover::before,
.win-btn.close:hover::after {
  background: #fff;
}

/* APPBAR */
.preview-appbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
}

.preview-appbar-left,
.preview-appbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.preview-icon-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.preview-icon-btn:hover {
  background: var(--panel-muted);
}

.ui-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.88;
}

.preview-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-tab {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--panel-muted);
  color: var(--text);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.mode-tab:hover {
  transform: translateY(-1px);
}

.mode-tab.is-active {
  background: var(--accent-soft);
}

/* BODY */
.preview-body {
  display: flex;
  height: 420px;
}

.preview-terminal {
  flex: 1;
  min-width: 0;
  background: var(--terminal-bg);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  overflow: hidden;
}

.terminal-screen {
  color: var(--terminal-text);
  font-family: Consolas, monospace;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.22;
  min-height: 100%;
}

.terminal-screen p {
  margin-bottom: 8px;
}

.terminal-cursor {
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* FOOTER */
.site-footer {
  padding: 20px;
  text-align: center;
  color: var(--text-soft);
}

/* TABLET */
@media (max-width: 980px) {
  .container {
    padding: 20px;
  }

  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .two-column-grid {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    height: auto;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .header-inner {
    gap: 16px;
  }

  .brand {
    justify-content: flex-start;
    width: 100%;
  }

  .brand-title {
    font-size: 17px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .site-nav {
    display: none;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    padding: 6px 8px;
    font-size: 13px;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.18;
  }

  .hero-description {
    font-size: 15px;
    line-height: 1.5;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .feature-panel {
    display: none;
  }

  .preview-topbar {
    padding: 10px 8px 10px 12px;
  }

  .preview-body {
    height: 320px;
  }

  .terminal-screen {
    padding: 16px 14px 20px;
    font-size: 13px;
  }
}