/* Barista Zarja — Gothic-revival dawn theme */

:root{
  --plum:#2b1626;
  --plum-deep:#190d18;
  --sky:#6fc6e8;
  --sky-deep:#2f87ad;
  --sun:#ffb400;
  --sun-light:#ffd666;
  --cream:#fff8ec;
  --candle:#e8973a;
  --ink:#241420;
  --line:rgba(43,22,38,.16);
  --radius:18px;
  --maxw:1180px;
  --ff-display:"Iowan Old Style","Palatino Linotype",Georgia,"Times New Roman",serif;
  --ff-body:"Segoe UI","Century Gothic",Verdana,system-ui,sans-serif;
  --ff-mono:"Consolas","SF Mono",monospace;
  --shadow:0 18px 40px -20px rgba(25,13,24,.45);
}

*{box-sizing:border-box}
html,body{overflow-x:clip}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--ff-body);
  color:var(--ink);
  background:var(--cream);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
h1,h2,h3{font-family:var(--ff-display);margin:0 0 .5em;line-height:1.1;font-weight:600}
h1{font-size:clamp(2.4rem,6vw+1rem,4.6rem)}
h2{font-size:clamp(1.8rem,3vw+1rem,2.6rem)}
h3{font-size:clamp(1.2rem,1.4vw+1rem,1.5rem)}
p{margin:0 0 1em}
a{color:inherit;text-decoration:none}
ul{margin:0;padding:0;list-style:none}
button{font-family:inherit}
:focus-visible{outline:3px solid var(--sun);outline-offset:2px;border-radius:4px}

.container{max-width:var(--maxw);margin-inline:auto;padding-inline:clamp(1.1rem,4vw,2.5rem)}
.visually-hidden{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.hp{tabindex:-1;position:absolute !important;left:-9999px;width:1px;height:1px;overflow:hidden}

/* ---------- icon sprite ---------- */
.icon{width:1.3em;height:1.3em;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}

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

/* ---------- header ---------- */
.site-header{
  position:sticky;top:0;z-index:900;
  background:var(--cream);
  border-bottom:1px solid var(--line);
}
.site-header .container{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:76px}
.brand{display:flex;align-items:center;gap:.6rem;font-family:var(--ff-display);font-size:1.3rem;color:var(--plum)}
.brand svg{width:40px;height:44px}
.main-nav{display:flex;gap:1.6rem}
.main-nav a{position:relative;font-weight:600;padding:.3rem 0;color:var(--plum)}
.main-nav a::after{content:"";position:absolute;left:0;bottom:-2px;width:0;height:2px;background:var(--sun);transition:width .3s ease}
.main-nav a:hover::after,.main-nav a[aria-current="page"]::after{width:100%}
.header-actions{display:flex;align-items:center;gap:1rem}
.cart-link{position:relative;display:inline-flex;align-items:center;gap:.4rem;font-weight:700;color:var(--plum)}
.cart-count{
  background:var(--sun);color:var(--plum-deep);min-width:22px;height:22px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800;padding:0 4px;
  transition:transform .35s cubic-bezier(.34,1.56,.64,1);
}
.cart-count.bump{transform:scale(1.5) rotate(-8deg)}
.menu-toggle{display:none;background:none;border:none;color:var(--plum);cursor:pointer;padding:.4rem}
.menu-toggle .icon{width:1.7em;height:1.7em}

@media (max-width:860px){
  .main-nav{
    position:fixed;inset:0 0 0 auto;width:min(78vw,320px);
    background:var(--plum);padding:6rem 1.6rem 2rem;
    flex-direction:column;gap:1.3rem;
    transform:translateX(100%);visibility:hidden;
    transition:transform .35s ease, visibility .35s ease;
    z-index:950;
  }
  .main-nav a{color:var(--cream)}
  .main-nav a::after{background:var(--sun)}
  .main-nav.open{transform:translateX(0);visibility:visible}
  .menu-toggle{display:inline-flex}
  .nav-backdrop{position:fixed;inset:0;background:rgba(25,13,24,.5);opacity:0;pointer-events:none;transition:opacity .35s ease;z-index:940}
  .nav-backdrop.open{opacity:1;pointer-events:auto}
}

/* ---------- buttons ---------- */
.btn{
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.85rem 1.6rem;border-radius:999px;font-weight:700;border:2px solid var(--plum);
  background:var(--plum);color:var(--cream);overflow:hidden;cursor:pointer;z-index:0;
  min-height:44px;
}
.btn::before{
  content:"";position:absolute;inset:0;left:-100%;width:100%;background:var(--sun);
  transition:left .35s ease;z-index:-1;
}
.btn:hover::before,.btn:focus-visible::before{left:0}
.btn:hover,.btn:focus-visible{color:var(--plum-deep)}
.btn-ghost{background:transparent;color:var(--plum)}
.btn-ghost::before{background:var(--plum)}
.btn-ghost:hover,.btn-ghost:focus-visible{color:var(--cream)}
.btn-sun{background:var(--sun);border-color:var(--sun);color:var(--plum-deep)}
.btn-sun::before{background:var(--plum)}
.btn-sun:hover,.btn-sun:focus-visible{color:var(--cream)}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn[disabled]::before{display:none}

/* ---------- hero split ---------- */
.hero{position:relative;overflow:hidden;background:var(--sky)}
.split{position:relative;min-height:min(86vh,760px);display:grid}
.split-layer{position:absolute;inset:0;display:flex;align-items:center}
.split-day{background:linear-gradient(180deg,var(--sky) 0%,#bfe6f5 100%);z-index:1}
.split-night{
  background:linear-gradient(180deg,var(--plum-deep) 0%,var(--plum) 100%);
  clip-path:inset(0 0 0 var(--split,52%));z-index:2;
}
.split-content{position:relative;z-index:3;width:100%}
.split-content .container{display:grid;grid-template-columns:1.1fr .9fr;gap:2rem;align-items:center}
.split .eyebrow{font-family:var(--ff-mono);letter-spacing:.14em;text-transform:uppercase;font-size:.78rem;color:var(--plum-deep)}
.split-night-text{color:var(--cream)}
.hero-copy{max-width:36ch}
.hero-copy p{max-width:40ch}
.hero-art{display:flex;justify-content:center}
.hero-art svg{width:100%;max-width:420px;height:auto}

.divider-handle{
  position:absolute;top:0;bottom:0;left:var(--split,52%);width:52px;transform:translateX(-26px);
  z-index:5;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;
}
.divider-handle::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:3px;background:var(--sun);transform:translateX(-50%)}
.divider-handle .grip{
  width:46px;height:46px;border-radius:50%;background:var(--sun);display:flex;align-items:center;justify-content:center;
  box-shadow:var(--shadow);border:3px solid var(--cream);
}
.divider-handle .grip .icon{width:1.3em;height:1.3em;color:var(--plum-deep)}
.divider-hint{
  position:absolute;bottom:1.4rem;left:50%;transform:translateX(-50%);z-index:5;color:var(--plum-deep);
  font-family:var(--ff-mono);font-size:.78rem;background:rgba(255,248,236,.75);padding:.4rem .9rem;border-radius:999px;
}

.underline-word{position:relative;display:inline-block}
.underline-word svg{position:absolute;left:0;bottom:-.14em;width:100%;height:.4em;overflow:visible}
.underline-word path{stroke:var(--sun);stroke-width:7;fill:none;stroke-linecap:round;stroke-dasharray:240;stroke-dashoffset:240;transition:stroke-dashoffset 1s cubic-bezier(.3,.8,.3,1) .2s}
.underline-word.draw path{stroke-dashoffset:0}
.split-night-text .underline-word path{stroke:var(--sun)}

/* continuous subtle motion: rising steam on hero cup */
.steam-line{animation:steamRise 4s ease-in-out infinite;transform-origin:center}
.steam-line:nth-child(2){animation-delay:.6s}
.steam-line:nth-child(3){animation-delay:1.2s}
@keyframes steamRise{
  0%{opacity:0;transform:translateY(6px) scaleY(.8)}
  35%{opacity:.6}
  100%{opacity:0;transform:translateY(-14px) scaleY(1.1)}
}
@media (prefers-reduced-motion:reduce){
  .steam-line{animation:none;opacity:.4}
}

/* ---------- section basics ---------- */
section{padding:clamp(3rem,7vw,6rem) 0}
.section-head{max-width:60ch;margin-bottom:2.4rem}
.section-head .eyebrow{display:block;font-family:var(--ff-mono);letter-spacing:.14em;text-transform:uppercase;font-size:.78rem;color:var(--sky-deep);margin-bottom:.6rem}

.arch-divider{display:block;width:100%;height:auto;color:var(--plum)}
.arch-divider.flip{transform:scaleY(-1)}

/* ---------- reveal ---------- */
.reveal{opacity:1;transform:none}
.js .reveal{opacity:0;transform:translateY(28px)}
.js .reveal.in-view{opacity:1;transform:translateY(0);transition:opacity .7s ease,transform .7s cubic-bezier(.25,.8,.3,1)}
@media (prefers-reduced-motion:reduce){
  .js .reveal{opacity:1;transform:none;transition:none}
}

/* ---------- about / story ---------- */
.story{background:var(--plum);color:var(--cream);position:relative;overflow:hidden}
.story .container{display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:center}
.story-art{position:relative}
.story-art svg{width:100%;height:auto}
.story-ornament{position:absolute;opacity:.5}

/* ---------- flavor wheel feature ---------- */
.wheel-feature{background:var(--cream)}
.wheel-grid{display:grid;grid-template-columns:.9fr 1.1fr;gap:3rem;align-items:start}
.wheel-wrap{position:relative;display:flex;justify-content:center}
.wheel-wrap svg{width:100%;max-width:360px;height:auto}
.wheel-seg{cursor:pointer;transition:transform .25s ease,opacity .25s ease;transform-origin:150px 150px}
.wheel-seg:hover,.wheel-seg:focus-visible{opacity:.85}
.wheel-seg.active{transform:scale(1.07)}
.wheel-seg text{pointer-events:none}
.wheel-hub{fill:var(--plum);stroke:var(--cream);stroke-width:3}
.wheel-result{
  background:var(--sky);border-radius:var(--radius);padding:1.6rem;min-height:220px;
}
.wheel-result h3{margin-bottom:.3rem}
.wheel-result .placeholder{color:var(--plum);opacity:.75}
.match-card{display:flex;gap:1rem;align-items:center;background:var(--cream);border-radius:14px;padding:1rem;margin-top:1rem}
.match-card img{width:72px;height:72px;border-radius:10px;object-fit:cover;flex-shrink:0}
.match-card .meta{flex:1}
.match-card .meta h4{margin:0 0 .2rem;font-family:var(--ff-display);font-size:1.05rem}
.match-card .price{font-weight:800;color:var(--sky-deep)}

/* ---------- course grid / strip ---------- */
.course-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1.6rem}
.course-card{
  background:var(--cream);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;
  display:flex;flex-direction:column;box-shadow:var(--shadow);transition:transform .35s ease,box-shadow .35s ease;
}
.course-card:hover{transform:translateY(-6px)}
.course-media{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--sky)}
.course-media img{width:100%;height:100%;object-fit:cover;transition:transform .5s ease}
.course-card:hover .course-media img{transform:scale(1.08)}
.course-arch{
  position:absolute;inset:0;
  -webkit-mask-image:radial-gradient(circle at 50% 120%,transparent 0 0);
}
.course-level{position:absolute;top:.7rem;left:.7rem;background:var(--sun);color:var(--plum-deep);font-size:.72rem;font-weight:800;padding:.3rem .7rem;border-radius:999px;text-transform:uppercase;letter-spacing:.04em}
.course-body{padding:1.2rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.course-body h3{margin:0}
.course-tagline{color:var(--sky-deep);font-weight:600;font-size:.92rem;margin:0}
.course-meta{display:flex;gap:1rem;font-size:.85rem;color:var(--plum);opacity:.8}
.course-meta span{display:inline-flex;align-items:center;gap:.3rem}
.course-foot{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:.6rem}
.price-tag{font-family:var(--ff-display);font-size:1.3rem;font-weight:700;color:var(--plum)}
.price-tag small{font-family:var(--ff-body);font-size:.7rem;font-weight:600;opacity:.7}

.strip-scroll{display:flex;gap:1.2rem;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:.6rem}
.strip-scroll .course-card{min-width:260px;scroll-snap-align:start}

/* ---------- filters ---------- */
.filter-bar{display:flex;gap:.7rem;flex-wrap:wrap;margin-bottom:1.6rem}
.filter-bar button{
  border:2px solid var(--plum);background:transparent;color:var(--plum);border-radius:999px;
  padding:.5rem 1.1rem;font-weight:700;cursor:pointer;min-height:44px;
}
.filter-bar button.active{background:var(--plum);color:var(--cream)}

/* ---------- product/course detail ---------- */
.detail{display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:start}
.detail-media{position:relative;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.detail-media img{width:100%;aspect-ratio:4/3;object-fit:cover}
.detail-badges{display:flex;gap:.8rem;margin:1rem 0}
.detail-badges span{display:inline-flex;align-items:center;gap:.4rem;font-size:.85rem;background:var(--sky);padding:.4rem .8rem;border-radius:999px}
.includes-list li{display:flex;gap:.6rem;align-items:flex-start;margin-bottom:.5rem}
.includes-list .icon{color:var(--sky-deep);margin-top:.15em}
.qty-row{display:flex;align-items:center;gap:1rem;margin:1.4rem 0}
.qty-box{display:flex;align-items:center;border:2px solid var(--plum);border-radius:999px;overflow:hidden}
.qty-box button{background:none;border:none;width:44px;height:44px;font-size:1.2rem;cursor:pointer;color:var(--plum)}
.qty-box input{width:3rem;text-align:center;border:none;font-weight:700;font-size:1rem}

/* ---------- cart / checkout ---------- */
.cart-table{width:100%;border-collapse:collapse;margin-bottom:1.6rem}
.cart-table th{text-align:left;font-family:var(--ff-mono);font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--plum);border-bottom:2px solid var(--plum);padding:.6rem}
.cart-table td{padding:.8rem .6rem;border-bottom:1px solid var(--line);vertical-align:middle}
.cart-item-name{display:flex;gap:.8rem;align-items:center;font-weight:700}
.cart-item-name img{width:56px;height:56px;border-radius:8px;object-fit:cover}
.cart-remove{background:none;border:none;color:var(--sky-deep);cursor:pointer;font-weight:700;text-decoration:underline;min-height:44px}
.cart-summary{background:var(--sky);border-radius:var(--radius);padding:1.6rem;max-width:380px;margin-left:auto}
.cart-summary .row{display:flex;justify-content:space-between;margin-bottom:.6rem}
.cart-summary .total{font-size:1.3rem;font-weight:800;border-top:2px solid var(--plum);padding-top:.8rem;margin-top:.6rem}
.cart-empty{text-align:center;padding:3rem 1rem}

.checkout-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:3rem;align-items:start;margin-top:2rem}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.form-grid .full{grid-column:1/-1}
.field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}
.field label{font-weight:700;font-size:.9rem}
.field input,.field select,.field textarea{
  border:2px solid var(--line);border-radius:10px;padding:.7rem .8rem;font-family:inherit;font-size:1rem;
  accent-color:var(--sun);background:var(--cream);color:var(--ink);
}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--sky-deep)}
.field.error input,.field.error select,.field.error textarea{border-color:#c23a3a}
.field .error-msg{color:#c23a3a;font-size:.82rem;display:none}
.field.error .error-msg{display:block}
.form-status{margin-top:1rem;padding:1rem;border-radius:10px;display:none}
.form-status.show{display:block}
.form-status.ok{background:#dff0e4;color:#245c35}
.form-status.fail{background:#fbe0e0;color:#8c2a2a}
fieldset{border:2px solid var(--line);border-radius:12px;margin:0 0 1rem;padding:1rem}
fieldset legend{font-weight:700;padding:0 .4rem;font-family:var(--ff-display)}
.radio-row{display:flex;gap:1.4rem;flex-wrap:wrap}
.radio-row label{display:flex;align-items:center;gap:.5rem;font-weight:600;cursor:pointer}

/* ---------- FAQ ---------- */
.faq-list details{border-bottom:1px solid var(--line);padding:1rem 0}
.faq-list summary{font-weight:700;font-family:var(--ff-display);font-size:1.1rem;cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:1rem;align-items:center}
.faq-list summary::-webkit-details-marker{display:none}
.faq-list summary .icon{transition:transform .3s ease;flex-shrink:0}
.faq-list details[open] summary .icon{transform:rotate(45deg)}
.faq-list .faq-a{padding-top:.7rem;max-width:68ch}

/* ---------- info cards (legal pages etc) ---------- */
.legal h2{margin-top:2rem}
.legal{max-width:72ch}
.info-card{background:var(--sky);border-radius:var(--radius);padding:1.6rem;margin-bottom:1.4rem}

/* ---------- seal / badge ---------- */
.seal{width:140px;height:140px}

/* ---------- newsletter / footer ---------- */
.site-footer{background:var(--plum-deep);color:var(--cream);padding-top:3rem}
.footer-top{display:grid;grid-template-columns:1.2fr 1fr 1fr 1.2fr;gap:2rem;padding-bottom:2rem;border-bottom:1px solid rgba(255,248,236,.15)}
.footer-brand .brand{color:var(--cream)}
.footer-brand p{opacity:.8;max-width:30ch;margin-top:.8rem}
.footer-col h4{font-family:var(--ff-display);margin-bottom:.9rem;color:var(--sun)}
.footer-col a{display:block;padding:.3rem 0;opacity:.85}
.footer-col a:hover{opacity:1;text-decoration:underline}
.newsletter-form{display:flex;gap:.5rem;margin-top:.8rem;flex-wrap:wrap}
.newsletter-form input{flex:1;min-width:160px;border-radius:999px;border:2px solid rgba(255,248,236,.3);background:transparent;color:var(--cream);padding:.6rem 1rem}
.newsletter-form input::placeholder{color:rgba(255,248,236,.6)}
.footer-bottom{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:1.4rem 0;font-size:.85rem;opacity:.75}
.footer-bottom a{text-decoration:underline}

/* ---------- cookie banner ---------- */
.cookie-banner{
  position:fixed;left:1rem;right:1rem;bottom:-200px;z-index:1100;max-width:620px;margin-inline:auto;
  background:var(--plum-deep);color:var(--cream);border-radius:var(--radius);padding:1.4rem 1.6rem;
  box-shadow:var(--shadow);display:none;gap:1rem;flex-wrap:wrap;align-items:center;justify-content:space-between;
  border:1px solid rgba(255,248,236,.15);transition:bottom .35s ease;
}
.cookie-banner.show{display:flex;bottom:1rem}
.cookie-banner p{margin:0;flex:1 1 260px;font-size:.92rem}
.cookie-actions{display:flex;gap:.7rem;flex-wrap:wrap}
.cookie-actions .btn-ghost{border-color:var(--cream);color:var(--cream)}
.cookie-actions .btn-ghost::before{background:var(--cream)}
.cookie-actions .btn-ghost:hover{color:var(--plum-deep)}

/* ---------- misc ---------- */
.breadcrumb{font-size:.85rem;opacity:.75;margin-bottom:1rem}
.breadcrumb a{text-decoration:underline}
.page-head{padding-top:3rem;padding-bottom:1rem}
.page-head p{max-width:60ch}
.toast-cart{display:flex;align-items:center;gap:.6rem}
.not-found{min-height:60vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:1rem;padding:4rem 1rem}
.not-found svg{width:min(60vw,260px)}
.pattern-strip{width:100%;height:28px;color:var(--sun)}

@media (max-width:900px){
  .split-content .container,.story .container,.wheel-grid,.detail,.checkout-grid{grid-template-columns:1fr}
  .footer-top{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  .footer-top{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .cart-summary{max-width:none}
}
