/* ===== Tokens ===== */
:root {
  --bg: #1a120b;
  --bg-soft: #241a12;
  --surface: #2c2017;
  --line: rgba(255, 240, 220, 0.12);
  --text: #f3e9dd;
  --text-dim: #b9a794;
  --primary: #c98a4b;
  --primary-deep: #7a4a2b;
  --accent: #e0a458;
  --success: #6f9e5e;
  --warning: #e0a458;
  --error: #c75b5b;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --maxw: 1120px;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--text);
  background-color: var(--bg);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(201, 138, 75, 0.12), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(26, 18, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-bean {
  width: 22px; height: 30px;
  background: var(--primary);
  border-radius: 50%;
  transform: rotate(18deg);
  position: relative;
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.35);
}
.brand-bean::after {
  content: "";
  position: absolute;
  inset: 4px 50% 4px 50%;
  width: 2px;
  background: #1c1109;
  border-radius: 2px;
  transform: translateX(-50%);
}
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }

/* ===== Beans rain (intro) ===== */
.beans-rain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.beans-rain .falling-bean {
  position: absolute;
  top: -60px;
  width: 18px;
  height: 24px;
  background: var(--primary-deep);
  border-radius: 50%;
  transform: rotate(var(--rot, 20deg));
  box-shadow: inset -3px -3px 5px rgba(0,0,0,0.4);
  opacity: 0.92;
  animation: bean-fall var(--dur, 3s) cubic-bezier(0.3, 0.1, 0.4, 1) var(--delay, 0s) forwards;
}
.beans-rain .falling-bean::after {
  content: "";
  position: absolute;
  inset: 3px 50% 3px 50%;
  width: 2px;
  background: #1c1109;
  border-radius: 2px;
  transform: translateX(-50%);
}
@keyframes bean-fall {
  0% { transform: translateY(-60px) rotate(var(--rot, 20deg)); opacity: 0; }
  10% { opacity: 0.92; }
  85% { opacity: 0.92; }
  100% { transform: translateY(105vh) rotate(calc(var(--rot, 20deg) + 360deg)); opacity: 0; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 160px;
}
.hero-inner { max-width: 760px; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 18px;
  font-family: "Inter", system-ui, sans-serif;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.08;
  margin: 0 0 22px;
  font-weight: 700;
}
.hero-title .accent {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 auto 36px;
  max-width: 560px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: #1a120b;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(201,138,75,0.35); background: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Scroll cue (grano girando) ===== */
.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: color 0.2s ease, opacity 0.4s ease;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue-bean {
  width: 26px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  position: relative;
  box-shadow: inset -4px -4px 8px rgba(0,0,0,0.4);
  animation: spin-bean 2.6s ease-in-out infinite;
}
.scroll-cue-bean::after {
  content: "";
  position: absolute;
  inset: 4px 50% 4px 50%;
  width: 2px;
  background: #1c1109;
  border-radius: 2px;
  transform: translateX(-50%);
}
@keyframes spin-bean {
  0% { transform: rotateY(0deg) rotate(20deg); }
  50% { transform: rotateY(180deg) rotate(20deg); }
  100% { transform: rotateY(360deg) rotate(20deg); }
}

/* ===== Section helpers ===== */
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.76rem;
  color: var(--accent);
  margin: 0 0 14px;
  font-family: "Inter", system-ui, sans-serif;
}
.section-title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  margin: 0 0 20px;
  font-weight: 700;
}
.section-text {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 560px;
}

/* ===== Story (dos mitades que se juntan) ===== */
.story {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  overflow: hidden;
}
.story-bean-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(620px, 90vw);
  height: 360px;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  opacity: 0.55;
}
.bean-half {
  position: absolute;
  width: 200px;
  height: 280px;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.5));
  transition: transform 0.15s linear, opacity 0.2s ease;
  will-change: transform;
}
.bean-half-left  { transform: translateX(var(--bean-gap, 400px)); }
.bean-half-right { transform: translateX(calc(var(--bean-gap, 400px) * -1)); }
.story-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  background: rgba(26, 18, 11, 0.55);
  backdrop-filter: blur(6px);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.story-copy .section-text { margin: 0 auto; }

/* ===== Origins ===== */
.origins { padding: 120px 24px; max-width: var(--maxw); margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 56px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(201, 138, 75, 0.4);
}
.card-img {
  height: 220px;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.card:hover .card-img { transform: scale(1.06); }
.card h3 {
  font-size: 1.4rem;
  margin: 20px 20px 10px;
  color: var(--accent);
}
.card p {
  margin: 0 20px 24px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ===== Roast ===== */
.roast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 120px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.roast-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.roast-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  font-size: 1.05rem;
}
.roast-list span {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.roast-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.rotating-bean {
  width: 180px;
  height: 250px;
  background: linear-gradient(145deg, var(--primary), var(--primary-deep));
  border-radius: 50%;
  position: relative;
  box-shadow: inset -10px -10px 28px rgba(0,0,0,0.5), 0 24px 60px rgba(0,0,0,0.5);
  animation: roast-spin 8s linear infinite;
}
.rotating-bean::after {
  content: "";
  position: absolute;
  inset: 14px 50% 14px 50%;
  width: 4px;
  background: #1c1109;
  border-radius: 4px;
  transform: translateX(-50%);
}
@keyframes roast-spin {
  0% { transform: rotateY(0deg) rotate(15deg); }
  100% { transform: rotateY(360deg) rotate(15deg); }
}

/* ===== Contact ===== */
.contact {
  text-align: center;
  padding: 140px 24px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(201, 138, 75, 0.12), transparent 70%),
    var(--bg-soft);
  border-top: 1px solid var(--line);
}
.contact-inner { max-width: 620px; margin: 0 auto; }
.contact .section-text { margin: 0 auto 32px; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-dim);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .roast { grid-template-columns: 1fr; gap: 24px; }
  .story-copy { padding: 28px; }
  .hero { padding-top: 100px; }
}

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