/* Papirnica Val — design system */

:root {
  --sky: #2f7fa8;
  --sky-dark: #215c7c;
  --sky-pale: #e4f1f7;
  --sun: #fbd94a;
  --sun-dark: #e0b61e;
  --paper: #fbf7ee;
  --paper-dark: #f1e9d8;
  --ink: #26241f;
  --ink-soft: #5a5648;
  --line: #d9cfb5;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 24px -12px rgba(38, 36, 31, 0.28);
  --shadow-paper: 0 2px 0 rgba(0,0,0,.05), 0 14px 30px -18px rgba(38,36,31,.35);
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "Consolas", "SF Mono", monospace;
  --maxw: 1180px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--sky-dark); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--sun); padding: .5em 1em; z-index: 200; }
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: 2px; border-radius: 4px; }

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

/* ---------- texture helpers ---------- */
.woodgrain-bg {
  background-color: var(--paper-dark);
  background-image:
    repeating-linear-gradient(90deg, rgba(90,70,30,.05) 0px, rgba(90,70,30,.05) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(0deg, rgba(90,70,30,.03) 0px, rgba(90,70,30,.03) 2px, transparent 2px, transparent 7px);
}
.pegboard-bg {
  background-image: radial-gradient(circle, rgba(47,127,168,.16) 1.6px, transparent 1.8px);
  background-size: 26px 26px;
}
.grain-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; mix-blend-mode: multiply; }

/* ---------- layout containers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: 1rem !important; }
.u-mt-2 { margin-top: 2rem !important; }
.u-mt-3 { margin-top: 3rem !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 2px 0 var(--sun);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.logo-mark { width: 40px; height: 40px; flex: none; }
.logo-word strong { color: var(--sky-dark); }
.nav-toggle { display: none; background: none; border: 2px solid var(--ink); border-radius: var(--radius-sm); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.main-nav a { font-weight: 600; color: var(--ink); position: relative; padding: .25rem 0; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--sky); transition: width .25s ease; }
.main-nav a:hover::after, .main-nav a.is-active::after { width: 100%; }
.main-nav a.is-active { color: var(--sky-dark); }
.cart-link { display: flex; align-items: center; gap: .35rem; color: var(--ink); font-weight: 700; position: relative; }
.cart-count { background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; padding: 0 .3em; }
.cart-link.bump .cart-count { animation: bump .4s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 0 auto; width: min(78vw, 320px);
    background: var(--paper); border-left: 3px solid var(--ink);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 1.5rem; gap: 1.5rem;
    transform: translateX(100%); visibility: hidden; transition: transform .3s ease;
  }
  .main-nav.is-open { transform: translateX(0); visibility: visible; }
  .main-nav ul { flex-direction: column; gap: 1.1rem; }
  body.nav-open { overflow: hidden; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem;
  padding: .75em 1.4em; border-radius: var(--radius-sm); border: 2px solid var(--ink);
  cursor: pointer; position: relative; overflow: hidden; min-height: 44px;
  text-align: center; background: var(--white); color: var(--ink);
  transition: color .25s ease, transform .15s ease;
}
.btn::before {
  content: ""; position: absolute; inset: 0; left: -100%; width: 100%;
  background: var(--ink); z-index: 0; transition: left .3s ease;
}
.btn span, .btn { z-index: 1; }
.btn:hover::before { left: 0; }
.btn:hover { color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-sun { background: var(--sun); border-color: var(--ink); }
.btn-sun:hover { color: var(--ink); }
.btn-sun::before { background: var(--ink); opacity: .08; }
.btn-sky { background: var(--sky); color: var(--white); border-color: var(--sky-dark); }
.btn-sky::before { background: var(--sky-dark); }
.btn-ghost { background: transparent; }
.btn-lg { padding: .9em 1.8em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 3.5rem 0 5rem; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.hero-title { font-size: clamp(2.4rem, 5.2vw, 4.2rem); margin-bottom: .6rem; }
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36ch; }
.hero-art { position: relative; aspect-ratio: 1/1; }
.hero-layer { position: absolute; inset: 0; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.hero-layer-1 { transform: translate(0,0); }
.hero-layer-2 { transform: translate(14px, -10px); }
.hero-layer-3 { transform: translate(-10px, 14px); }
.hero.loaded .hero-layer-1 { transform: translate(-18px,-10px); }
.hero.loaded .hero-layer-2 { transform: translate(22px, 8px); }
.hero.loaded .hero-layer-3 { transform: translate(-6px, 26px); }
.hero-cta { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
@media (max-width: 880px) { .hero-inner { grid-template-columns: 1fr; } .hero-art { max-width: 320px; margin: 0 auto; } }

/* ---------- route / timeline layout ---------- */
.route { position: relative; padding: 2rem 0 1rem; }
.route-path { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); z-index: 0; }
.route-steps { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3rem; }
.route-step { display: grid; grid-template-columns: 1fr 60px 1fr; align-items: center; gap: 1rem; }
.route-step:nth-child(even) .route-step-card { grid-column: 3; }
.route-step:nth-child(even) .route-step-spacer { grid-column: 1; }
.route-step-card { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-card); }
.route-step-dot { width: 54px; height: 54px; border-radius: 50%; background: var(--sun); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; }
@media (max-width: 760px) {
  .route-step, .route-step:nth-child(even) .route-step-card, .route-step:nth-child(even) .route-step-spacer {
    grid-column: auto; grid-template-columns: 56px 1fr;
  }
  .route-step { grid-template-columns: 56px 1fr; }
  .route-path { left: 27px; }
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease, clip-path .6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }

/* ---------- cards ---------- */
.card { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-paper); overflow: hidden; }
.product-card { display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.product-card-media { aspect-ratio: 4/3; overflow: hidden; position: relative; border-bottom: 2px solid var(--ink); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-card-media img { transform: scale(1.07); }
.product-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.product-card-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sky-dark); font-weight: 700; }
.product-card-price { font-weight: 800; font-size: 1.15rem; }
.product-card-price .old { text-decoration: line-through; color: var(--ink-soft); font-weight: 400; font-size: .9rem; margin-right: .4em; }
.badge { display: inline-flex; align-self: flex-start; background: var(--sun); border: 1.5px solid var(--ink); border-radius: 999px; padding: .2em .7em; font-size: .72rem; font-weight: 700; }

/* ---------- product strip (mobile scroll-snap) ---------- */
.product-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.4rem; }
@media (max-width: 700px) {
  .product-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; padding-bottom: .5rem; }
  .product-strip .product-card { min-width: 72vw; scroll-snap-align: start; }
}

/* ---------- school basket feature ---------- */
.school-basket { background: var(--sky-pale); border: 2px solid var(--ink); border-radius: var(--radius); padding: 2rem; position: relative; }
.sb-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.sb-controls select { font-size: 1rem; padding: .6em 1em; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--white); accent-color: var(--sky); }
.sb-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .6rem; }
.sb-item label { display: flex; align-items: center; gap: .6rem; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .6em .9em; }
.sb-item input { accent-color: var(--sky); width: 18px; height: 18px; }
.sb-item em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--sky-dark); }
.sb-empty { color: var(--ink-soft); font-style: italic; }

/* ---------- dividers / decorative ---------- */
.divider-tape { width: 100%; height: 26px; }
.footer-wave { width: 100%; height: 40px; display: block; }

/* ---------- inner-page components ---------- */
.page-hero { background: var(--sky-pale); border-bottom: 3px solid var(--ink); padding: 3rem 0 2.4rem; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero p { max-width: 60ch; color: var(--ink-soft); font-size: 1.05rem; }

.breadcrumbs { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; color: var(--ink-soft); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .4rem; }
.breadcrumbs a { color: var(--sky-dark); }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.4em; font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }

.legal-toc { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 2rem; max-width: 40ch; }
.legal-toc h2 { font-size: 1.05rem; margin-top: 0; }
.legal-toc ol { padding-left: 1.2em; margin: 0; }

.notice { border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 1rem 1.2rem; background: var(--sun); margin: 1.5rem 0; }
.notice-info { background: var(--sky-pale); }
.notice-success { background: #dff3e4; }
.notice-error { background: #fbe1df; }

.faq-item { border: 2px solid var(--ink); border-radius: var(--radius-sm); margin-bottom: .8rem; background: var(--white); overflow: hidden; }
.faq-item summary { padding: 1em 1.2em; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer { padding: 0 1.2em 1.1em; color: var(--ink-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea, .field select {
  font: inherit; padding: .7em .9em; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); accent-color: var(--sky); min-height: 44px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--sky); }
.field textarea { min-height: 120px; resize: vertical; }
.field-error { color: #b23b2e; font-size: .85rem; min-height: 1.1em; }
.form-msg { font-weight: 600; min-height: 1.3em; }
.form-msg.is-success { color: #1f7a3f; }
.form-msg.is-error { color: #b23b2e; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- contact layout ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 880px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-info-card { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.6rem; }
.contact-info-card .info-row { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1rem; }

/* ---------- product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 880px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail-media { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; }
.product-detail-media img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info .price { font-size: 1.8rem; font-weight: 800; color: var(--sky-dark); }
.qty-input { width: 80px; }

/* ---------- cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.cart-table th, .cart-table td { padding: .9em .6em; border-bottom: 1.5px solid var(--line); text-align: left; vertical-align: middle; }
.cart-table img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1.5px solid var(--line); }
.cart-summary { background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.4rem; max-width: 360px; margin-left: auto; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: .6em; }
.cart-summary .total { font-weight: 800; font-size: 1.2rem; border-top: 1.5px solid var(--line); padding-top: .6em; }

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 560px; margin: 0 auto;
  background: var(--ink); color: var(--white); border-radius: var(--radius); padding: 1.2rem 1.4rem;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-card); z-index: 150;
}
.cookie-banner a { color: var(--sun); }
.cookie-banner .btn-ghost { color: var(--white); border-color: var(--white); }
.cookie-actions { display: flex; gap: .6rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--paper-dark); border-top: 3px solid var(--ink); position: relative; padding-top: 4px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem; display: grid; grid-template-columns: 1.2fr 2fr 1fr; gap: 2.5rem; }
@media (max-width: 880px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 600px) { .footer-links { grid-template-columns: 1fr 1fr; } }
.footer-links h3 { font-size: .95rem; margin-bottom: .6em; }
.footer-links ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5em; }
.footer-contact { display: flex; align-items: center; gap: .5em; font-size: .92rem; }
.newsletter-form .field { flex-direction: row; }
.newsletter-form input[type=email] { flex: 1; }
.footer-bottom { text-align: center; padding: 1rem; font-size: .85rem; color: var(--ink-soft); border-top: 1.5px solid var(--line); }

/* ---------- 404 ---------- */
.page-404 { text-align: center; padding: 5rem 1rem; }
.page-404 h1 { font-size: clamp(3rem, 10vw, 6rem); }

/* COMPONENTS:
.container - centered max-width content wrapper
.section / .section-sm - vertical page padding blocks
.grid / .grid-2 / .grid-3 / .grid-4 - responsive grid helpers
.u-mt-0/1/2/3, .u-mb-0 - spacing utilities
.site-header / .header-inner - sticky top navigation bar
.logo / .logo-mark / .logo-word - brand lockup
.nav-toggle - mobile hamburger button
.main-nav - primary navigation (desktop + off-canvas mobile)
.cart-link / .cart-count - header cart indicator (bump on add)
.btn / .btn-sun / .btn-sky / .btn-ghost / .btn-lg / .btn-block - button variants with fill-sweep hover
.hero / .hero-inner / .hero-title / .hero-lede / .hero-art / .hero-layer / .hero-cta - home hero with paper-layer motion
.route / .route-path / .route-steps / .route-step / .route-step-card / .route-step-dot - winding timeline layout
.reveal / .in-view - scroll-reveal animation hook
.card - generic bordered surface
.product-card / .product-card-media / .product-card-body / .product-card-cat / .product-card-price / .badge - product tile
.product-strip - responsive grid / mobile scroll-snap row of product cards
.school-basket / .sb-controls / .sb-list / .sb-item - signature School Basket feature
.divider-tape / .footer-wave - decorative SVG dividers
.page-hero - inner page intro banner
.breadcrumbs - breadcrumb trail
.prose - readable long-form legal/article text
.legal-toc - table of contents box for legal pages
.notice / .notice-info / .notice-success / .notice-error - callout boxes
.faq / .faq-item - accordion FAQ (details/summary)
.form-grid / .field / .field-error / .form-msg / .hp-field - form layout and feedback
.contact-layout / .contact-info-card - contact page two-column layout
.product-detail / .product-detail-media / .product-detail-info / .qty-input - product detail page
.cart-table / .cart-summary - cart & checkout tables
.cookie-banner / .cookie-actions - cookie consent banner
.site-footer / .footer-inner / .footer-links / .footer-contact / .newsletter-form / .footer-bottom - site footer
.page-404 - not-found page layout
.woodgrain-bg / .pegboard-bg / .grain-overlay - maker-workshop texture helpers
.visually-hidden / .skip-link - accessibility helpers
*/

/* ---------- footer brand section ---------- */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.footer-logo strong {
  color: var(--sky-dark);
}

/* ---------- quantity update input ---------- */
.qty-update {
  font: inherit;
  padding: 0.7em 0.9em;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  width: 70px;
  text-align: center;
  min-height: 44px;
  cursor: pointer;
}
.qty-update:focus {
  border-color: var(--sky);
  outline: none;
}
