/* ============================================================
   The Teaching Bit — main stylesheet
   Palette: off-white base, ink text, teal master accent,
   deep teal for links, writing red reserved for WordBits.
   ============================================================ */

:root {
  --bg: #f7f6f3;
  --ink: #1a1a1a;
  --muted: #4c5754;
  --teal: #38c2b4;
  --teal-hover: #2fb0a3;
  --teal-deep: #0c7268;
  --teal-tint: #e2f4f1;
  --red: #ff685e;
  --red-tint: #ffe9e7;
  --red-deep: #8f2a23;
  --yellow: #ffc93c;
  --card: #fdfcf8;
  --surface: #f0eee7;
  --line: #e2ded2;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 6px 24px rgba(26, 26, 26, 0.07);
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playwrite GB S', cursive;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Type ---------- */

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; }

h1 { font-size: clamp(2.1rem, 4.5vw, 3.5rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
}

p { margin: 0 0 1.1em; }
.lede { font-size: clamp(1.1rem, 1.4vw, 1.3rem); color: var(--muted); max-width: 52ch; }

a { color: var(--teal-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 0.9em;
}

.eyebrow--red { color: var(--red-deep); }

/* Hand-drawn brush underline for one key phrase per page */
.brushline {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  padding-bottom: 0.15em;
}

.brushline svg {
  position: absolute;
  left: 0;
  bottom: -0.12em;
  width: 100%;
  height: 0.35em;
  overflow: visible;
}

.brushline svg path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 7;
  stroke-linecap: round;
}

/* ---------- The bit trail (signature divider) ---------- */

.bit-trail {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0;
  margin: 0.4rem 0 1.6rem;
  list-style: none;
}

.bit-trail li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bit-trail li:nth-child(1) { background: #ff685e; }
.bit-trail li:nth-child(2) { background: #ffc93c; }
.bit-trail li:nth-child(3) { background: #5da9ff; }
.bit-trail li:nth-child(4) { background: #aa68ff; }
.bit-trail li:nth-child(5) { background: #38c2b4; }
.bit-trail li:nth-child(6) { background: #ff8a2e; }
.bit-trail li:nth-child(7) { background: #ff85c1; }

.bit-trail--center { justify-content: center; }

/* ---------- Layout ---------- */

.container {
  width: min(1140px, calc(100% - clamp(2.5rem, 7vw, 6rem)));
  margin: 0 auto;
}

.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand img { width: 42px; height: 42px; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover { border-bottom-color: var(--teal); }

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--teal);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .site-nav.open { display: block; }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav a {
    display: block;
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav li:last-child a { border-bottom: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--teal);
  color: var(--ink);
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
  color: var(--ink);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover { background: var(--ink); color: var(--bg); }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

/* ---------- Hero ---------- */

.hero { padding: clamp(3.2rem, 9vw, 7.5rem) 0 clamp(3.2rem, 8vw, 6.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}

.hero-art {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { max-width: 420px; }
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.4rem, 3vw, 2.2rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 2.5vw, 2.3rem);
}

.card--flush { padding: 0; overflow: hidden; }
.card--flush .card-body { padding: clamp(1.6rem, 2.5vw, 2.2rem); }
.card--flush img { width: 100%; border-bottom: 1px solid var(--line); }

.chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  margin-bottom: 0.9rem;
}

.chip--red { background: var(--red-tint); color: var(--red-deep); }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.feature-list li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.55rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--teal);
}

.feature-list--red li::before { background: var(--red); }

/* Split feature section (image + text) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}

.split-img {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 2rem; }
}

/* Numbered steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.4rem, 3vw, 2.2rem);
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 2.5vw, 2.2rem);
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* ---------- Forms (contact) ---------- */

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem;
  max-width: 640px;
}

.form-field { margin-bottom: 1.3rem; }

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #c9c4b8;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--teal-deep);
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

.hp-field { position: absolute; left: -9999px; }

/* ---------- Newsletter / MailerLite section ---------- */

.signup-section .ml-form-embedContainer { max-width: 440px; }

/* Contrast fixes on the embedded MailerLite form (teal panel) */
#mlb2-41795504.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent h4,
#mlb2-41795504.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4,
#mlb2-41795504.ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedContent p,
#mlb2-41795504.ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p {
  color: #10201d !important;
}

.signup-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

@media (max-width: 860px) {
  .signup-wrap { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Prose (legal pages) ---------- */

.prose { max-width: 72ch; }

.prose h2 { margin-top: 2.2em; font-size: 1.35rem; }
.prose h3 { margin-top: 1.6em; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

.prose th { background: var(--teal-tint); }

.prose .updated { color: var(--muted); font-size: 0.95rem; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--teal-tint);
  border: 1px solid #cdebe6;
  border-radius: var(--radius);
  padding: clamp(2.2rem, 5vw, 4rem);
  text-align: center;
}

.cta-band h2 { margin-bottom: 0.4em; }
.cta-band p { max-width: 52ch; margin-left: auto; margin-right: auto; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.site-footer h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--teal-deep); text-decoration: underline; }

.footer-brand img { width: 48px; margin-bottom: 0.8rem; }
.footer-brand p { color: var(--muted); max-width: 34ch; }

.footer-bottom {
  margin-top: 2.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- Accessibility ---------- */

:focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn:focus-visible { outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn:hover { transform: none; }
}
