:root {
  --ink: #1c120c;
  --paper: #f3ebe0;
  --foam: #fff8ef;
  --roast: #3d2414;
  --espresso: #2a160c;
  --amber: #c4783a;
  --amber-deep: #a35f28;
  --mist: rgba(212, 196, 168, 0.35);
  --line: rgba(28, 18, 12, 0.12);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--foam);
  background: var(--espresso);
  overflow-x: hidden;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Atmosphere */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 18% 20%, rgba(196, 120, 58, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 60% at 85% 75%, rgba(92, 58, 34, 0.55), transparent 50%),
    linear-gradient(165deg, #3a2214 0%, #1c120c 45%, #120b07 100%);
}

.wash {
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 38px,
      rgba(243, 235, 224, 0.02) 38px,
      rgba(243, 235, 224, 0.02) 39px
    );
  animation: wash-drift 28s linear infinite;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: soft-light;
}

@keyframes wash-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 24px, 0); }
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 5rem);
  padding-bottom: 4.5rem;
}

.hero__visual {
  display: grid;
  place-items: center;
  position: relative;
}

.cup {
  width: min(340px, 70vw);
  height: auto;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.35));
  animation: cup-float 5.5s ease-in-out infinite;
}

.beans {
  width: min(220px, 55vw);
  margin-top: -0.5rem;
  opacity: 0.9;
}

@keyframes cup-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Steam */
.steam__line {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: steam-draw 3.2s ease-in-out infinite;
  opacity: 0;
}

.steam__line--1 { animation-delay: 0s; }
.steam__line--2 { animation-delay: 0.45s; }
.steam__line--3 { animation-delay: 0.9s; }

@keyframes steam-draw {
  0% {
    opacity: 0;
    stroke-dashoffset: 60;
    transform: translateY(6px);
  }
  30% { opacity: 0.9; }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
    transform: translateY(-22px);
  }
}

/* Coffee fill pulse */
.coffee {
  transform-origin: center bottom;
  animation: coffee-breathe 4s ease-in-out infinite;
}

.coffee__surface {
  animation: surface-sway 4s ease-in-out infinite;
}

@keyframes coffee-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes surface-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

/* Beans */
.bean {
  transform-origin: center;
  animation: bean-toss 6s ease-in-out infinite;
}

.bean--1 { animation-delay: 0s; }
.bean--2 { animation-delay: 0.8s; }
.bean--3 { animation-delay: 1.5s; }

@keyframes bean-toss {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-6px) rotate(4deg); }
  70% { transform: translateY(2px) rotate(-3deg); }
}

/* Copy */
.hero__copy {
  max-width: 34rem;
  animation: rise-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 5.6rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--foam);
}

.brand span {
  font-style: italic;
  font-weight: 500;
  color: var(--amber);
  margin: 0 0.08em;
}

h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--paper);
}

.lead {
  margin: 0 0 1.75rem;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.65;
  color: rgba(243, 235, 224, 0.78);
  max-width: 28ch;
}

.notify {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  max-width: 26rem;
}

.notify input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(243, 235, 224, 0.06);
  color: var(--foam);
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.notify input::placeholder {
  color: rgba(243, 235, 224, 0.45);
}

.notify input:focus {
  border-color: rgba(196, 120, 58, 0.65);
  background: rgba(243, 235, 224, 0.1);
}

.notify button {
  appearance: none;
  border: 0;
  background: var(--amber);
  color: var(--espresso);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.15rem;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.notify button:hover {
  background: #d48945;
}

.notify button:active {
  transform: translateY(1px);
}

.status {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: #d4c4a8;
}

.foot {
  position: relative;
  z-index: 1;
  margin-top: -3rem;
  padding: 0 clamp(1.5rem, 6vw, 5rem) 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(243, 235, 224, 0.4);
}

/* Mobile */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding-top: clamp(2.5rem, 8vw, 4rem);
    gap: 1.25rem;
  }

  .hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lead {
    max-width: 34ch;
  }

  .notify {
    width: 100%;
    max-width: 22rem;
    flex-direction: column;
  }

  .cup {
    width: min(260px, 62vw);
    animation-duration: 6.5s;
  }

  .foot {
    text-align: center;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wash,
  .cup,
  .steam__line,
  .coffee,
  .coffee__surface,
  .bean,
  .hero__copy {
    animation: none !important;
  }

  .steam__line {
    opacity: 0.55;
  }
}
