/* Cajnapot — Zen garden tea shop style */

:root {
  --olive-900: #2f3324;
  --olive-700: #4a5235;
  --olive-600: #5f6a42;
  --olive-400: #8a9468;
  --mustard: #c69a3b;
  --mustard-dark: #a67d28;
  --brick: #a85c3c;
  --brick-dark: #8a4830;
  --cream: #f4efe2;
  --paper: #fbf7ee;
  --sand: #e9e1cc;
  --ink: #2c2a22;
  --ink-soft: #5c5748;
  --line: #d8cdae;
  --shadow: 0 10px 30px -12px rgba(44, 42, 34, 0.25);
  --radius: 18px;
  --ff-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ff-body: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  --ff-mono: "Courier New", ui-monospace, monospace;
  --maxw: 1180px;
  --dur: 0.6s;
}

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

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

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

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

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--olive-900);
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 600;
}

h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }

p { margin: 0 0 1em; }

a { color: var(--brick-dark); text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: clamp(3rem, 7vw, 6rem) 0; position: relative; }

::selection { background: var(--mustard); color: var(--olive-900); }

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

button { font-family: inherit; cursor: pointer; }

/* ---------- Icon sprite ---------- */
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; vertical-align: middle; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(251, 247, 238, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--olive-900);
}
.logo-mark { width: 42px; height: 42px; flex: none; }
.logo-word { width: 148px; height: 28px; flex: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.main-nav a {
  color: var(--olive-900);
  font-weight: 600;
  position: relative;
  padding: 0.3rem 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--brick);
  transition: right 0.3s ease;
}
.main-nav a:hover::after, .main-nav a:focus-visible::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 1rem; }

.cart-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--olive-900);
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brick);
  color: var(--paper);
  font-size: 0.75rem;
  transition: transform 0.25s;
}
.cart-count.bump { animation: bump 0.4s ease; }
@keyframes bump { 0%{transform:scale(1);} 40%{transform:scale(1.4);} 100%{transform:scale(1);} }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
}
.menu-toggle .icon { width: 28px; height: 28px; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    top: 76px; right: 0; bottom: 0;
    width: min(78vw, 320px);
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.6rem;
    padding: 2rem 1.6rem;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s;
    z-index: 290;
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
}

/* ---------- Mobile backdrop ---------- */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(44,42,34,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
  z-index: 280;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  border: 1.5px solid var(--olive-900);
  font-weight: 700;
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--olive-900);
  isolation: isolate;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  left: -100%;
  width: 100%;
  background: var(--olive-900);
  transition: left 0.35s ease;
  z-index: -1;
}
.btn:hover::before, .btn:focus-visible::before { left: 0; }
.btn:hover, .btn:focus-visible { color: var(--paper); }

.btn-primary {
  background: var(--brick);
  border-color: var(--brick);
  color: var(--paper);
}
.btn-primary::before { background: var(--brick-dark); }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--paper); }

.btn-ghost-dark {
  border-color: var(--cream);
  color: var(--cream);
}
.btn-ghost-dark::before { background: var(--cream); }
.btn-ghost-dark:hover, .btn-ghost-dark:focus-visible { color: var(--olive-900); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 340px; }
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 760px) {
  .split-grid { grid-template-columns: 1fr; }
}
.hero-blob {
  position: absolute;
  top: -10%;
  right: -8%;
  width: 640px;
  height: 640px;
  z-index: 0;
  opacity: 0.55;
}
.hero-blob path { fill: var(--mustard); }

.hero-copy { position: relative; z-index: 2; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--brick-dark);
  background: var(--sand);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--brick-dark); }
.hero-lead { max-width: 480px; font-size: 1.1rem; color: var(--ink-soft); }
.hero-ctas { display: flex; gap: 1rem; margin-top: 1.8rem; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  z-index: 1;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin: 0 auto;
}
.hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 10px solid var(--paper);
}
.hero-ring img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-orbit {
  position: absolute;
  inset: -36px;
  z-index: -1;
  animation: spin 50s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .hero-orbit { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sand divider ---------- */
.divider {
  width: 100%;
  height: auto;
  display: block;
  color: var(--olive-400);
}
.divider path { stroke: currentColor; }

/* ---------- Sections generic ---------- */
.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-head .kicker {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--brick-dark);
}

.band {
  background: var(--olive-900);
  color: var(--cream);
}
.band h2, .band h3 { color: var(--cream); }
.band .section-head .kicker { color: var(--mustard); }

/* ---------- Category / feature grid ---------- */
.grid-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}
.cat-card {
  position: relative;
  padding: 1.6rem 1.4rem;
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--line);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.cat-card .icon { width: 34px; height: 34px; color: var(--brick); margin-bottom: 0.8rem; }

/* ---------- Product grid / strip ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.6rem;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.product-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--sand); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-thumb img { transform: scale(1.08); }
.product-body { padding: 1.1rem 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.product-cat { font-family: var(--ff-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brick-dark); }
.product-body h3 { margin: 0; font-size: 1.15rem; }
.product-body p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; flex: 1; }
.product-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.6rem; gap: 0.6rem; }
.price { font-weight: 700; color: var(--olive-900); font-size: 1.05rem; }

.strip-scroll {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x mandatory;
}
.strip-scroll .product-card { min-width: 230px; scroll-snap-align: start; }
@media (min-width: 760px) {
  .strip-scroll { overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); }
}

/* filters */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.filter-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.filter-btn[aria-pressed="true"] { background: var(--olive-900); color: var(--paper); border-color: var(--olive-900); }

/* ---------- Tea Compass feature ---------- */
.compass {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--cream);
  border-radius: 28px;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--line);
}
@media (max-width: 760px) { .compass { grid-template-columns: 1fr; } }
.compass-select { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.2rem; }
.compass-select label { color: var(--ink); }
.compass .btn-ghost-dark { border-color: var(--olive-900); color: var(--olive-900); }
.compass .btn-ghost-dark::before { background: var(--olive-900); }
.compass .btn-ghost-dark:hover, .compass .btn-ghost-dark:focus-visible { color: var(--cream); }
.compass-select select {
  font-family: var(--ff-body);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  accent-color: var(--brick);
}
.compass-facts { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; }
.compass-fact { font-family: var(--ff-mono); font-size: 0.85rem; color: var(--ink-soft); }
.compass-fact strong { display: block; font-family: var(--ff-display); font-size: 1.4rem; color: var(--olive-900); }

.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.timer-ring { width: 220px; height: 220px; }
.timer-ring circle.track { stroke: var(--sand); fill: none; stroke-width: 10; }
.timer-ring circle.progress {
  stroke: var(--brick);
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s linear;
}
.timer-label {
  font-family: var(--ff-mono);
  font-size: 2rem;
  fill: var(--olive-900);
  text-anchor: middle;
  dominant-baseline: middle;
}
.timer-controls { display: flex; gap: 0.7rem; }
.timer-controls .btn { padding: 0.6rem 1.3rem; }
.timer-status { font-size: 0.9rem; color: var(--ink-soft); min-height: 1.4em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--olive-900);
  color: var(--cream);
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--mustard); font-family: var(--ff-body); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.site-footer a { color: var(--cream); opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-logo { color: var(--cream); margin-bottom: 1rem; }
.footer-brand p { color: var(--cream); opacity: 0.75; max-width: 320px; }

.newsletter-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.newsletter-form input[type=email] {
  flex: 1;
  min-width: 160px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(244,239,226,0.4);
  background: rgba(244,239,226,0.08);
  color: var(--cream);
}
.newsletter-form input::placeholder { color: rgba(244,239,226,0.6); }

.footer-bottom {
  border-top: 1px solid rgba(244,239,226,0.2);
  padding-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

.form-note { font-size: 0.8rem; opacity: 0.7; margin-top: 0.5rem; }
.form-success { color: var(--mustard); font-weight: 700; margin-top: 0.6rem; }

/* ---------- Forms (general) ---------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  accent-color: var(--brick);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:invalid:not(:placeholder-shown) { border-color: var(--brick); }
.error-msg { color: var(--brick-dark); font-size: 0.85rem; min-height: 1.2em; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.card-panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.js-hidden {
  opacity: 0;
  transform: translateY(26px);
  clip-path: inset(0 0 15% 0);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  transition: opacity var(--dur) ease, transform var(--dur) ease, clip-path var(--dur) ease;
}
.reveal.d1.in-view { transition-delay: 0.08s; }
.reveal.d2.in-view { transition-delay: 0.16s; }
.reveal.d3.in-view { transition-delay: 0.24s; }
.reveal.d4.in-view { transition-delay: 0.32s; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 640px;
  margin: 0 auto;
  background: var(--olive-900);
  color: var(--cream);
  border: 1px solid rgba(244, 239, 226, 0.35);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
  z-index: 400;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  transform: translateY(140%);
  transition: transform 0.4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1 1 260px; }
.cookie-banner a { text-decoration: underline; color: var(--mustard); }
@media (min-width: 760px) {
  .cookie-banner { left: auto; right: 1.5rem; max-width: 420px; }
}
.cookie-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- Breadcrumb / page hero ---------- */
.page-hero {
  padding: 3rem 0 2rem;
  position: relative;
}
.page-hero .kicker {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--brick-dark);
}
.page-hero p.lead { max-width: 620px; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Legal pages ---------- */
.legal-content { max-width: 720px; }
.legal-content h2 { margin-top: 2rem; font-size: 1.4rem; }
.legal-content ul { padding-left: 1.2rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; display: flex; flex-direction: column; gap: 0.8rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
  overflow: hidden;
}
.faq-item summary {
  padding: 1.1rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { flex: none; transition: transform 0.3s; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }

/* ---------- Product detail page ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }
.product-photo {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 1/1;
  box-shadow: var(--shadow);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.qty-row { display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0; }
.qty-row input {
  width: 64px;
  padding: 0.6rem;
  text-align: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
}
.brew-box {
  margin-top: 1.6rem;
  padding: 1.2rem 1.4rem;
  background: var(--cream);
  border-radius: 16px;
  border: 1px solid var(--line);
}
.brew-box dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0.6rem 0 0; }
.brew-box dt { font-weight: 700; color: var(--olive-900); }
.brew-box dd { margin: 0; color: var(--ink-soft); }

/* ---------- Cart page ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.6rem; }
.cart-table th { text-align: left; font-family: var(--ff-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 0.9rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-item-name { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; }
.cart-item-name img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.cart-qty { width: 56px; padding: 0.4rem; text-align: center; border-radius: 8px; border: 1px solid var(--line); }
.remove-btn { background: none; border: none; color: var(--brick-dark); font-weight: 700; text-decoration: underline; }
.cart-total-row { display: flex; justify-content: flex-end; gap: 1rem; font-size: 1.2rem; font-weight: 700; margin: 1rem 0 2rem; }
.empty-cart { padding: 2rem; text-align: center; color: var(--ink-soft); }
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 6rem 0; }
.notfound svg { width: 220px; margin: 0 auto 1.5rem; }

/* ---------- utility ---------- */
.mt-lg { margin-top: 2.5rem; }
.center { text-align: center; }
.badge-seal { width: 110px; height: 110px; color: var(--brick); }
