/* ============================================================
   Ritual Black Caffè — site styles
   Palette: espresso #171310 · roast #2A211B · crema #C98F4E
            crema-light #E8C08A · steam #FBF7F0
   Type:    Fraunces (display) · Archivo (body/UI)
   ============================================================ */

:root {
  --espresso: #171310;
  --roast: #2a211b;
  --roast-2: #362a21;
  --crema: #c98f4e;
  --crema-light: #e8c08a;
  --crema-deep: #7c5527;
  --steam: #fbf7f0;
  --steam-2: #f3ecdf;
  --ink: #241c15;
  --taupe: #5f4d3a;
  --line-dark: rgba(232, 192, 138, 0.16);
  --line-light: rgba(36, 28, 21, 0.12);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Archivo", -apple-system, Helvetica, Arial, sans-serif;
  --wrap: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--steam);
  background: var(--espresso);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Type scale ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--crema);
  margin-bottom: 1.1rem;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  max-width: 42em;
}

.on-light { color: var(--ink); }
.on-light .eyebrow { color: var(--crema-deep); }
.on-light .muted { color: var(--taupe); }
.muted { color: rgba(251, 247, 240, 0.85); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 15px 32px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--crema-light); outline-offset: 3px; }

.btn-primary { background: var(--crema); color: var(--espresso); }
.btn-primary:hover { background: var(--crema-light); }

.btn-ghost { border-color: var(--line-dark); color: var(--steam); }
.btn-ghost:hover { border-color: var(--crema); color: var(--crema-light); }

.on-light .btn-ghost { border-color: var(--line-light); color: var(--ink); }
.on-light .btn-ghost:hover { border-color: var(--crema-deep); color: var(--crema-deep); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 19, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--steam);
  white-space: nowrap;
}
.logo span { color: var(--crema); }

.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(251, 247, 240, 0.78);
  transition: color 0.15s ease;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--crema-light); }

.header-cta { display: flex; align-items: center; gap: 18px; }
.header-phone {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--steam);
  white-space: nowrap;
}
.header-phone:hover { color: var(--crema-light); }
.header-cta .btn { padding: 11px 24px; font-size: 0.92rem; white-space: nowrap; }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line-dark);
  border-radius: 8px;
  color: var(--steam);
  font-size: 1.3rem;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}

/* ---------- Hero: the espresso surface ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(90px, 14vh, 160px) 0 clamp(70px, 10vh, 120px);
  isolation: isolate;
}

.hero::before {
  /* crema swirl — slow conic drift, like looking into a fresh shot */
  content: "";
  position: absolute;
  top: -40%;
  right: -22%;
  width: min(74vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(201, 143, 78, 0.05) 40deg,
    rgba(201, 143, 78, 0.22) 110deg,
    rgba(232, 192, 138, 0.34) 160deg,
    rgba(201, 143, 78, 0.1) 220deg,
    transparent 300deg
  );
  filter: blur(42px);
  animation: swirl 46s linear infinite;
  z-index: -3;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 78% 18%, transparent 30%, var(--espresso) 78%);
  z-index: -1;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  filter: blur(1.5px);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--crema);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 999;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scrollProgress linear;
    animation-timeline: scroll(root);
  }
  @keyframes scrollProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* ---------- Hero exit parallax (native scroll-driven) ---------- */
@supports (animation-timeline: scroll()) {
  .hero-photo {
    animation: heroPhotoExit linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 600px;
  }
  @keyframes heroPhotoExit {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-70px) scale(1.06); }
  }
  .hero .wrap > *:not(.hero-photo) {
    animation: heroContentExit linear both;
    animation-timeline: scroll(root);
    animation-range: 0px 420px;
  }
  @keyframes heroContentExit {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-36px); opacity: 0.35; }
  }
}

@keyframes swirl {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .scroll-progress,
  .hero-photo,
  .hero .wrap > *:not(.hero-photo) {
    animation: none !important;
  }
}

.hero h1 { max-width: 13em; margin-bottom: 1.4rem; }
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--crema-light);
}
.hero .lede { margin-bottom: 2.4rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 2.6rem; }

.hero-assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: rgba(251, 247, 240, 0.6);
}
.hero-assurances li::before {
  content: "✓";
  color: var(--crema);
  margin-right: 8px;
  font-weight: 700;
}

/* ---------- Menu marquee (bar menu-board divider) ---------- */

.menu-strip {
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  overflow: hidden;
  padding: 16px 0;
  background: var(--roast);
}

.menu-strip .track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.menu-strip span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--crema-light);
  white-space: nowrap;
}
.menu-strip span::after {
  content: "·";
  margin: 0 22px;
  color: var(--crema);
  font-style: normal;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}


/* ---------- Sections ---------- */

.section { padding: clamp(70px, 10vh, 110px) 0; }
.section-light { background: var(--steam); color: var(--ink); }
.section-roast { background: var(--roast); }

.section-head { max-width: 720px; margin-bottom: 3.2rem; }
.section-head h2 { margin-bottom: 1rem; }

/* ---------- Cards & grids ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.card {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 30px 28px;
  background: rgba(251, 247, 240, 0.02);
}
.card h3 { margin-bottom: 0.7rem; }
.card p { font-size: 0.96rem; color: rgba(251, 247, 240, 0.72); }

.section-light .card { border-color: var(--line-light); background: #fff; }
.section-light .card p { color: var(--taupe); }

/* Steps — a real sequence: trial → install → weekly ritual */
.step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.2rem;
  color: var(--crema);
  display: block;
  margin-bottom: 0.6rem;
}

/* ---------- Machine cards ---------- */

.machine-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.machine-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--roast), var(--espresso));
  padding: 34px 28px 26px;
}
.machine-visual .machine-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.machine-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(23,19,16,.32), rgba(23,19,16,.88));
  z-index: 1;
}
.machine-visual .m-name,
.machine-visual .m-fit {
  position: relative;
  z-index: 2;
}
.machine-visual .m-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--steam);
}
.machine-visual .m-fit {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crema-light);
  margin-top: 6px;
}

.machine-body { padding: 26px 28px 30px; flex: 1; display: flex; flex-direction: column; }
.machine-body ul { list-style: none; margin: 0 0 22px; flex: 1; }
.machine-body li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.92rem;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-light);
  color: var(--ink);
}
.machine-body li b { font-weight: 600; white-space: nowrap; }
.machine-body li span { color: var(--taupe); }
.machine-body .btn { align-self: flex-start; }

.machine-flag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--espresso);
  background: var(--crema);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

/* ---------- Pricing clarity band ---------- */

.pricing-band {
  border: 1px solid var(--line-dark);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(36px, 5vw, 60px);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(201, 143, 78, 0.14), transparent 55%),
    var(--roast);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.pricing-band h2 { margin-bottom: 1rem; }

.included-list { list-style: none; }
.included-list li {
  padding: 11px 0 11px 34px;
  position: relative;
  border-bottom: 1px solid var(--line-dark);
  font-size: 0.98rem;
}
.included-list li:last-child { border-bottom: none; }
.included-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--crema);
  font-weight: 700;
}

/* ---------- Vertical (who we serve) tiles ---------- */

.vertical-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vertical-tile {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: #fff;
  padding: 24px 24px 22px;
}
.vertical-tile h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
.vertical-tile p { font-size: 0.9rem; color: var(--taupe); }

/* ---------- FAQ accordion ---------- */

.faq-list { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--line-light); }
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  padding: 22px 4px;
  cursor: pointer;
}
.faq-q:focus-visible { outline: 3px solid var(--crema-deep); outline-offset: 2px; }
.faq-q .indicator {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--crema-deep);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item[data-open] .indicator { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 4px 24px; color: var(--taupe); max-width: 60em; }
.faq-item[data-open] .faq-a { display: block; }

/* ---------- Forms ---------- */

.lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lead-form .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}
.section-dark-form .field label { color: var(--steam); }

.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border: 1.5px solid var(--line-light);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--crema-deep);
  box-shadow: 0 0 0 3px rgba(201, 143, 78, 0.25);
}
.field textarea { min-height: 120px; resize: vertical; }

.form-note { font-size: 0.85rem; color: var(--taupe); }

/* ---------- Final CTA ---------- */

.final-cta { text-align: center; }
.final-cta h2 { max-width: 16em; margin: 0 auto 1.2rem; }
.final-cta .lede { margin: 0 auto 2.4rem; }
.final-cta .hero-actions { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-dark);
  background: var(--espresso);
  padding: 60px 0 36px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 44px;
}

.site-footer h4 {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crema);
  margin-bottom: 14px;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: rgba(251, 247, 240, 0.7); text-decoration: none; }
.site-footer a:hover { color: var(--crema-light); }

.footer-nap p { color: rgba(251, 247, 240, 0.7); margin-bottom: 8px; }
.footer-nap .logo { display: inline-block; margin-bottom: 14px; }

.footer-legal {
  border-top: 1px solid var(--line-dark);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: rgba(251, 247, 240, 0.45);
  font-size: 0.82rem;
}
.footer-legal a { color: inherit; }

/* ---------- Page hero (interior pages) ---------- */

.page-hero { padding: clamp(70px, 10vh, 110px) 0 clamp(40px, 6vh, 70px); }
.page-hero h1 { max-width: 15em; margin-bottom: 1.2rem; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid-3, .vertical-tiles { grid-template-columns: repeat(2, 1fr); }
  .pricing-band { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--espresso);
    border-bottom: 1px solid var(--line-dark);
    padding: 12px 24px 20px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; font-size: 1.05rem; width: 100%; }
  .nav-toggle { display: block; }
  .header-phone { display: none; }
}

@media (max-width: 620px) {
  .grid-3, .grid-2, .vertical-tiles, .lead-form { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Estimator widget ---------- */

.estimator {
  border: 1px solid var(--line-dark);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(ellipse at 88% 0%, rgba(201, 143, 78, 0.16), transparent 55%),
    var(--roast);
  padding: clamp(32px, 5vw, 56px);
}

.estimator-step { display: none; }
.estimator-step.active { display: block; }

.estimator .q-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  display: block;
}

.estimator .q-count {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crema);
  display: block;
  margin-bottom: 0.8rem;
}

.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.choice {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--steam);
  background: rgba(251, 247, 240, 0.04);
  border: 1.5px solid var(--line-dark);
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.choice:hover { border-color: var(--crema); transform: translateY(-2px); }
.choice:focus-visible { outline: 3px solid var(--crema-light); outline-offset: 3px; }

.estimator-result { display: none; }
.estimator-result.active { display: block; }
.estimator-result .rec-machine {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 600;
  color: var(--crema-light);
  margin: 0.4rem 0 0.9rem;
}
.estimator-result p { margin-bottom: 1.6rem; }
.estimator-back {
  background: none; border: none; color: var(--crema);
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; padding: 0; margin-top: 1.6rem; text-decoration: underline;
}

/* ---------- Spec tables ---------- */

.spec-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.spec-table th, .spec-table td {
  text-align: left; padding: 13px 16px;
  border-bottom: 1px solid var(--line-light);
}
.spec-table th {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--taupe); font-weight: 600;
}
.spec-table td:first-child { font-weight: 600; white-space: nowrap; }
.spec-table-scroll { overflow-x: auto; border: 1px solid var(--line-light); border-radius: var(--radius); background: #fff; }

/* ---------- Article / blog ---------- */

.article-body { max-width: 720px; }
.article-body h2 { font-size: 1.7rem; margin: 2.6rem 0 1rem; }
.article-body h3 { margin: 2rem 0 0.8rem; }
.article-body p { margin-bottom: 1.2rem; color: var(--ink); }
.article-body ul, .article-body ol { margin: 0 0 1.2rem 1.4rem; color: var(--ink); }
.article-body li { margin-bottom: 0.5rem; }
.article-meta { font-size: 0.85rem; color: var(--taupe); margin-bottom: 2rem; }

.post-card { display: flex; flex-direction: column; }
.post-card h3 a { text-decoration: none; color: inherit; }
.post-card h3 a:hover { color: var(--crema-deep); }
.post-card .post-tag {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--crema-deep); margin-bottom: 10px;
}

/* ---------- Map embed ---------- */

.map-embed {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 7;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Long-form page prose ---------- */

.prose { max-width: 760px; }
.prose p { margin-bottom: 1.2rem; }
.prose h2 { margin: 2.6rem 0 1rem; font-size: 1.8rem; }
.prose ul { margin: 0 0 1.2rem 1.4rem; }
.prose li { margin-bottom: 0.5rem; }

/* ============ VIDEO SECTION ============ */
.video-frame {
  max-width: 960px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
}

.video-frame video {
  aspect-ratio: 16 / 9;
}

/* ---------- Hero photo ---------- */
.hero-photo {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: clamp(220px, 28vw, 380px);
  height: clamp(165px, 21vw, 285px);
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
  z-index: 1;
}
.hero .wrap {
  position: relative;
  z-index: 2;
  padding-right: clamp(260px, 32vw, 440px);
}
@media (max-width: 980px) {
  .hero-photo { display: none; }
  .hero .wrap { padding-right: 24px; }
}

/* ---------- fx demo toggle (?fx=particles|scroll|both) ---------- */
html[data-fx="particles"] .scroll-progress {
  display: none !important;
}
html[data-fx="particles"] .hero-photo,
html[data-fx="particles"] .hero .wrap > *:not(.hero-photo) {
  animation: none !important;
  transform: none !important;
  opacity: 1 !important;
}
