/* The Reading Coach — calm, understated tutor brand */
:root {
  --ink: #2c2a26;
  --ink-soft: #5a564e;
  --ink-muted: #7a756c;
  --paper: #faf8f5;
  --paper-warm: #f3efe8;
  --card: #ffffff;
  --line: #e4dfd6;
  --accent: #5b6b4a;
  --accent-soft: #e8ede3;
  --accent-hover: #4a5840;
  --notice: #f7f3eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(44, 42, 38, 0.06);
  --font: "Source Serif 4", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 720px;
  --wide: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout */
.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

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

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.brand {
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav-cta {
  color: var(--accent) !important;
  font-weight: 500;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}

/* Hero / sections */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38em;
  margin: 0 0 1.75rem;
}

.section {
  padding: 2.25rem 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section h2 {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  letter-spacing: -0.015em;
}

.section p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.section p:last-child {
  margin-bottom: 0;
}

/* Cards */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.25rem;
}

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

.card h3 {
  font-family: var(--font);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.card .badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.card .badge.soon {
  color: var(--ink-muted);
  background: var(--paper-warm);
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 500;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Social / footer */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.social-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.social-links a:hover {
  color: var(--accent);
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.site-footer .inner {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

/* Practice hub */
.how-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how-list li {
  counter-increment: how;
  position: relative;
  padding: 0.85rem 0 0.85rem 2.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.how-list li:last-child {
  border-bottom: none;
}

.how-list li::before {
  content: counter(how);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-list strong {
  color: var(--ink);
  font-weight: 560;
}

/* Session UI */
.privacy-banner {
  background: var(--notice);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.privacy-banner strong {
  color: var(--ink);
  font-weight: 560;
}

.session-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.session-panel h2 {
  font-family: var(--font);
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.tab {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px 6px 0 0;
  color: var(--ink-muted);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--paper-warm);
  font-weight: 500;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

label.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.helper {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0.4rem 0 0.75rem;
}

textarea,
input[type="file"] {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.98rem;
}

textarea {
  min-height: 140px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

textarea.approach {
  min-height: 180px;
}

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  background: var(--paper);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink-soft);
}

.dropzone input[type="file"] {
  display: none;
}

.review-strip {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--paper-warm);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.review-strip.visible {
  display: block;
}

.review-strip .preview-text {
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-height: 120px;
  overflow: auto;
  margin: 0.5rem 0;
}

.review-strip .preview-img {
  max-height: 140px;
  border-radius: 6px;
  margin: 0.5rem 0;
  display: block;
}

.coach-guide {
  display: grid;
  gap: 0.75rem;
}

.coach-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1.05rem;
  background: var(--paper);
}

.coach-section h3 {
  font-family: var(--font);
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.coach-section .placeholder {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  font-style: italic;
}

.method-points {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.method-points li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.method-points li:last-child {
  border-bottom: none;
}

.method-points strong {
  display: block;
  font-family: var(--font);
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}


/* Coach guide live states */
.is-hidden {
  display: none !important;
}

.coach-section .coach-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.coach-section .coach-body.placeholder {
  font-size: 0.92rem;
  color: var(--ink-muted);
  font-style: italic;
  white-space: normal;
}

.coach-error {
  border-color: #c9a59a;
  background: #fbf6f4;
}

.coach-loading-msg::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  animation: coach-dots 1.2s steps(4, end) infinite;
}

@keyframes coach-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0.75rem;
  }

  .nav.open {
    display: flex;
  }

  .site-header .inner {
    flex-wrap: wrap;
  }

  .hero {
    padding: 2.5rem 0 1.75rem;
  }

  .session-panel {
    padding: 1.1rem;
  }
}

/* Practice Coach live guide */
.coach-status {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.coach-status p {
  margin: 0;
}

.coach-status--loading {
  background: var(--accent-soft);
  border-color: #c5d0bc;
}

.coach-status--error {
  background: #f8ece8;
  border-color: #e0c4bc;
  color: #5c3a32;
}

.coach-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
  line-height: 1.55;
}

.coach-section--coach {
  background: #f7faf5;
  border-color: #d5e0cc;
}

.coach-section--internal {
  opacity: 0.85;
  font-size: 0.9rem;
}

.coach-section--internal h3::after {
  content: " · internal";
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.key-panel .key-letter {
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
