/* StroyKontrol — Brand Theme (Graphite Charcoal & Safety Orange) */

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

:root {
  color-scheme: light dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  
  /* Brand palette from logo (02-blueprint-check) */
  --brand-orange: #f97316;
  --brand-orange-hover: #ea580c;
  --brand-orange-dark: #c2410c;
  --brand-graphite: #1a1d22;
  --brand-cream: #f7f1e3;
  
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-light: rgba(234, 88, 12, 0.10);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  
  /* Light Theme (Warm Architectural Parchment) */
  --bg: #fbf9f5;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f4efe6;
  --bg-input: #ffffff;
  --text-primary: #191c20;
  --text-secondary: #484e5a;
  --text-muted: #727a89;
  --border: #e6dfd3;
  --border-focus: #ea580c;
  --shadow-sm: 0 1px 2px 0 rgba(25, 28, 32, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(25, 28, 32, 0.07), 0 2px 4px -2px rgba(25, 28, 32, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(25, 28, 32, 0.09), 0 4px 6px -4px rgba(25, 28, 32, 0.04);
  --grid-line: rgba(0, 0, 0, 0.035);
  --hero-glow: radial-gradient(circle at 50% -10%, rgba(234, 88, 12, 0.10) 0%, transparent 70%);
}

/* Explicit and System Dark Theme */
[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-light: rgba(249, 115, 22, 0.16);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);

    --bg: #141619;
    --bg-surface: #1b1e23;
    --bg-surface-elevated: #23272e;
    --bg-input: #17191e;
    --text-primary: #fbf9f5;
    --text-secondary: #c9ced6;
    --text-muted: #8b929f;
    --border: #2c313a;
    --border-focus: #f97316;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.55), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
    --grid-line: rgba(255, 255, 255, 0.028);
    --hero-glow: radial-gradient(circle at 50% -10%, rgba(249, 115, 22, 0.20) 0%, transparent 70%);
  }
}

[data-theme="dark"] {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: rgba(249, 115, 22, 0.16);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);

  --bg: #141619;
  --bg-surface: #1b1e23;
  --bg-surface-elevated: #23272e;
  --bg-input: #17191e;
  --text-primary: #fbf9f5;
  --text-secondary: #c9ced6;
  --text-muted: #8b929f;
  --border: #2c313a;
  --border-focus: #f97316;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.55), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
  --grid-line: rgba(255, 255, 255, 0.028);
  --hero-glow: radial-gradient(circle at 50% -10%, rgba(249, 115, 22, 0.20) 0%, transparent 70%);
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Blueprint architectural grid background pattern */
  background-color: var(--bg);
  background-image: 
    var(--hero-glow),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 800px, 36px 36px, 36px 36px;
  background-repeat: no-repeat, repeat, repeat;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background-color: rgba(var(--bg), 0.88);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  box-shadow: var(--shadow-sm);
  display: block;
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 0.45rem;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

@media (max-width: 640px) {
  .nav-link-hide-mobile {
    display: none;
  }
}

/* Theme Toggle Button */
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.55rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-theme:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Hero Section */
.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(249, 115, 22, 0.3);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary) 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 auto 2.25rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.625rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.45);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* Feature tags pill row */
.hero-features-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Section Common */
.section {
  padding: 3.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.75rem;
}

.section-label {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(249, 115, 22, 0.4);
}

.feature-icon-wrapper {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.feature-icon {
  width: 1.75rem;
  height: 1.75rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.feature-card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Download / Release Section */
.download-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2.5rem;
  min-width: 0;
}

.release-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.release-badge-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.release-tag {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.build-code {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-surface-elevated);
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

.release-notes-box {
  background: var(--bg-surface-elevated);
  border-radius: 0.75rem;
  padding: 1.1rem 1.35rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary);
}

.release-notes-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.release-notes-content {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* Architecture Cards Grid — 2 columns on desktop for balanced symmetry */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 720px) {
  .arch-grid {
    grid-template-columns: 1fr;
  }
}

.arch-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s;
  min-width: 0;
  overflow: hidden;
}

.arch-card.recommended {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, rgba(249, 115, 22, 0.06) 100%);
  box-shadow: 0 0 0 1px var(--primary);
}

.badge-recommended {
  position: absolute;
  top: -0.65rem;
  right: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.65rem;
  border-radius: 9999px;
  background: var(--primary);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arch-header {
  margin-bottom: 0.75rem;
}

.arch-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.arch-size {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
}

.arch-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  flex-grow: 1;
  line-height: 1.5;
}

.arch-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 0.55rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-decoration: none;
  background: var(--primary);
  color: #ffffff;
  transition: background-color 0.15s, transform 0.15s;
}

.arch-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.arch-card:not(.recommended) .arch-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.arch-card:not(.recommended) .arch-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

/* SHA Hash Container — Robust, zero-overflow, click-to-copy */
.sha-box {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  min-width: 0;
  width: 100%;
}

.sha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
  min-width: 0;
}

.sha-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--primary-light);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--primary);
  color: #ffffff;
}

.sha-code-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  min-width: 0;
  overflow: hidden;
}

.sha-code-wrapper:hover {
  border-color: var(--primary);
  background: var(--bg-surface-elevated);
}

.sha-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  user-select: all;
}

/* QR Code & Mobile Box */
.qr-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.qr-info {
  flex: 1 1 300px;
}

.qr-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.qr-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.qr-image-wrapper {
  background: #ffffff;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  width: 140px;
  height: 140px;
  display: block;
}

/* Installation Guide Steps */
.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.step-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.step-desc strong {
  color: var(--text-primary);
}

.guide-alert {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: var(--text-primary);
}

.guide-alert-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Security Specs Box */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.spec-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

.spec-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.spec-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 2.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Tooltip toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--brand-graphite);
  color: #fff;
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
}
