/* ============================================================
   KSHN — Components
   ============================================================ */

/* ---------------- Buttons ---------------- */
.btn {
  --bg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  letter-spacing: -.01em;
  padding: .92em 1.5em; border-radius: var(--r-pill);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease);
  white-space: nowrap; position: relative; isolation: isolate;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn-primary {
  color: #fff;
  background: var(--flavor, var(--sunset-warm));
  box-shadow: var(--sh-md);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.015); box-shadow: var(--sh-lg); filter: saturate(1.08); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-solid { color: #fff; background: var(--ink); box-shadow: var(--sh-sm); }
.btn-solid:hover { transform: translateY(-2px); background: #000; }
.btn-ghost {
  color: var(--ink); background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-on-dark { color: var(--ink); background: #fff; }
.btn-on-dark:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.btn-ghost-dark { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.btn-ghost-dark:hover { background: #fff; color: var(--ink); }
.btn-link {
  font-family: var(--display); font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: .4em;
  border-bottom: 2px solid transparent; padding-bottom: 2px; border-radius: 0;
}
.btn-link:hover { border-color: currentColor; gap: .65em; }
.btn-sm { padding: .6em 1.05em; font-size: .9rem; }
.btn-lg { padding: 1.05em 1.9em; font-size: 1.1rem; }

/* ---------------- Logo ---------------- */
.logo { display: inline-flex; align-items: center; gap: .55em; }
.logo .logo-img { display: none; height: 42px; width: auto; }
.logo.has-logo .logo-img { display: block; }
.logo.has-logo .logo-fallback { display: none; }
.logo.on-dark .logo-img { filter: brightness(0) invert(1); }
/* logo height stays constant on scroll — resizing it shifts the header (CLS) */
.logo .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sunset); flex: none;
  box-shadow: 0 0 0 3px var(--paper), 0 4px 14px -4px rgba(0,0,0,.4);
}
.logo .word { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.04em; color: var(--ink); }
.logo.on-dark .word { color: #fff; }
.logo.on-dark .mark { box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 4px 14px -4px rgba(0,0,0,.5); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header .bar {
  display: flex; align-items: center; gap: 1.2rem;
  padding-block: 1.1rem;
}
.site-header.scrolled {
  background: rgba(250,246,240,.82);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(0,0,0,.4);
}
/* header height is kept constant on scroll (only the background changes) so the
   sticky bar never resizes — resizing it shifts the whole page (CLS) */
.nav-main { display: flex; gap: .35rem; margin-inline: auto; }.nav-main a {
  font-family: var(--display); font-weight: 500; font-size: 1rem;
  padding: .5em .85em; border-radius: var(--r-pill); color: var(--ink);
  transition: background .2s, color .2s; position: relative;
}
.nav-main a:hover { background: rgba(0,0,0,.05); }
.nav-main a[aria-current="page"] { color: var(--crimson); }
.nav-main a[aria-current="page"]::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; translate: -50% 0;
  width: 5px; height: 5px; border-radius: 50%; background: var(--burnt);
}

/* state switcher */
.state-switch {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .5em .85em; border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 600; font-size: .92rem; background: #fff;
  transition: box-shadow .2s, transform .2s;
}
.state-switch:hover { box-shadow: inset 0 0 0 1.5px var(--burnt); transform: translateY(-1px); }
.state-switch .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--flavor, var(--sunset-warm)); }
.state-switch .chev { width: 14px; height: 14px; opacity: .5; }

.hamburger { display: none; width: 44px; height: 44px; border-radius: var(--r-sm); align-items: center; justify-content: center; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); position: relative; transition: .3s; }
.hamburger span::before, .hamburger span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--ink); transition: .3s; }
.hamburger span::before { top: -7px; } .hamburger span::after { top: 7px; }

/* mobile drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: 300; background: var(--paper);
  display: flex; flex-direction: column; padding: 1.1rem var(--pad-x) 2rem;
  transform: translateY(-100%); transition: transform .42s var(--ease); visibility: hidden;
}
.mobile-menu.open { transform: none; visibility: visible; }
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-menu .mm-close { width: 44px; height: 44px; font-size: 1.7rem; line-height: 1; }
.mobile-menu nav { display: flex; flex-direction: column; gap: .2rem; margin-top: 2rem; }
.mobile-menu nav a {
  font-family: var(--display); font-weight: 600; font-size: 2rem; letter-spacing: -.03em;
  padding: .35em 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
}
.mobile-menu nav a span { font-size: 1rem; opacity: .35; }
.mobile-menu .mm-state { margin-top: auto; padding-top: 1.4rem; }

/* ---------------- Flavor card ---------------- */
.flavor-card {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden; background: #fff;
  box-shadow: var(--sh-sm); border: 1px solid var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  position: relative; isolation: isolate;
}
.flavor-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); }
.flavor-card .fc-media {
  aspect-ratio: 1/1; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 14px, transparent 14px 28px),
    var(--fc-grad);
  display: grid; place-items: center;
}
.flavor-card .fc-media .ph-label { color: #fff; background: rgba(0,0,0,.22); }
.flavor-card .fc-tin {
  width: 56%; aspect-ratio: 1/1.05; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.8);
  display: grid; place-items: center; transition: transform .4s var(--ease);
}
.flavor-card:hover .fc-tin { transform: translateY(-4px) rotate(-2deg); }
.flavor-card .fc-tin b { font-family: var(--display); font-size: .8rem; letter-spacing: .02em; color: var(--ink); text-align: center; padding: .4em; }
.flavor-card .fc-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .45rem; }
.flavor-card .fc-fam { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); }
.flavor-card .fc-name { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; }
.flavor-card .fc-meta { display: flex; align-items: center; justify-content: space-between; margin-top: .2rem; }
.flavor-card .fc-mg { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.flavor-card .fc-go {
  position: absolute; top: .9rem; right: .9rem; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.85); display: grid; place-items: center; opacity: 0; transform: scale(.7);
  transition: .3s var(--ease); box-shadow: var(--sh-sm);
}
.flavor-card:hover .fc-go { opacity: 1; transform: none; }

/* ---------------- Benefit tiles ---------------- */
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .7rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.tile .ic {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--flavor-soft); color: var(--burnt);
}
.tile .ic svg { width: 26px; height: 26px; stroke-width: 1.6; }
.tile h4 { font-size: 1.12rem; }
.tile p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

/* quick strip */
.qstrip { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.qstrip .q { background: var(--paper); padding: 1.5rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.qstrip .q b { font-family: var(--display); font-size: 1.5rem; }
.qstrip .q span { font-size: .88rem; color: var(--ink-soft); }

/* ---------------- Dark section + cloud motif ---------------- */
.dark { background: var(--night); color: #fff; position: relative; overflow: hidden; }
.dark.charcoal { background: var(--charcoal); }
.dark .lead, .dark .muted { color: rgba(255,255,255,.72); }
.dark .eyebrow { color: var(--aqua); }
.cloud-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5; }
.cloud-bg .c {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(90,198,208,.5), transparent 70%);
  filter: blur(40px);
}
.dark .wrap, .dark .inner { position: relative; z-index: 1; }

/* ---------------- Forms / Newsletter ---------------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-weight: 600; font-size: .9rem; }
.input, .textarea, .selectbox {
  width: 100%; padding: .9em 1.05em; border-radius: var(--r-md);
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .2s, background .2s; color: var(--ink);
}
.input::placeholder, .textarea::placeholder { color: #b3a99a; }
.input:focus, .textarea:focus, .selectbox:focus { outline: none; box-shadow: inset 0 0 0 2px var(--burnt); }
.field.error .input, .field.error .textarea { box-shadow: inset 0 0 0 2px var(--crimson); background: #fff6f5; }
.field .err { color: var(--crimson); font-size: .82rem; font-weight: 600; display: none; }
.field.error .err { display: block; }
.textarea { resize: vertical; min-height: 130px; }

.newsletter {
  border-radius: var(--r-lg); padding: clamp(1.6rem, 4vw, 3rem);
  background: radial-gradient(130% 160% at 85% -20%, #1B5563 0%, var(--charcoal) 58%);
  color: #fff; position: relative; overflow: hidden; isolation: isolate;
}
/* Session Club variant: B/W lifestyle photo under an ink duotone scrim */
.newsletter .nl-bg {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; filter: grayscale(1);
}
@media (prefers-reduced-motion: no-preference) {
  .newsletter.in .nl-bg { animation: kenBurns 14s ease-in-out infinite alternate; }
}
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.06); } }
.newsletter .nl-scrim { position: absolute; inset: 0; z-index: -1; background: rgba(8,50,59,.78); }
/* success beat: the status line rises in when the form completes
   (animation, not transition — it must fire on the display:none -> flex swap) */
.newsletter.done .ok { animation: okRise .45s var(--ease) both; }
@keyframes okRise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .newsletter .nl-bg { animation: none !important; }
  .newsletter.done .ok { animation: none; }
}
.newsletter .nl-form { display: flex; gap: .6rem; flex-wrap: wrap; max-width: 520px; }
.newsletter .nl-form .input { flex: 1; min-width: 220px; box-shadow: none; }
.newsletter .ok { display: none; font-weight: 600; align-items: center; gap: .5em; }
.newsletter.done .nl-form { display: none; }
.newsletter.done .ok { display: flex; }
.newsletter .nl-tag { font-size: .82rem; opacity: .85; margin-top: .8rem; }

/* ---------------- Compliance bar ---------------- */
.compliance {
  background: var(--ink); color: rgba(255,255,255,.78);
  font-size: .8rem; line-height: 1.5; padding: .85rem 0;
}
.compliance .wrap { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.compliance b { color: #fff; }
.compliance .chip { background: rgba(255,255,255,.1); padding: .25em .7em; border-radius: var(--r-pill); font-weight: 600; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,.7); padding-top: clamp(3rem,6vw,5rem); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 2.4rem; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer h5 { font-family: var(--display); color: #fff; font-size: 1rem; letter-spacing: .02em; margin-bottom: 1rem; }
.site-footer .fcol ul { display: flex; flex-direction: column; gap: .55rem; font-size: .94rem; }
.site-footer .socials { display: flex; gap: .6rem; margin-top: 1.2rem; }
.site-footer .socials a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-dark); transition: .2s; }
.site-footer .socials a:hover { background: var(--burnt); box-shadow: none; transform: translateY(-2px); }
.site-footer .socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid var(--line-dark); margin-top: 3rem; padding-block: 1.6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }

/* ---------------- Age gate ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background:
    radial-gradient(90% 130% at 88% -20%, rgba(231,135,40,.28) 0%, rgba(231,135,40,0) 52%),
    radial-gradient(120% 150% at 12% 110%, #14424E 0%, var(--night) 64%);
  padding: 1.4rem; overflow: auto;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(460px, 100%); background: rgba(20,16,13,.55); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-xl); padding: clamp(1.8rem, 5vw, 3rem);
  color: #fff; text-align: center; box-shadow: var(--sh-lg);
}
.gate-card h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin-top: 1.2rem; }
.gate-card p { color: rgba(255,255,255,.82); margin: .6rem 0 1.6rem; }
.gate-actions { display: grid; gap: .7rem; margin-top: 1.4rem; }
.gate-err { color: #ffd9d4; font-weight: 600; min-height: 1.2em; margin-top: .9rem; font-size: .9rem; }
.gate-card .fine { font-size: .76rem; color: rgba(255,255,255,.6); margin-top: 1.2rem; }
.gate-card .btn { width: 100%; }
.gate-actions + .fine { margin-top: 1.2rem; }

/* ---------------- State gateway ---------------- */
.gateway {
  position: fixed; inset: 0; z-index: 990; display: grid; place-items: center;
  background: var(--paper); padding: 1.4rem; overflow: auto;
}
.gateway[hidden] { display: none; }
.gateway-inner { width: min(560px, 100%); text-align: center; }
.gateway h2 { font-size: clamp(1.8rem, 6vw, 3rem); margin: 1.2rem 0 .4rem; }
.gateway .state-list { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.8rem; }
.state-opt {
  display: flex; align-items: center; gap: .8rem; padding: 1.05rem 1.2rem; border-radius: var(--r-md);
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); text-align: left;
  transition: transform .2s, box-shadow .2s; font-weight: 600;
}
.state-opt:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--burnt), var(--sh-md); }
.state-opt .flag { width: 40px; height: 40px; border-radius: 12px; background: var(--sunset-warm); flex: none; display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; }
.state-opt small { display: block; font-weight: 500; color: var(--ink-soft); font-size: .8rem; }

/* ---------------- Chatbot ---------------- */
.chat-launcher {
  position: fixed; right: clamp(16px, 3vw, 30px); bottom: clamp(16px, 3vw, 30px); z-index: 500;
  width: 62px; height: 62px; border-radius: 50%; background: var(--sunset-warm); color: #fff;
  display: grid; place-items: center; box-shadow: var(--sh-lg); transition: transform .3s var(--ease);
}
.chat-launcher:hover { transform: scale(1.07) rotate(4deg); }
.chat-launcher svg { width: 26px; height: 26px; }
.chat-launcher .pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(231,135,40,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 18px rgba(231,135,40,0); } }
@media (prefers-reduced-motion: reduce) { .chat-launcher .pulse { animation: none; } }

.chat-panel {
  position: fixed; right: clamp(16px, 3vw, 30px); bottom: clamp(88px, 12vw, 104px); z-index: 501;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px));
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
  transform-origin: bottom right; transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.chat-panel[hidden] { display: none; }
.chat-panel.closing { opacity: 0; transform: scale(.9); }
.chat-head { background: var(--sunset-warm); color: #fff; padding: 1rem 1.2rem; display: flex; align-items: center; gap: .7rem; }
.chat-head .av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.chat-head b { font-family: var(--display); font-size: 1.05rem; }
.chat-head small { display: block; font-size: .75rem; opacity: .85; }
.chat-head .x { margin-left: auto; width: 34px; height: 34px; color: #fff; font-size: 1.3rem; border-radius: 50%; }
.chat-head .x:hover { background: rgba(255,255,255,.18); }
.chat-body { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 82%; padding: .7em .95em; border-radius: 16px; font-size: .92rem; line-height: 1.45; }
.msg.bot { background: #fff; box-shadow: var(--sh-sm); border-bottom-left-radius: 5px; align-self: flex-start; }
.msg.user { background: var(--burnt); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.chat-sugs { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.1rem .6rem; }
.chat-sugs button { font-size: .8rem; font-weight: 600; padding: .45em .8em; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--line); transition: .2s; }
.chat-sugs button:hover { box-shadow: inset 0 0 0 1.5px var(--burnt); color: var(--crimson); }
.typing { display: inline-flex; gap: 4px; padding: .8em 1em; background: #fff; border-radius: 16px; box-shadow: var(--sh-sm); align-self: flex-start; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: tdot 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s; } .typing i:nth-child(3){ animation-delay: .4s; }
@keyframes tdot { 0%,60%,100%{ opacity: .3; transform: translateY(0);} 30%{ opacity: 1; transform: translateY(-4px);} }
.chat-input { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--line); background: var(--paper); }
.chat-input input { flex: 1; padding: .7em 1em; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.chat-input input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--burnt); }
.chat-input button { width: 42px; height: 42px; border-radius: 50%; background: var(--burnt); color: #fff; display: grid; place-items: center; flex: none; }

/* ---------------- State switch popover ---------------- */
.state-pop {
  width: 280px; background: #fff; border-radius: var(--r-md);
  box-shadow: var(--sh-lg); border: 1px solid var(--line); padding: .6rem;
  animation: popIn .22s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.state-pop .sp-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); padding: .4rem .6rem; }
.state-pop button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem; border-radius: var(--r-sm); text-align: left; transition: background .15s; }
.state-pop button:hover { background: var(--paper-2); }
.state-pop button.on { background: var(--flavor-soft); }
.state-pop .flag { width: 34px; height: 34px; border-radius: 9px; background: var(--sunset-warm); color: #fff; font-family: var(--display); font-weight: 700; font-size: .8rem; display: grid; place-items: center; flex: none; }
.state-pop b { font-family: var(--display); display: block; font-size: 1rem; }
.state-pop small { color: var(--ink-soft); font-size: .8rem; }
.state-pop .tick { margin-left: auto; color: var(--burnt); width: 18px; }
.state-pop .tick svg { width: 18px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 940px) {
  .nav-main { display: none; }
  .header-cta { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .gateway .state-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}
