/* Klavirska šola Akord — Moroccan-riad inspired design system */

:root {
  --stone-50: #f6f2e8;
  --stone-100: #eee6d4;
  --stone-200: #ddcfae;
  --paper: #fbf7ec;
  --ink: #241f19;
  --moss-900: #1d2418;
  --moss-800: #273420;
  --moss-700: #38492c;
  --moss-500: #536b3f;
  --lichen-400: #9db184;
  --lichen-300: #c3d1ac;
  --saffron-500: #d98f33;
  --saffron-600: #bd7322;
  --indigo-600: #2d3a5e;
  --indigo-700: #1f2a47;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", "Avenir Next", Calibri, Helvetica, Arial, sans-serif;
  --font-label: "Consolas", "SF Mono", "Courier New", monospace;

  --radius-arch: 2rem;
  --shadow-soft: 0 1.2rem 2.5rem -1.2rem rgba(29, 36, 24, 0.45);
  --shadow-card: 0 0.6rem 1.6rem -0.6rem rgba(29, 36, 24, 0.35);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 .5em;
  line-height: 1.12;
  color: var(--moss-900);
}

h2 { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

.container {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

/* ---------- focus & motion ---------- */
:focus-visible {
  outline: 3px solid var(--saffron-500);
  outline-offset: 3px;
  border-radius: .2em;
}

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

/* ---------- reveal ---------- */
.reveal { opacity: 1; transform: none; }
.reveal.js-hidden { opacity: 0; transform: translateY(26px); clip-path: inset(0 0 18% 0); }
.reveal.in-view { opacity: 1; transform: none; clip-path: inset(0 0 0 0); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out), clip-path .7s var(--ease-out); }

/* ---------- icon sprite ---------- */
.icon { width: 1.3em; height: 1.3em; stroke: currentColor; fill: none; stroke-width: 1.7; vertical-align: -0.25em; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .8em 1.6em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  border: 1.5px solid currentColor;
  cursor: pointer;
  background: transparent;
  color: var(--moss-900);
  overflow: hidden;
  isolation: isolate;
  min-height: 44px;
  transition: color .4s var(--ease-out), border-color .4s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -100%;
  width: 100%;
  background: var(--moss-900);
  z-index: -1;
  transition: left .4s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { left: 0; }
.btn:hover, .btn:focus-visible { color: var(--paper); }

.btn--solid { background: var(--moss-900); color: var(--paper); border-color: var(--moss-900); }
.btn--solid::before { background: var(--saffron-500); }
.btn--solid:hover { color: var(--moss-900); }

.btn--saffron { background: var(--saffron-500); color: var(--moss-900); border-color: var(--saffron-500); }
.btn--saffron::before { background: var(--moss-900); }
.btn--saffron:hover { color: var(--paper); }

.btn--ghost-dark { color: var(--stone-50); border-color: rgba(246,242,232,.55); }
.btn--ghost-dark::before { background: var(--stone-50); }
.btn--ghost-dark:hover { color: var(--moss-900); }

.btn--small { padding: .5em 1.1em; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 242, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stone-200);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); }
.brand__mark { width: 42px; height: 42px; flex-shrink: 0; }
.brand__word { width: 160px; height: 34px; color: var(--moss-900); }

.nav-main { display: flex; align-items: center; gap: 1.6rem; }
.nav-main a {
  position: relative;
  font-size: .95rem;
  font-weight: 600;
  padding: .3em 0;
}
.nav-main a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--saffron-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.nav-main a:hover::after, .nav-main a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: .9rem; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: .4em; font-weight: 600; min-height: 44px; }
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 .3em;
  border-radius: 999px;
  background: var(--saffron-500);
  color: var(--moss-900);
  font-family: var(--font-label);
  font-size: .72rem;
  font-weight: 700;
}
.cart-count.bump { animation: bump .45s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: none; border: 1.5px solid var(--moss-900);
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-main {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--moss-900);
    color: var(--stone-50);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem 2.2rem;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .4s var(--ease-out), visibility .4s;
    z-index: 50;
  }
  .nav-main.is-open { transform: translateX(0); visibility: visible; }
  .nav-main a { color: var(--stone-50); font-size: 1.1rem; }
  body:has(.nav-main.is-open) { overflow: hidden; }
  body:has(.nav-main.is-open)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(29, 36, 24, .45);
    z-index: 45;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--moss-900), var(--moss-800));
  color: var(--stone-50);
  padding: clamp(3rem, 4vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero__pattern {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: .22;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }

.hero__eyebrow {
  font-family: var(--font-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--lichen-300);
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-bottom: 1em;
}

.hero__title {
  font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem);
  margin-bottom: .5em;
  color: var(--stone-50);
}
.hero__title span {
  display: block;
  clip-path: inset(0 100% 0 0);
  animation: wipe-in 1.1s var(--ease-out) forwards;
}
.hero__title span:nth-child(2) { animation-delay: .28s; color: var(--saffron-500); }
@keyframes wipe-in { to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .hero__title span { clip-path: inset(0 0 0 0); animation: none; } }

.hero__lede { font-size: 1.1rem; max-width: 34em; color: var(--stone-100); }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }

.hero__art { position: relative; aspect-ratio: 4/5; }
.hero__arch {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero__photo {
  position: absolute;
  left: 8%; right: 8%; top: 14%; bottom: 0;
  width: 84%; height: 86%;
  object-fit: cover;
  clip-path: url(#hero-arch-clip);
  filter: sepia(.12) saturate(1.05);
}
.hero__float {
  position: absolute;
  top: -6%; right: -8%;
  width: 34%;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .hero__float { animation: none; } }

/* ---------- parallax layers (home composition) ---------- */
.depth-section { position: relative; overflow: hidden; }
.depth-layer { position: absolute; inset: 0; pointer-events: none; }
.depth-layer--back { opacity: .5; }
[data-parallax] { will-change: transform; }

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 6vw, 6rem) 0; }
.section--moss { background: var(--moss-900); color: var(--stone-50); }
.section--moss h2, .section--moss h3 { color: var(--stone-50); }
.section--moss .lede { color: var(--stone-200); }
.section--stone { background: var(--stone-100); }

.section-head { max-width: 46em; margin-bottom: 2.4rem; }
.section-head__tag {
  font-family: var(--font-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--saffron-600);
  display: block;
  margin-bottom: .6em;
}
.section--moss .section-head__tag { color: var(--saffron-500); }

.divider { display: block; width: 100%; height: auto; color: var(--moss-500); }
.divider--on-moss { color: var(--lichen-400); }

/* ---------- feature keyboard ---------- */
.feature {
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-arch);
  padding: clamp(1.6rem, 3vw, 2.6rem);
  box-shadow: var(--shadow-soft);
  position: relative;
}
.feature__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2.4rem; align-items: center; }
@media (max-width: 860px) { .feature__grid { grid-template-columns: 1fr; } }

.keyboard {
  display: flex;
  position: relative;
  height: 180px;
  background: var(--moss-900);
  border-radius: 1.1rem;
  padding: .6rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  touch-action: none;
}
.keyboard__key {
  position: relative;
  flex: 1;
  margin: 0 2px;
  background: var(--stone-50);
  border: none;
  border-radius: 0 0 .5rem .5rem;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: .5rem;
  font-family: var(--font-label);
  font-size: .72rem;
  color: var(--moss-700);
  transition: background .15s, transform .1s;
  min-height: 44px;
}
.keyboard__key:hover { background: var(--lichen-300); }
.keyboard__key.is-active, .keyboard__key:active { background: var(--saffron-500); transform: translateY(2px); }
.keyboard__key--sharp {
  position: absolute;
  top: .6rem;
  width: 7%;
  height: 58%;
  background: var(--ink);
  color: var(--stone-50);
  border-radius: 0 0 .35rem .35rem;
  z-index: 2;
  margin: 0;
  flex: none;
}
.keyboard__key--sharp:hover { background: var(--moss-700); }
.keyboard__key--sharp.is-active { background: var(--saffron-600); color: var(--ink); }
.keyboard__hint { font-size: .85rem; color: var(--moss-700); margin-top: .9rem; }
.keyboard__note { font-family: var(--font-label); font-size: .85rem; color: var(--saffron-600); min-height: 1.4em; display: block; }

/* ---------- product strip & cards ---------- */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(280px, 78vw);
  gap: 1.4rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
}
.strip .card { scroll-snap-align: start; }
@media (min-width: 1000px) {
  .strip { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: unset; overflow: visible; }
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.6rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--stone-200);
  border-radius: 1.4rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-soft); }
.card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.card:hover .card__media img { transform: scale(1.08); }
.card__tag {
  position: absolute; top: .8rem; left: .8rem;
  background: var(--saffron-500);
  color: var(--moss-900);
  font-family: var(--font-label);
  font-size: .72rem;
  padding: .25em .7em;
  border-radius: 999px;
}
.card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__price { font-family: var(--font-label); color: var(--moss-700); font-weight: 700; }
.card__meta { font-size: .82rem; color: var(--moss-500); }
.card__actions { margin-top: auto; display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- about / split sections ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split--reverse .split__media { order: 2; }
@media (max-width: 860px) { .split--reverse .split__media { order: 0; } }

.split__media { position: relative; }
.split__media img {
  width: 100%;
  aspect-ratio: 5/4;
  object-fit: cover;
  border-radius: var(--radius-arch) var(--radius-arch) .6rem .6rem;
}
.split__frame { position: absolute; inset: -14px; z-index: -1; color: var(--saffron-500); opacity: .5; }

.badge-seal { width: 92px; height: 92px; color: var(--saffron-500); }

/* ---------- lists ---------- */
.check-list { list-style: none; margin: 0 0 1.4em; padding: 0; display: grid; gap: .6em; }
.check-list li { display: flex; gap: .6em; align-items: flex-start; }
.check-list .icon { color: var(--saffron-600); flex-shrink: 0; margin-top: .15em; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 1.1rem; max-width: 620px; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea {
  font: inherit;
  padding: .75em .9em;
  border: 1.5px solid var(--stone-200);
  border-radius: .6rem;
  background: var(--paper);
  color: var(--ink);
  accent-color: var(--saffron-500);
  min-height: 44px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--moss-700); }
.field-error { color: #9a3b2a; font-size: .82rem; min-height: 1.2em; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { font-size: .85rem; color: var(--moss-500); }
.form-status { font-weight: 600; margin-top: .8rem; }
.form-status[data-state="ok"] { color: var(--moss-700); }
.form-status[data-state="error"] { color: #9a3b2a; }

.newsletter { display: flex; gap: .6rem; flex-wrap: wrap; max-width: 420px; }
.newsletter input { flex: 1; }

/* ---------- cart / cosarica ---------- */
.cart-table-scroll { overflow-x: auto; margin-bottom: 1.6rem; }
.cart-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.cart-table th, .cart-table td { text-align: left; padding: .8em .6em; border-bottom: 1px solid var(--stone-200); vertical-align: middle; }
.cart-table img { width: 64px; height: 64px; object-fit: cover; border-radius: .5rem; }
.qty-input { width: 3.6em; padding: .4em; border: 1.5px solid var(--stone-200); border-radius: .4rem; font: inherit; }
.cart-remove { background: none; border: none; color: #9a3b2a; cursor: pointer; font-weight: 600; min-height: 44px; }
.cart-total { font-size: 1.2rem; font-weight: 700; text-align: right; }
.cart-empty { padding: 2rem; text-align: center; color: var(--moss-500); }

/* ---------- faq ---------- */
.faq-item { border-bottom: 1px solid var(--stone-200); padding: 1.1em 0; }
.faq-item summary { font-weight: 700; cursor: pointer; font-family: var(--font-display); font-size: 1.05rem; display: flex; justify-content: space-between; gap: 1em; align-items: center; min-height: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item summary .icon { transition: transform .3s var(--ease-out); color: var(--saffron-600); }
.faq-item p { margin-top: .7em; color: var(--moss-700); }

/* ---------- legal pages ---------- */
.legal { max-width: 68ch; }
.legal h2 { margin-top: 1.6em; }

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 60;
  background: var(--moss-900);
  color: var(--stone-50);
  border-radius: 1.1rem;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 820px;
  margin-inline: auto;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .92rem; max-width: 46ch; }
.cookie-banner a { text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(4rem, 10vw, 7rem) 0; }
.notfound__mark { width: 140px; margin: 0 auto 1.4rem; color: var(--saffron-500); }

/* ---------- footer ---------- */
.site-footer { background: var(--moss-900); color: var(--stone-100); }
.site-footer__top { padding: clamp(2.6rem, 5vw, 4rem) 0 2rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .site-footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer__top { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--stone-50); font-size: 1rem; margin-bottom: .9em; }
.site-footer__brand .brand__word { color: var(--stone-50); }
.site-footer__brand p { color: var(--lichen-300); font-size: .92rem; max-width: 26em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55em; }
.site-footer a { color: var(--stone-100); font-size: .92rem; }
.site-footer a:hover { color: var(--saffron-500); }
.site-footer__bottom {
  border-top: 1px solid rgba(246,242,232,.15);
  padding: 1.2rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--lichen-300);
}

/* ---------- grain overlay ---------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: .05;
  mix-blend-mode: multiply;
}

/* ---------- utility ---------- */
.visually-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mt-lg { margin-top: 2.4rem; }
.text-center { text-align: center; }
.lede { font-size: 1.1rem; color: var(--moss-700); max-width: 42em; }
