/* ThinkMates — design tokens
   Palette: warm paper base, ink-navy text, amber "highlighter" accent,
   coral used specifically to mark "redirect" moments, sage for affirmation.
   Type: Space Grotesk (display/UI) + Source Serif 4 (reading text). */

:root {
  --paper: #faf8f3;
  --paper-2: #f2ede0;
  --ink: #1e2a3a;
  --ink-soft: #57626f;
  --amber: #f0a23b;
  --amber-deep: #a86a17;
  --coral: #e1636f;
  --coral-deep: #b8404b;
  --sage: #4f8f72;
  --rule: #ded3bd;
  --white: #ffffff;
  --radius: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, nav a, .btn, .tag, .step-num, .logo, label, .meta {
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

h2::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--coral);
  flex-shrink: 0;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1rem; max-width: 62ch; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 52ch; }
a { color: inherit; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5.5rem 0; }
.section-alt { background: var(--paper-2); }

/* Header / nav */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}

.logo span { color: var(--amber-deep); }

nav.primary { display: flex; align-items: center; gap: 2rem; }
nav.primary a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 500;
}
nav.primary a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #14202e; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.75rem; }

/* Hero */
.hero {
  padding: 4.5rem 0 5rem;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 34px,
    rgba(30, 42, 58, 0.055) 35px
  );
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}

/* Chat mock */
.chat-mock {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 7px 7px 0 rgba(30, 42, 58, 0.07);
}
.chat-mock .chat-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-mock .chat-label .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--sage);
}
.chat-thread { display: flex; flex-direction: column; gap: 0.85rem; }
.msg {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.5;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  max-width: 84%;
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.5s ease forwards;
}
.msg.student {
  align-self: flex-end;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.msg.ai {
  align-self: flex-start;
  background: var(--ink);
  color: var(--paper);
  border-bottom-left-radius: 4px;
}
.msg.ai.redirect { border-left: 4px solid var(--amber); padding-left: calc(1rem - 4px); }
.msg-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.msg-tag.tag-amber { color: var(--amber-deep); background: rgba(240, 162, 59, 0.16); }
.msg-tag.tag-sage { color: var(--sage); background: rgba(79, 143, 114, 0.16); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* Hero carousel: two example conversations sharing one chat-mock card */
.chat-slide { display: none; }
.chat-slide.is-active { display: block; }
.chat-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.chat-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: var(--rule);
  cursor: pointer;
}
.chat-dot.is-active { width: 20px; background: var(--ink); }
.chat-dot:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* Problem section */
.problem-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: start;
}
.problem-note {
  border-left: 2px solid var(--rule);
  padding-left: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.25rem; }
.step-num {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--amber);
  display: block;
  margin-bottom: 0.6rem;
}
.step p { color: var(--ink-soft); font-size: 1rem; }

/* Who it's for */
.for-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.for-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2rem;
}
.for-card ul { list-style: none; margin: 1rem 0 0; padding: 0; }
.for-card li {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.for-card li .check { color: var(--sage); font-weight: 700; flex-shrink: 0; }

/* Contact form */
.contact-form { max-width: 640px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}
.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.form-field input,
.form-field textarea {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--coral);
  outline-offset: 1px;
  border-color: var(--coral);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status {
  margin-top: 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  color: var(--sage);
  min-height: 1.2em;
}
.form-status.error { color: var(--coral-deep); }

/* Footer */
footer.site {
  border-top: 1px solid var(--rule);
  padding: 3rem 0 2.5rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; }
.footer-links a:hover { color: var(--ink); }
.footer-meta { color: var(--ink-soft); font-size: 0.88rem; margin-top: 1.5rem; }
.footer-meta a { color: var(--ink-soft); text-decoration: underline; }

/* Legal pages */
.legal main { padding: 3.5rem 0 5rem; }
.legal h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.legal .updated { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.2rem; }
.legal h2::before { width: 20px; }
.legal p, .legal li { color: var(--ink-soft); }

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .problem-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .for-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  nav.primary {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
    display: none;
  }
  nav.primary.open { display: flex; }
  .nav-toggle { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
