/* ============== DESIGN TOKENS ============== */
:root {
  /* Buena Vida palette — warm paper + dark wood + forest green */
  --paper: #F5EDDF;
  --paper-deep: #EBE0CC;
  --paper-edge: #E0D2B7;
  --ink: #2B1F14;
  --ink-soft: #5A4838;
  --ink-mute: #8B7A65;
  --forest: #2D4F3F;
  --forest-deep: #1F3A2C;
  --caramel: #B8804A;
  --caramel-soft: #D9A672;
  --crema: #FBF6EB;
  --white: #FFFFFF;
  --shadow-soft: 0 8px 24px rgba(43, 31, 20, 0.08);
  --shadow-med: 0 16px 40px rgba(43, 31, 20, 0.12);
  --shadow-deep: 0 24px 60px rgba(43, 31, 20, 0.18);

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', cursive;

  --max-w: 1180px;
  --pad-x: clamp(20px, 5vw, 56px);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
}

/* ============== RESETS ============== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(at 10% 0%, var(--crema) 0%, transparent 40%),
                    radial-gradient(at 90% 100%, var(--paper-deep) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--caramel); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
em { font-style: italic; color: var(--forest); }
.small { font-size: 0.85em; opacity: 0.7; }

/* ============== HEADER ============== */
.site-header {
  padding: 28px 0 0;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-soft);
}
.header-mark {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.mark-sep { color: var(--caramel); }
.header-date {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ============== HERO ============== */
.hero {
  padding: 80px 0 60px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-hand);
  font-size: 32px;
  color: var(--caramel);
  margin-bottom: 4px;
  line-height: 1;
}
.hero-headline {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.hero-headline em {
  font-weight: 600;
  font-style: italic;
}
.hero-sub {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 480px;
  margin-bottom: 14px;
}
.hero-sub.small {
  font-size: 16px;
  font-style: italic;
  color: var(--ink-mute);
}
.hero-image {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  background: var(--paper-deep);
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-image img.placeholder { display: none; }
.hero-image-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--ink-mute);
  font-family: var(--font-hand);
  font-size: 22px;
}
.hero-image img.placeholder + .hero-image-fallback,
.hero-image:has(img.placeholder) .hero-image-fallback {
  display: flex;
}
.hero-image-fallback .small {
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.7;
}

/* ============== BLOCK / SECTION DEFAULTS ============== */
.block {
  padding: 90px 0;
}
.section-eyebrow {
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--caramel);
  margin-bottom: 8px;
  line-height: 1;
}
.section-title {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 500;
  margin-bottom: 16px;
  max-width: 22ch;
}
.section-lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 48px;
}

/* ============== OBSERVATIONS ============== */
.observations { background: linear-gradient(to bottom, transparent, var(--crema) 30%, var(--crema) 70%, transparent); }
.observation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 16px;
}
.observation {
  background: var(--white);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
}
.observation:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-med);
}
.observation-num {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--caramel);
  margin-bottom: 14px;
  font-weight: 600;
}
.observation h3 {
  font-size: 24px;
  margin-bottom: 12px;
  line-height: 1.25;
}
.observation p {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============== IDEA / VIDA-BUDDY ============== */
.idea {
  background: var(--paper-deep);
  position: relative;
}
.idea-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}
.idea-header .section-title { margin-left: auto; margin-right: auto; }
.idea-header .section-lead { margin-left: auto; margin-right: auto; }

.buddy-illustration {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto 36px;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--crema);
  box-shadow: var(--shadow-soft);
}
.buddy-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.buddy-illustration img.placeholder { display: none; }
.buddy-image-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-mute);
  text-align: center;
  padding: 24px;
}
.buddy-illustration img.placeholder + .buddy-image-fallback,
.buddy-illustration:has(img.placeholder) .buddy-image-fallback {
  display: flex;
}
.buddy-image-fallback .small {
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.7;
}

.demo-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.demo-frame {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep);
  border: 1px solid var(--paper-edge);
  overflow: hidden;
}
.demo-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: var(--crema);
  border-bottom: 1px solid var(--paper-edge);
}
.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper-edge);
}
.demo-dot:nth-child(1) { background: #E0918A; }
.demo-dot:nth-child(2) { background: #E0C58A; }
.demo-dot:nth-child(3) { background: #A6C8A0; }
.demo-label {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  font-family: var(--font-sans);
}
.demo-body {
  padding: 32px 28px 28px;
  min-height: 360px;
}
.demo-note {
  text-align: center;
  margin-top: 18px;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-mute);
}

/* Vida chat bubbles */
.vida-row {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  animation: bubble-in .4s ease both;
}
.vida-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--crema);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.vida-bubble {
  background: var(--paper);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15.5px;
  color: var(--ink);
  max-width: 80%;
  line-height: 1.5;
}
.vida-bubble.user {
  background: var(--forest);
  color: var(--crema);
  margin-left: auto;
}
.vida-row.user {
  flex-direction: row-reverse;
}
.vida-row.user .vida-avatar {
  background: var(--caramel);
}
.vida-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
  padding-left: 52px;
  animation: bubble-in .5s .15s ease both;
}
.vida-opt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--paper-edge);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 18px 9px 14px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all .2s ease;
  text-align: left;
}
.vida-opt:hover {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--crema);
  transform: translateY(-1px);
}
.vida-opt .opt-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--forest);
  transition: color .2s ease, transform .25s ease;
}
.vida-opt:hover .opt-icon {
  color: var(--crema);
  transform: rotate(-4deg) scale(1.08);
}
.vida-opt .opt-label { line-height: 1.2; }

/* Entry-path options — bigger, full-width-ish */
.vida-options-paths {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding-left: 52px;
}
.vida-opt-path {
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15.5px;
  font-weight: 600;
  justify-content: flex-start;
}
.vida-opt-path .opt-icon {
  width: 24px;
  height: 24px;
}

/* Result card sub-label */
.vida-result .result-sub {
  font-weight: 400;
  font-size: 0.7em;
  color: var(--ink-mute);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.vida-result {
  background: var(--crema);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  padding: 22px;
  margin-top: 16px;
  margin-left: 52px;
  animation: bubble-in .6s .3s ease both;
}
.vida-result h4 {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--forest-deep);
}
.vida-result .flavor {
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--caramel);
  margin-bottom: 12px;
}
.vida-result .why {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.vida-result .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vida-cta {
  border: none;
  background: var(--forest);
  color: var(--crema);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s ease;
}
.vida-cta:hover {
  background: var(--forest-deep);
  transform: translateY(-1px);
}
.vida-cta.secondary {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--forest);
}
.vida-cta.secondary:hover {
  background: var(--forest);
  color: var(--crema);
}
.vida-reset {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--ink-mute);
  font-family: var(--font-hand);
  font-size: 18px;
  text-decoration: underline;
}
.vida-reset:hover { color: var(--caramel); }

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.vida-bubble.vida-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}
.vida-bubble.vida-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-mute);
  opacity: 0.5;
  animation: typing-bounce 1.1s ease-in-out infinite;
}
.vida-bubble.vida-typing span:nth-child(2) { animation-delay: .15s; }
.vida-bubble.vida-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .vida-bubble.vida-typing span { animation: none; opacity: 0.7; }
}

/* ============== PHANTASY TILES ============== */
.phantasy {
  background: linear-gradient(to bottom, transparent, var(--crema) 30%, transparent);
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}
.tile {
  background: var(--white);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  padding: 28px 26px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-med);
}
.tile-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.tile:hover .tile-icon { color: var(--caramel); }
.tile:hover .tile-icon svg { transform: scale(1.08) rotate(-3deg); }

/* Bow ribbon — wiggle on hover */
.tile-icon .icon-bow { transform-origin: 16px 8px; transition: transform .4s ease; }
.tile:hover .tile-icon .icon-bow { transform: rotate(-6deg); }

/* Book lines — staggered draw on hover */
.tile-icon .icon-line {
  stroke-dasharray: 14;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s ease;
}
.tile:hover .tile-icon .icon-line {
  animation: line-draw .8s ease forwards;
}
.tile:hover .tile-icon .icon-line:nth-of-type(2) { animation-delay: .1s; }
.tile:hover .tile-icon .icon-line:nth-of-type(3) { animation-delay: .2s; }
@keyframes line-draw {
  0%   { stroke-dashoffset: 14; }
  100% { stroke-dashoffset: 0; }
}

/* Steam — continuous gentle drift */
.tile-icon .icon-steam {
  opacity: 0.55;
  transform-origin: center bottom;
  animation: steam-drift 2.8s ease-in-out infinite;
}
.tile-icon .icon-steam.steam-2 { animation-delay: .9s; }
.tile-icon .icon-steam.steam-3 { animation-delay: 1.8s; }
@keyframes steam-drift {
  0%   { opacity: 0.15; transform: translateY(2px); }
  50%  { opacity: 0.7;  transform: translateY(-1px); }
  100% { opacity: 0.15; transform: translateY(-3px); }
}

/* Envelope flap — open on hover */
.tile-icon .icon-envelope-flap {
  stroke-dasharray: 38;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s ease;
  transform-origin: 16px 10px;
}
.tile:hover .tile-icon .icon-envelope-flap {
  animation: flap-open .6s ease forwards;
}
@keyframes flap-open {
  0%   { stroke-dashoffset: 0; }
  50%  { stroke-dashoffset: 38; }
  100% { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tile-icon .icon-steam { animation: none; opacity: 0.5; }
}
.tile h4 {
  font-size: 22px;
  margin-bottom: 8px;
}
.tile p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============== ABOUT ============== */
.about {
  background: var(--forest);
  color: var(--crema);
}
.about .section-eyebrow { color: var(--caramel-soft); }
.about .section-title.about-title { color: var(--crema); }
.about-inner {
  max-width: 680px;
}
.about-text {
  font-size: 19px;
  line-height: 1.7;
  color: rgba(251, 246, 235, 0.88);
  margin-bottom: 18px;
}
.about-text:last-child { margin-bottom: 0; }

/* ============== CTA ============== */
.cta {
  padding: 100px 0 80px;
  text-align: center;
}
.cta-inner {
  max-width: 640px;
  margin: 0 auto;
}
.cta-title {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 12px;
  line-height: 1.1;
}
.cta-text {
  font-size: 22px;
  color: var(--ink-soft);
  margin-bottom: 36px;
}
.cta-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.cta-link {
  display: inline-block;
  padding: 16px 36px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: all .2s ease;
}
.cta-link:hover {
  background: var(--ink);
  color: var(--crema);
  transform: translateY(-2px);
}
.cta-link.primary {
  background: var(--forest);
  color: var(--crema);
  border-color: var(--forest);
}
.cta-link.primary:hover {
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  color: var(--crema);
}
.cta-foot {
  margin-top: 32px;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-mute);
}

/* ============== FOOTER ============== */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--paper-edge);
  background: var(--paper-deep);
}
.footer-inner {
  text-align: center;
  font-size: 14px;
  color: var(--ink-mute);
}
.site-footer a { color: var(--forest); }

/* ============== RESPONSIVE ============== */
@media (max-width: 980px) {
  .hero { padding: 56px 0 32px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-image { order: -1; aspect-ratio: 16 / 10; }
  .observation-grid { grid-template-columns: 1fr; gap: 18px; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .block { padding: 64px 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { font-size: 18px; }
  .hero-headline { font-size: clamp(40px, 12vw, 56px); }
  .hero-sub { font-size: 17px; }
  .section-title { font-size: clamp(30px, 8vw, 42px); }
  .section-lead { font-size: 17px; }
  .tile-grid { grid-template-columns: 1fr; }
  .demo-body { padding: 22px 18px; }
  .vida-options { padding-left: 0; }
  .vida-result { margin-left: 0; }
  .vida-bubble { max-width: 100%; }
  .cta { padding: 64px 0 48px; }
  .cta-text { font-size: 19px; }
  .cta-link { padding: 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
