/* ============================================================
   oopto.ai — dinner-table editorial
   linen paper · pine ink · tomato + butter accents
   ============================================================ */

:root {
  --paper: #faf7f0;
  --paper-deep: #f3eee2;
  --ink: #1c3329;
  --ink-soft: #44584d;
  --pine: #1c3329;
  --tomato: #e2472b;
  --butter: #f5c84c;
  --bubble-gray: #e9e9eb;
  --bubble-blue: #007aff;
  --display: "Bricolage Grotesque", sans-serif;
  --body: "Newsreader", georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

em { font-style: italic; font-family: var(--body); font-weight: 500; }

/* ---------- nav ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem clamp(1.25rem, 5vw, 4rem);
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark.small { font-size: 1.2rem; }
.wordmark-dot { color: var(--tomato); }

/* ---------- buttons & forms ---------- */
.btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  background: var(--tomato);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 2px 0 rgba(28, 51, 41, 0.25);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(226, 71, 43, 0.35); }
.btn:active { transform: translateY(0); }
.btn-small { padding: 0.55rem 1.2rem; font-size: 0.9rem; }

.capture {
  display: flex;
  gap: 0.6rem;
  margin-top: 2rem;
  max-width: 26rem;
}
.capture.center { margin: 2.5rem auto 0; justify-content: center; }
.capture input {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 1rem;
  padding: 0.85rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.capture input::placeholder { color: var(--ink-soft); opacity: 0.6; }
.capture input:focus { border-color: var(--tomato); box-shadow: 0 0 0 4px rgba(226, 71, 43, 0.15); }
.capture-note {
  margin-top: 0.8rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.capture.done input { display: none; }
.capture.done .btn { background: var(--pine); pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(2rem, 6vh, 5rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 8vh, 6rem);
  max-width: 78rem;
  margin: 0 auto;
}

.kicker {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--tomato);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-family: var(--body);
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.squiggle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.18em;
  color: var(--tomato);
}
.squiggle svg { width: 100%; height: 0.22em; display: block; overflow: visible; }
.squiggle path {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw 0.9s ease-out 0.5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.lede {
  margin-top: 1.6rem;
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  max-width: 32rem;
  color: var(--ink-soft);
}
.lede strong { color: var(--ink); font-weight: 500; }

/* ---------- phone ---------- */
.hero-phone { position: relative; justify-self: center; }

.phone {
  position: relative;
  width: min(340px, 86vw);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 2.6rem;
  padding: 0.9rem 0.9rem 1.4rem;
  box-shadow: 14px 14px 0 var(--butter);
  transform: rotate(1.5deg);
}
.phone-notch {
  width: 38%;
  height: 1.4rem;
  background: var(--ink);
  border-radius: 999px;
  margin: 0.2rem auto 0.8rem;
}
.thread-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #ececec;
  margin-bottom: 0.8rem;
}
.thread-avatars {
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  background: var(--paper-deep);
  display: grid; place-items: center;
  font-size: 1.1rem;
}
.thread-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111;
}
.thread-title span { display: block; font-weight: 400; font-size: 0.72rem; color: #8e8e93; }

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
}

.msg {
  max-width: 85%;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes pop { to { opacity: 1; transform: translateY(0) scale(1); } }

.msg .sender {
  display: block;
  font-size: 0.68rem;
  color: #8e8e93;
  margin: 0 0 0.15rem 0.8rem;
}
.msg.oopto .sender { color: var(--tomato); font-weight: 600; }

.bubble {
  padding: 0.55rem 0.8rem;
  border-radius: 1.15rem;
  width: fit-content;
}
.from-them .bubble { background: var(--bubble-gray); color: #111; border-bottom-left-radius: 0.3rem; }
.from-me { align-self: flex-end; }
.from-me .bubble { background: var(--bubble-blue); color: #fff; border-bottom-right-radius: 0.3rem; }

.bubble.plan {
  background: #fdf4dd;
  border: 1px solid var(--butter);
  line-height: 1.7;
}
.bubble.plan strong {
  display: inline-block;
  width: 2.6em;
  color: var(--tomato);
  font-weight: 600;
}

.typing .bubble { display: flex; gap: 4px; align-items: center; padding: 0.7rem 0.9rem; }
.typing .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #a0a0a6;
  animation: bounce 1.2s ease-in-out infinite;
}
.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* ---------- ticker ---------- */
.ticker {
  background: var(--butter);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  padding: 0.9rem 0;
  transform: rotate(-1deg) scale(1.02);
}
.ticker-track {
  display: flex;
  gap: 1.6rem;
  width: max-content;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  animation: scroll 28s linear infinite;
}
.ticker-track span:nth-child(odd) { color: var(--ink); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section-title em { font-family: var(--body); font-weight: 500; color: var(--tomato); }
.section-title.light { color: var(--paper); }
.section-title.light em { color: var(--butter); }

.steps {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 5vw, 4rem);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: 3rem;
}
.step { position: relative; padding-top: 1rem; }
.step-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 4.5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--tomato);
  display: block;
  margin-bottom: 0.8rem;
}
.step h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.step p { color: var(--ink-soft); }

/* ---------- pillars ---------- */
.pillars { background: var(--pine); color: var(--paper); }
.pillars-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 5vw, 4rem);
}
.pillars-lede {
  margin-top: 1.4rem;
  max-width: 38rem;
  color: rgba(250, 247, 240, 0.75);
  font-size: 1.15rem;
}
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2.5rem);
  margin-top: 3.5rem;
}
.pillar {
  border: 1.5px solid rgba(250, 247, 240, 0.25);
  border-radius: 1.4rem;
  padding: 1.8rem 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.pillar:hover {
  transform: translateY(-4px);
  border-color: var(--butter);
  background: rgba(250, 247, 240, 0.04);
}
.pillar h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--butter);
  margin-bottom: 0.6rem;
}
.pillar p { color: rgba(250, 247, 240, 0.8); font-size: 1.05rem; }

/* ---------- closer ---------- */
.closer {
  text-align: center;
  padding: clamp(5rem, 14vh, 9rem) clamp(1.25rem, 5vw, 4rem);
}
.closer h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.closer em { font-family: var(--body); font-weight: 500; color: var(--tomato); }

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem clamp(1.25rem, 5vw, 4rem);
  border-top: 2px solid var(--ink);
}
.footer p { font-size: 0.9rem; font-style: italic; color: var(--ink-soft); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease var(--r, 0s), transform 0.7s ease var(--r, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-phone { margin-top: 1rem; }
  .phone { transform: rotate(0deg); box-shadow: 8px 8px 0 var(--butter); }
  .steps-grid, .pillar-grid { grid-template-columns: 1fr; }
  .capture { flex-direction: column; }
  .capture .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  .squiggle path { animation: none; stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
