/*
Theme Name: Craft My Coffee — Late Shift
Theme URI: https://craftmycoffee.com
Author: Craft My Coffee
Description: Dark roasthouse storefront theme for Craft My Coffee. Custom blend builder, WooCommerce support, Hint/Splash/Bold/Downpour strength scale.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: craftmycoffee
*/

:root {
  --espresso: #100905; --panel: #180E07; --panel-2: #201309;
  --crema: #EED0A4; --foam: #F9F1E2; --caramel: #C97B3D; --cherry: #BE4A2E;
  --muted: #A78F6E; --faint: #6B563D; --line: rgba(238, 208, 164, 0.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--espresso); color: var(--foam);
  font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
  font-size: 17px; line-height: 1.68; overflow-x: hidden;
}
.disp {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600; line-height: 1.04; letter-spacing: -0.015em;
  margin: 0; text-wrap: balance;
}
.hand { font-family: "Caveat", "Segoe Print", cursive; font-weight: 500; letter-spacing: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
section { padding: 72px 0; position: relative; }
p.lede { color: var(--muted); max-width: 34em; }
a { color: var(--crema); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--caramel); outline-offset: 3px; }

.stain { position: absolute; border-radius: 50%; border: 13px solid rgba(238, 208, 164, 0.05); box-shadow: 0 0 0 2px rgba(238, 208, 164, 0.04); pointer-events: none; }

.ticker { background: var(--crema); color: var(--espresso); overflow: hidden; white-space: nowrap; padding: 9px 0; }
.ticker .rail { display: inline-block; animation: roll 28s linear infinite; }
.ticker span { font-family: "Figtree", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 0 18px; }
@keyframes roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker .rail { animation: none; }
  .steam i { animation: none !important; opacity: 0.5 !important; }
  .btn, .pill, .menu-row { transition: none !important; }
  html { scroll-behavior: auto; }
}

header.top { display: flex; align-items: center; gap: 26px; padding: 20px 0; border-bottom: 1px solid var(--line); }
header.top .word { font-family: "Fraunces", Georgia, serif; font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin-right: auto; }
header.top .word a { text-decoration: none; color: var(--foam); }
header.top .word em { font-style: italic; color: var(--caramel); font-weight: 500; }
header.top a.nav { font-size: 14.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
header.top a.nav:hover { color: var(--crema); }
header.top a.cmc-bag { color: var(--crema); }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  font-family: "Figtree", sans-serif; font-size: 16px; font-weight: 700; letter-spacing: 0.01em;
  padding: 14px 30px; border: 2px solid var(--crema); border-radius: 999px;
  background: var(--crema); color: var(--espresso); transition: background 0.15s, color 0.15s, transform 0.12s;
}
.btn:hover { background: var(--caramel); border-color: var(--caramel); color: var(--foam); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--crema); }
.btn.ghost:hover { background: var(--crema); color: var(--espresso); }
.btn.small { padding: 9px 18px; font-size: 14px; }

.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; padding: 70px 0 30px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 82px); }
.hero h1 .c1 { color: var(--foam); }
.hero h1 .c2 { color: var(--crema); font-style: italic; }
.hero h1 .c3 { color: var(--caramel); }
.hero .script-line { font-size: clamp(24px, 3vw, 32px); color: var(--muted); margin: 18px 0 0; transform: rotate(-1deg); }
.hero .ctas { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.cup-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 90px; }
.cup-stage .stain { width: 300px; height: 300px; top: 30px; right: -40px; transform: rotate(8deg); }
.steam { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 140px; height: 100px; }
.steam i {
  position: absolute; bottom: 0; width: 9px; height: 70px; border-radius: 999px;
  background: linear-gradient(to top, rgba(249, 241, 226, 0.5), transparent);
  filter: blur(4px); opacity: 0; animation: rise 2.6s ease-in-out infinite;
}
.steam i.w1 { left: 30px; animation-delay: 0s; }
.steam i.w2 { left: 62px; animation-delay: 0.7s; height: 85px; }
.steam i.w3 { left: 92px; animation-delay: 1.3s; height: 65px; }
.steam i.w4 { left: 47px; animation-delay: 1.9s; height: 95px; }
@keyframes rise {
  0% { transform: translateY(16px) scaleY(0.7); opacity: 0; }
  35% { opacity: var(--steam-op, 0.55); }
  100% { transform: translateY(-34px) scaleY(1.15); opacity: 0; }
}
.cup-stage[data-strike="0"] { --steam-op: 0.3; }
.cup-stage[data-strike="1"] { --steam-op: 0.5; }
.cup-stage[data-strike="2"] { --steam-op: 0.75; }
.cup-stage[data-strike="3"] { --steam-op: 1; }
.cup-stage[data-strike="0"] .steam i.w2, .cup-stage[data-strike="0"] .steam i.w3, .cup-stage[data-strike="0"] .steam i.w4 { animation-play-state: paused; opacity: 0 !important; }
.cup-stage[data-strike="1"] .steam i.w3, .cup-stage[data-strike="1"] .steam i.w4 { animation-play-state: paused; opacity: 0 !important; }
.cup-stage[data-strike="2"] .steam i.w4 { animation-play-state: paused; opacity: 0 !important; }
.cup { position: relative; width: 170px; height: 120px; background: var(--foam); border-radius: 10px 10px 85px 85px; }
.cup::after { content: ""; position: absolute; right: -52px; top: 16px; width: 44px; height: 56px; border: 12px solid var(--foam); border-radius: 50%; }
.brew { position: absolute; left: 12px; right: 12px; top: 10px; height: 26px; border-radius: 50%; background: #C97B3D; transition: background 0.4s; }
.saucer { width: 230px; height: 26px; border-radius: 50%; background: var(--panel-2); margin-top: -8px; }
.cup-cap { margin-top: 16px; font-family: "Caveat", cursive; font-size: 22px; color: var(--muted); transform: rotate(-1.5deg); }

.counter { margin-top: 50px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px 38px 40px; }
.counter .head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 26px; }
.counter .head h2 { font-size: 30px; }
.counter .head .hand { color: var(--caramel); font-size: 24px; transform: rotate(-1deg); display: inline-block; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: "Figtree", sans-serif; font-size: 15px; font-weight: 600;
  padding: 9px 18px; cursor: pointer; border: 2px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--muted); transition: all 0.15s;
}
.pill[aria-pressed="true"] { background: var(--crema); border-color: var(--crema); color: var(--espresso); }
.pill:hover { border-color: var(--crema); color: var(--crema); }
.pill[aria-pressed="true"]:hover { color: var(--espresso); }

.slider-zone { margin: 34px 0 4px; }
.slider-zone .zl { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 16px; }
input.heat {
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 0;
  border-radius: 999px; cursor: pointer; border: 1px solid rgba(0, 0, 0, 0.4);
  background: linear-gradient(90deg, var(--crema), var(--caramel) 55%, var(--cherry));
}
input.heat::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--foam); border: 5px solid var(--espresso);
  box-shadow: 0 0 0 2px var(--crema), 0 3px 10px rgba(0, 0, 0, 0.5); cursor: grab;
}
input.heat::-webkit-slider-thumb:active { cursor: grabbing; }
input.heat::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--foam); border: 5px solid var(--espresso);
  box-shadow: 0 0 0 2px var(--crema), 0 3px 10px rgba(0, 0, 0, 0.5); cursor: grab;
}
input.heat::-moz-range-track { background: transparent; }
.stops { position: relative; height: 30px; margin-top: 12px; }
.stops span {
  position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap;
  font-family: "Caveat", "Segoe Print", cursive; font-size: 21px; font-weight: 500; color: var(--faint);
}
.stops span[data-i="0"] { left: 18px; }
.stops span[data-i="1"] { left: calc(18px + (100% - 36px) * 0.3333); }
.stops span[data-i="2"] { left: calc(18px + (100% - 36px) * 0.6667); }
.stops span[data-i="3"] { left: calc(100% - 18px); }
.stops span.on { color: var(--crema); font-weight: 600; }

.order { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.order .line1 { font-family: "Fraunces", Georgia, serif; font-size: clamp(24px, 3.4vw, 38px); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
.order .line1 em { font-style: italic; color: var(--caramel); }
.order .line2 { font-size: 15px; color: var(--muted); margin: 8px 0 0; }
.order .picks { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 20px; }
.order .pk { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.order .grind-row { display: flex; gap: 8px; }
.order .roast-hint { font-family: "Caveat", "Segoe Print", cursive; font-size: 19px; color: var(--caramel); margin: 7px 0 0; transform: rotate(-1deg); }
.order .bag { font-size: 13.5px; color: var(--faint); margin-top: 10px; text-align: right; font-weight: 600; }

.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 44px; }
.ring { text-align: center; }
.ring:nth-child(odd) .circ { transform: rotate(-3deg); }
.ring:nth-child(even) .circ { transform: rotate(2deg); }
.ring .circ {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--caramel); display: flex; align-items: center; justify-content: center;
  font-family: "Caveat", cursive; font-size: 38px; font-weight: 600; color: var(--crema);
  box-shadow: 0 0 0 6px rgba(201, 123, 61, 0.12);
}
.ring h3 { font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.ring p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }

.menu { margin-top: 40px; border-top: 2px solid var(--line); }
.menu-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 14px 12px; border-bottom: 1px solid var(--line); transition: background 0.15s, color 0.15s; }
.menu-row .name { font-family: "Fraunces", Georgia, serif; font-size: clamp(24px, 3vw, 36px); font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; }
.menu-row .pair { font-family: "Caveat", "Segoe Print", cursive; font-size: 21px; color: var(--caramel); white-space: nowrap; transform: rotate(-1deg); }
.menu-row:hover { background: var(--crema); }
.menu-row:hover .name { color: var(--espresso); }
.menu-row:hover .pair { color: var(--cherry); }
.menu-row.seasonal .name { color: var(--caramel); font-style: italic; }
.menu-foot { margin-top: 26px; font-size: 15.5px; color: var(--muted); max-width: 44em; }

.shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 40px; }
.crate { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 30px; position: relative; overflow: hidden; }
.crate.feature { background: var(--crema); color: var(--espresso); }
.crate.feature p { color: #6B4E31; }
.crate.feature .price { color: var(--cherry); }
.crate .tag { display: inline-block; font-family: "Caveat", cursive; font-size: 20px; color: var(--caramel); transform: rotate(-2deg); }
.crate h4 { font-family: "Fraunces", Georgia, serif; font-size: 26px; font-weight: 600; margin: 6px 0 8px; line-height: 1.05; letter-spacing: -0.015em; }
.crate p { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.crate .price { font-size: 14.5px; font-weight: 700; color: var(--crema); }
.crate .crate-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.crate.feature .btn { background: var(--espresso); border-color: var(--espresso); color: var(--crema); }
.crate.feature .btn:hover { background: var(--cherry); border-color: var(--cherry); color: var(--foam); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; text-decoration: none; color: var(--foam); display: block;
  transition: transform 0.15s, border-color 0.15s;
}
.card:nth-child(1) { transform: rotate(-1.2deg); }
.card:nth-child(2) { transform: rotate(0.8deg); }
.card:nth-child(3) { transform: rotate(-0.6deg); }
.card:hover { transform: rotate(0deg) translateY(-3px); border-color: var(--caramel); }
.card .spec-line { font-family: "Caveat", cursive; font-size: 20px; color: var(--caramel); }
.card h4 { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 600; margin: 8px 0 8px; line-height: 1.15; letter-spacing: -0.015em; }
.card p { font-size: 14.5px; color: var(--muted); margin: 0; }

.extras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.extra { border: 1px dashed var(--line); border-radius: 14px; padding: 22px 24px; }
.extra h4 { font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.extra p { font-size: 14.5px; color: var(--muted); margin: 0; }
.extra .price { color: var(--caramel); font-weight: 700; }

footer.site { border-top: 1px solid var(--line); padding: 46px 0 30px; text-align: center; position: relative; }
footer.site .stain { width: 190px; height: 190px; bottom: -60px; left: 8%; transform: rotate(-12deg); }
footer.site .word { font-family: "Fraunces", Georgia, serif; font-size: 26px; font-weight: 700; }
footer.site .word em { font-style: italic; color: var(--caramel); font-weight: 500; }
footer.site .slogan { color: var(--muted); margin: 6px 0 0; font-family: "Caveat", cursive; font-size: 23px; transform: rotate(-1deg); }
footer.site .meta { font-size: 12.5px; color: var(--faint); margin-top: 20px; }
footer.site .flinks { display: flex; gap: 20px; justify-content: center; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }
footer.site .flinks a { color: var(--muted); text-decoration: none; }
footer.site .flinks a:hover { color: var(--crema); }

/* ---- "Keep crafting" page (post-add landing) ---- */
.kc .kc-hand { color: var(--caramel); font-size: 26px; display: inline-block; transform: rotate(-1deg); }
.kc h1 em { font-style: italic; color: var(--caramel); }
.kc .pk { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.kc-bagbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; margin: 20px 0 8px; }
.kc-list { list-style: none; margin: 0; padding: 0; }
.kc-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--foam); font-size: 15px; }
.kc-list li:last-child { border-bottom: 0; }
.kc-list .kc-qty { color: var(--muted); }
.kc-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.kc-note { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.cmc-quick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.kc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 24px; }

/* ---- Generic pages (privacy, terms, refund, blog) ---- */
.page-shell { max-width: 760px; margin: 0 auto; padding: 60px 28px 80px; }
.page-shell h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: clamp(32px, 4.6vw, 48px); letter-spacing: -0.015em; margin: 0 0 10px; }
.page-shell h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 24px; margin: 34px 0 10px; }
.page-shell p, .page-shell li { color: var(--muted); }
.page-shell strong { color: var(--foam); }
.page-shell .updated { font-family: "Caveat", cursive; font-size: 20px; color: var(--caramel); }

/* ---- WooCommerce skin ---- */
.woo-shell { max-width: 1000px; margin: 0 auto; padding: 50px 28px 80px; }
.woo-shell h1, .woocommerce-products-header__title { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -0.015em; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit,
.woocommerce a.button.alt, .woocommerce button.button.alt, .wc-block-components-button {
  font-family: "Figtree", sans-serif; font-weight: 700; border-radius: 999px;
  background: var(--crema); color: var(--espresso); border: 2px solid var(--crema); padding: 12px 24px;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--caramel); border-color: var(--caramel); color: var(--foam); }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-family: "Fraunces", Georgia, serif; font-size: 20px; color: var(--foam); }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price { color: var(--caramel); font-weight: 700; }
.woocommerce div.product .product_title { color: var(--foam); }
.woocommerce table.shop_table { border: 1px solid var(--line); border-radius: 14px; }
.woocommerce table.shop_table td, .woocommerce table.shop_table th { border-color: var(--line) !important; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select,
.woocommerce div.product form.cart .variations select {
  background: var(--panel-2); color: var(--foam); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  background: var(--panel); color: var(--foam); border-top-color: var(--caramel); border-radius: 10px;
}
.woocommerce-message::before, .woocommerce-info::before { color: var(--caramel); }
.select2-container--default .select2-selection--single { background: var(--panel-2); border: 1px solid var(--line); }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--foam); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .cup-stage { order: -1; padding-top: 70px; }
  .rings { grid-template-columns: repeat(2, 1fr); }
  .shelf { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .extras { grid-template-columns: 1fr; }
  header.top a.nav { display: none; }
  header.top a.cmc-bag { display: inline; }
  .counter { padding: 26px 22px 30px; }
}
