:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-alt: #eef1ea;
  --ink: #15201a;
  --muted: #5b6a61;
  --line: #dfe5dc;
  --accent: #0f8a5f;
  --accent-ink: #ffffff;
  --accent-soft: #dcf2e7;
  --raspberry: #c51a4a;
  --error: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 32, 26, .06), 0 8px 24px rgba(21, 32, 26, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1310;
    --surface: #141c17;
    --surface-alt: #111915;
    --ink: #e7efe9;
    --muted: #93a39a;
    --line: #25322b;
    --accent: #34c38b;
    --accent-ink: #06130d;
    --accent-soft: #143325;
    --raspberry: #f0587f;
    --error: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.accent { color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }

.testbar { background: var(--raspberry); color: #fff; text-align: center; font-size: .85rem; padding: .35rem 1rem; font-weight: 600; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.nav nav { display: flex; align-items: center; gap: 1.5rem; }
.nav nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav nav a:not(.btn):hover { color: var(--accent); }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); box-shadow: inset -6px -6px 0 var(--raspberry); }
@media (max-width: 760px) { .nav nav a:not(.btn) { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.25rem; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-small { padding: .45rem .9rem; font-size: .9rem; }
.btn-large { padding: 1rem 1.5rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; background: radial-gradient(1200px 400px at 80% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--muted); font-size: .95rem; }
.hero-facts strong { color: var(--ink); }
.rack { --unit-h: 2.75rem; --unit-gap: .55rem; background: var(--ink); border-radius: 18px; padding: 1.1rem; box-shadow: var(--shadow); }
.rack-title { margin: 0 0 .6rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #9fb3a8; }
/* Výška přesně na 6 serverů, další jsou dostupné posuvníkem */
.rack-list { display: grid; gap: var(--unit-gap); grid-auto-rows: var(--unit-h); height: calc(6 * var(--unit-h) + 5 * var(--unit-gap)); overflow-y: scroll; padding-right: .5rem; overscroll-behavior: contain; }
/* Firefox (ostatní prohlížeče používají ::-webkit-scrollbar, který zůstává viditelný i na macOS) */
@supports not selector(::-webkit-scrollbar) { .rack-list { scrollbar-width: thin; scrollbar-color: #3ddc97 #1f2b24; } }
.rack-list::-webkit-scrollbar { width: 8px; }
.rack-list::-webkit-scrollbar-track { background: #1f2b24; border-radius: 4px; }
.rack-list::-webkit-scrollbar-thumb { background: #3ddc97; border-radius: 4px; }
.rack-list:focus-visible { outline: 2px solid #3ddc97; outline-offset: 4px; border-radius: 8px; }
.rack-unit { display: flex; align-items: center; gap: .5rem; background: #1f2b24; border-radius: 8px; padding: 0 .85rem; font-family: var(--mono); font-size: .8rem; color: #9fb3a8; text-decoration: none; transition: background .15s ease; }
a.rack-unit:hover { background: #28382f; color: #e7efe9; }
.rack-unit .led { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 8px #3ddc97; }
.rack-unit .led + .led { background: #f5b83d; box-shadow: 0 0 6px #f5b83d; animation: blink 1.8s infinite; }
.rack-label { margin-left: .35rem; min-width: 3.6rem; }
.rack-bar { flex: 1; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, #2c3a32 0 6px, transparent 6px 10px); }
.rack-spec { color: #7d9087; font-size: .72rem; white-space: nowrap; }
.rack-free { color: #3ddc97; font-size: .72rem; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-color-scheme: dark) { .rack { background: #070b09; border: 1px solid var(--line); } }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { display: none; } }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--surface-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.notice-error { border-left-color: var(--error); }

/* Offer */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.offer header { display: flex; justify-content: space-between; align-items: start; gap: .75rem; margin-bottom: 1rem; }
.offer h3 { margin: 0; }
.badge { display: inline-block; white-space: nowrap; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; }
.specs { margin: 0 0 1.25rem; display: grid; gap: .45rem; }
.specs div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; font-weight: 500; }
.price { margin-top: auto; margin-bottom: 1rem; }
.price-main { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.price p { margin: .15rem 0 0; }
.server-picks { display: grid; gap: .5rem; }

/* Steps & features */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.steps p { color: var(--muted); margin: 0; }
.step-no { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.feature-list h3 { margin-bottom: .3rem; }
.feature-list p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .two-col, .feature-list { grid-template-columns: 1fr; } }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .6rem; padding: 0 1.25rem; }
summary { cursor: pointer; font-weight: 600; padding: 1rem 0; }
details p { color: var(--muted); }

/* Order */
.order-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; align-items: start; }
.order-summary { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.order-summary h1 { font-size: 2rem; font-family: var(--mono); }
.total { display: flex; flex-direction: column; gap: .15rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.total-price { font-size: 2rem; letter-spacing: -.02em; }
.order-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend { font-weight: 700; margin-bottom: .75rem; }
.periods { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.period input { position: absolute; opacity: 0; }
.period-box { display: flex; flex-direction: column; gap: .15rem; border: 1.5px solid var(--line); border-radius: 10px; padding: .8rem; cursor: pointer; height: 100%; font-size: .9rem; }
.period-box span:not(.badge) { color: var(--muted); }
.period-box .badge { align-self: start; margin-top: .25rem; }
.period input:checked + .period-box { border-color: var(--accent); background: var(--accent-soft); }
.period input:focus-visible + .period-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
input:not([type=radio]):not([type=checkbox]), textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; width: 100%; }
textarea { font-family: var(--mono); font-size: .85rem; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field-error { color: var(--error); font-size: .875rem; font-weight: 500; }
.check { display: flex; gap: .6rem; align-items: start; margin-bottom: 1.25rem; }
.check input { margin-top: .35rem; accent-color: var(--accent); }
@media (max-width: 860px) { .order-grid { grid-template-columns: 1fr; } .order-summary { position: static; } .periods { grid-template-columns: 1fr 1fr; } .field-row { grid-template-columns: 1fr; } }

/* Status */
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.status-delivered { border-top: 4px solid var(--accent); }
.status-failed, .status-conflict { border-top: 4px solid var(--raspberry); }
.status-card .specs { margin-top: 1.5rem; }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; vertical-align: -.15em; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fake-actions { display: flex; gap: .75rem; }

.prose h2 { font-size: 1.2rem; margin-top: 2.25rem; scroll-margin-top: 90px; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem 0; font-size: .92rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 640px; }
.prose th, .prose td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: .6rem .5rem; }
.prose th { color: var(--muted); font-weight: 600; }
.form-template { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 1.25rem 1.5rem; }

/* Footer */
.site-footer { background: var(--surface-alt); border-top: 1px solid var(--line); padding: 3rem 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h4 { font-size: .95rem; }
.site-footer a:not(.logo) { color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Doklad */
.text-warn { color: var(--raspberry); }
.receipt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.receipt-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.receipt-head h1 { font-size: 1.8rem; font-family: var(--mono); }
.receipt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
.receipt-parties h4 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.receipt-items { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.receipt-items th, .receipt-items td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.receipt-items tfoot th { border-bottom: 0; border-top: 2px solid var(--ink); font-size: 1.1rem; }
.receipt-items .num { text-align: right; white-space: nowrap; }
@media (max-width: 600px) { .receipt-parties { grid-template-columns: 1fr; } }
@media print {
  .site-header, .site-footer, .testbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 0; }
  .receipt { box-shadow: none; border: 0; padding: 0; }
}
