@font-face { font-family: 'Titan One'; font-weight: 400; font-display: swap; src: url(fonts/titan-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Titan One'; font-weight: 400; font-display: swap; src: url(fonts/titan-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-weight: 400 800; font-display: swap; src: url(fonts/figtree-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-weight: 400 800; font-display: swap; src: url(fonts/figtree-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Stůl se stavebnicí: krémový baseplate, čtyři základní barvy kostek, modré rámečky z návodu */
:root {
  --paper: #f7f3ea;
  --card: #fff;
  --ink: #1c1b1f;
  --dim: #5b574f;
  --line: #e6dfd0;
  --line-dark: #cfc5af;
  --red: #d63a2a;
  --red-dark: #9e2417;
  --yellow: #ffcd1f;
  --yellow-dark: #d29e00;
  --blue: #1f68c8;
  --blue-dark: #134a92;
  --green: #2a9548;
  --green-dark: #1c6a32;
  --callout: #e7f1fb;
  --callout-line: #9cc3e8;
  --display: 'Titan One', 'Figtree', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle, rgb(80 60 20 / .06) 0 5px, transparent 5.5px) 0 0 / 22px 22px, var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 'Figtree', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--yellow); color: var(--ink); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.muted { color: var(--dim); font-size: .875rem; }
.eyebrow { font-weight: 800; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }

/* Výstupky na horní hraně kostky: řada půlelips v barvě --c, rozteč --pitch */
.btn-primary::before, .nav-cta::before, .brick a::before, .theme-grid a::before, .buybox::before, .missing i::before {
  content: ''; position: absolute; height: var(--stud-h, 8px); top: calc(-1 * var(--stud-h, 8px) - var(--stud-top, 0px));
  left: var(--stud-x, 12px); right: var(--stud-x, 12px);
  background: radial-gradient(ellipse 34% 100% at 50% 100%, var(--c) 95%, transparent 100%) 0 0 / var(--pitch, 24px) 100% space no-repeat;
  pointer-events: none;
}

/* Header */
.site-header { background: var(--card); position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 12px rgb(0 0 0 / .06); }
.site-header::after { content: ''; display: block; height: 6px; background: linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 0 50%, var(--blue) 0 75%, var(--green) 0); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; }
.brand-name { font: 400 1.75rem/1 var(--display); letter-spacing: .01em; }
.brand-name span { color: var(--red); }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); font-weight: 800; }
.site-header nav a { color: var(--ink); text-decoration: none; }
.site-header nav a:hover { color: var(--blue); }
.nav-cta { --c: var(--yellow); --stud-h: 6px; --pitch: 18px; --stud-x: 8px; position: relative; background: var(--yellow); border-radius: 6px; padding: 8px 14px; box-shadow: 0 4px 0 var(--yellow-dark); }
.site-header nav .nav-cta:hover { color: var(--ink); filter: brightness(1.05); }
@media (max-width: 640px) {
  .brand-name { font-size: 1.375rem; }
  .brand img { width: 36px; height: 36px; }
  .site-header nav a:not(.nav-cta) { display: none; }
}

/* Tlačítka: plastové kostky s hloubkou, hlavní má výstupky */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 400 1.25rem/1 var(--display); text-decoration: none; letter-spacing: .01em;
  padding: 15px 24px; color: var(--ink); background: var(--card);
  border-radius: 8px; box-shadow: inset 0 0 0 2px var(--line-dark), 0 5px 0 var(--line-dark);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--line-dark), 0 2px 0 var(--line-dark); }
.btn-primary { --c: var(--red); --stud-h: 8px; --stud-top: 0px; --pitch: 24px; --stud-x: 12px; background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-dark); margin-top: 8px; }
.btn-primary:active { box-shadow: 0 2px 0 var(--red-dark); }
.btn-big { width: 100%; font-size: 1.375rem; padding: 19px 24px; }

/* Hero: text a „krabice“ s jednou sadou */
.hero { padding-block: clamp(32px, 6vw, 72px) 16px; overflow-x: clip; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.375rem); }
.hero h1 span { color: var(--red); }
.lead { font-size: 1.1875rem; max-width: 34em; color: var(--dim); margin: 0 0 24px; }
.hero-stats { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats li { background: var(--card); border: 2px solid var(--line); border-radius: 8px; padding: 6px 12px; font-weight: 600; }
.hero-stats strong { font: 400 1.25rem/1 var(--display); color: var(--blue); }
.box {
  justify-self: center; width: min(100%, 420px); display: grid; text-decoration: none; color: var(--ink);
  background: var(--blue); border-radius: 10px; padding: 14px; position: relative;
  transform: rotate(2deg); box-shadow: 14px 14px 0 var(--blue-dark); transition: transform .2s;
}
.box:hover { transform: rotate(0deg) translateY(-4px); }
.box-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.box-theme { background: var(--yellow); font-weight: 800; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 4px; }
.box-no { font: 400 2rem/1 var(--display); color: #fff; }
.box-img { aspect-ratio: 1; background: var(--card); border-radius: 6px; padding: 14px; }
.box-img img { width: 100%; height: 100%; object-fit: contain; }
.box-name { color: #fff; font-weight: 800; font-size: 1.0625rem; line-height: 1.3; margin-top: 12px; padding-right: 96px; }
.box-price {
  position: absolute; right: -18px; bottom: -22px; width: 112px; aspect-ratio: 1; display: grid; place-items: center; text-align: center;
  font: 400 1.25rem/1 var(--display); background: var(--yellow); border-radius: 50%; transform: rotate(-10deg);
  box-shadow: 0 4px 0 var(--yellow-dark);
}
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .box { width: min(100% - 24px, 380px); margin-bottom: 24px; }
}

/* Témata: barevné kostky */
.themes { padding-block: 56px 8px; scroll-margin-top: 90px; }
.theme-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 30px 16px; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.theme-grid li { --c: var(--red); --cd: var(--red-dark); --fg: #fff; }
.theme-grid li:nth-child(4n+2) { --c: var(--yellow); --cd: var(--yellow-dark); --fg: var(--ink); }
.theme-grid li:nth-child(4n+3) { --c: var(--blue); --cd: var(--blue-dark); }
.theme-grid li:nth-child(4n+4) { --c: var(--green); --cd: var(--green-dark); }
.theme-grid li.t-all { --c: var(--card); --cd: var(--line-dark); --fg: var(--ink); }
.theme-grid a {
  --stud-h: 9px; --pitch: 30px; --stud-x: 14px;
  position: relative; display: grid; gap: 2px; height: 100%; padding: 16px 18px;
  background: var(--c); color: var(--fg); text-decoration: none; border-radius: 4px;
  box-shadow: 0 6px 0 var(--cd); transition: transform .12s;
}
.theme-grid a:hover { transform: translateY(-4px); }
.t-name { font: 400 1.4375rem/1.15 var(--display); }
.t-count { font-weight: 600; opacity: .85; }

/* Poličky na homepage */
.shelf { padding-top: 52px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--line-dark); padding-bottom: 8px; margin-bottom: 8px; }
.shelf-head h2 { margin: 0; }
.shelf-head h2 a { color: var(--ink); text-decoration: none; }
.shelf-head h2 a:hover { color: var(--blue); }
.more { font-weight: 800; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }
.rail { list-style: none; margin: 0; padding: 22px 2px 20px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-color: var(--line-dark) transparent; }
.rail > li { scroll-snap-align: start; }

/* Karta = kostka: barevný horní díl s výstupky, bílé tělo */
.brick { --c: var(--red); }
.brick:nth-child(4n+2) { --c: var(--yellow); }
.brick:nth-child(4n+3) { --c: var(--blue); }
.brick:nth-child(4n+4) { --c: var(--green); }
.brick a {
  --stud-h: 9px; --stud-top: 12px; --pitch: 26px; --stud-x: 10px;
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 12px; color: var(--ink); text-decoration: none;
  background: var(--card); border-top: 12px solid var(--c); border-radius: 4px 4px 8px 8px;
  box-shadow: 0 0 0 1px var(--line), 0 5px 0 var(--line-dark); transition: transform .12s;
}
.brick a:hover { transform: translateY(-5px); }
.brick-img { position: relative; display: block; aspect-ratio: 1; }
.brick-img img { width: 100%; height: 100%; object-fit: contain; }
.setno { position: absolute; left: 0; top: 0; font: 400 .875rem/1 var(--display); background: var(--ink); color: #fff; padding: 4px 7px; border-radius: 4px; }
.sealed { position: absolute; left: 0; bottom: 0; font-weight: 800; font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; background: var(--yellow); padding: 3px 7px; border-radius: 4px; }
.brick-title { flex: 1; font-weight: 700; line-height: 1.3; margin: 12px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.brick-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.brick-price { font: 400 1.375rem/1 var(--display); color: var(--red); }

/* Stav jako výstupky shora */
.studs > span { display: inline-flex; gap: 3px; vertical-align: middle; }
.studs i {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle, var(--yellow) 0 42%, var(--yellow-dark) 47% 58%, var(--yellow) 63%);
  box-shadow: 0 1px 0 var(--yellow-dark);
}
.studs i.off { background: radial-gradient(circle, var(--line) 0 42%, var(--line-dark) 47% 58%, var(--line) 63%); box-shadow: 0 1px 0 var(--line-dark); }
.cond { font-size: .875rem; font-weight: 700; color: var(--dim); }

/* Výpis tématu */
.listing { padding-block: 24px 64px; }
.crumbs { font-size: .9375rem; color: var(--dim); margin-bottom: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--dim); }
.intro { max-width: 62ch; margin-bottom: 24px; }
.intro h1 { font-size: clamp(2.375rem, 5vw, 3.75rem); }
.intro p:last-child { color: var(--dim); font-size: 1.0625rem; margin: 0; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 18px; }
.tabs a { flex: none; font-weight: 800; color: var(--ink); text-decoration: none; padding: 8px 14px; background: var(--card); border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-dark); }
.tabs a:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.tabs a[aria-current='page'] { background: var(--blue); color: #fff; box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 30px; }
.search { flex: 1 1 240px; }
.search input, .sort select {
  width: 100%; font: inherit; font-weight: 600; color: var(--ink);
  background: var(--card); border: 2px solid var(--line-dark); border-radius: 8px; padding: 10px 14px;
}
.search input:focus, .sort select:focus { border-color: var(--blue); outline: none; }
.chips { display: flex; gap: 6px; border: 0; padding: 0; margin: 0; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: block; cursor: pointer; font-weight: 700; padding: 9px 14px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line-dark); }
.chips input:checked + span { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow-dark); }
.chips input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.count { margin: 0 0 0 auto; color: var(--dim); font-weight: 700; }
.grid { list-style: none; padding: 22px 0 0; margin: 0; display: grid; gap: 40px 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.empty { text-align: center; font: 400 1.375rem/1.4 var(--display); padding: 48px 0; }

/* Návod k nákupu jako stránka z návodu: velká čísla kroků, modré rámečky */
.how { padding-block: 80px 72px; scroll-margin-top: 90px; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.steps li { position: relative; background: var(--callout); border: 2px solid var(--callout-line); border-radius: 6px; padding: 18px 22px 22px 84px; }
.step-no { position: absolute; left: 20px; top: 8px; font: 400 3.5rem/1 var(--display); color: var(--ink); }
.steps h3 { font-size: 1.375rem; margin: 6px 0 6px; }
.steps p { margin: 0; color: #2f3a48; }

/* Detail */
.detail { padding-block: 24px 72px; }
.product { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 820px) { .product { grid-template-columns: 1fr; } }
.gallery-main { aspect-ratio: 1; background: var(--card); border-radius: 10px; padding: 18px; box-shadow: 0 0 0 1px var(--line), 0 6px 0 var(--line-dark); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 820px) { .gallery-main { aspect-ratio: 4 / 3; padding: 10px; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.thumb { width: 76px; height: 76px; background: var(--card); border-radius: 6px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); opacity: .7; }
.thumb[aria-current='true'], .thumb:hover { opacity: 1; box-shadow: inset 0 0 0 3px var(--blue); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.buybox {
  --c: var(--red); --stud-h: 11px; --stud-top: 16px; --pitch: 40px; --stud-x: 18px;
  position: sticky; top: 120px; background: var(--card); border-top: 16px solid var(--red); border-radius: 4px 4px 10px 10px;
  padding: clamp(18px, 3vw, 28px); box-shadow: 0 0 0 1px var(--line), 0 6px 0 var(--line-dark);
}
@media (max-width: 820px) { .buybox { position: relative; top: auto; margin-top: 12px; } }
.buybox h1 { font-size: clamp(1.75rem, 2.8vw, 2.375rem); }
.specs { margin: 14px 0 18px; display: grid; }
.specs div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-weight: 700; color: var(--dim); }
.specs dd { margin: 0; font-weight: 700; text-align: right; }
.specs .studs { margin-right: 6px; }
.price { font: 400 clamp(2.5rem, 3.6vw, 3.25rem)/1 var(--display); color: var(--red); margin: 0; }
.price-note { color: var(--dim); font-size: .875rem; margin: 8px 0 22px; }
.trust { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; font-weight: 700; }
.trust li::before { content: '✓'; display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 10px; border-radius: 50%; background: var(--green); color: #fff; font-size: .8125rem; }
/* Popis jako stránka návodu s číslem stránky */
.description { position: relative; max-width: 72ch; margin-top: 64px; padding: clamp(20px, 4vw, 40px); background: var(--card); border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 6px 0 var(--line-dark); font-size: 1.0625rem; }
.description::after { content: '1'; position: absolute; right: 18px; bottom: 12px; font: 400 1rem/1 var(--display); color: var(--line-dark); }
.description h2 { border-bottom: 3px solid var(--yellow); padding-bottom: 8px; }
.description ul { padding-left: 0; list-style: none; }
.description li { margin-bottom: .4em; }
.description li::before { content: ''; display: inline-block; width: .7em; height: .7em; margin-right: .7em; border-radius: 2px; background: var(--blue); vertical-align: .05em; }
.related { margin-top: 72px; }

/* 404: řada kostek s mezerou */
.notfound { padding-block: 72px 88px; max-width: 760px; text-align: center; }
.notfound h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
.notfound p { color: var(--dim); font-size: 1.125rem; }
.notfound .eyebrow { color: var(--red); }
.missing { display: flex; justify-content: center; gap: 4px; margin-bottom: 32px; }
.missing i { --c: var(--red); --stud-h: 8px; --pitch: 30px; --stud-x: 6px; position: relative; width: 72px; height: 40px; border-radius: 3px; background: var(--c); box-shadow: 0 5px 0 rgb(0 0 0 / .25); }
.missing i:nth-child(2) { --c: var(--yellow); }
.missing i:nth-child(4) { --c: var(--blue); }
.missing i.gap { background: none; box-shadow: none; outline: 3px dashed var(--line-dark); outline-offset: -3px; }
.missing i.gap::before { display: none; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 28px; }

/* Footer */
.site-footer { margin-top: 24px; background: var(--ink); color: #ece7dc; padding-block: 0 40px; }
.site-footer::before { content: ''; display: block; height: 8px; margin-bottom: 32px; background: linear-gradient(90deg, var(--green) 0 25%, var(--blue) 0 50%, var(--yellow) 0 75%, var(--red) 0); }
.site-footer a { color: var(--yellow); font-weight: 700; }
.footer-inner { display: grid; gap: 8px; }
.site-footer .footer-brand { justify-self: start; color: #fff; margin-bottom: 8px; }
.site-footer .footer-brand .brand-name span { color: var(--yellow); }
.footer-inner p { margin: 0; max-width: 66ch; }
.site-footer .muted { color: #b9b2a4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
