/* AI Tutor Math — one stylesheet for every page. Warm, calm, kitchen-table. */
:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #24303c;
  --ink-soft: #5b6b7b;
  --line: #e6e0d4;
  --accent: #3d5a80;
  --accent-dark: #2c4159;
  --warm: #ee9b3a;
  --warm-soft: #fdf3e3;
  --good: #2e7d5b;
  --radius: 14px;
  --maxw: 880px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.25; color: var(--ink); }
h1 { font-size: 2.4rem; margin: 0 0 14px; }
h2 { font-size: 1.7rem; margin: 0 0 12px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.logo { font-family: Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
nav.top a { margin-left: 18px; text-decoration: none; color: var(--ink-soft); font-size: .95rem; }
nav.top a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 60px 0 30px; text-align: center; }
.hero .kicker {
  display: inline-block; background: var(--warm-soft); color: #9c6414;
  border: 1px solid #f3ddb6; border-radius: 999px;
  padding: 4px 14px; font-size: .85rem; margin-bottom: 18px;
}
.hero p.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 640px; margin: 0 auto 18px; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: 600 1rem/1 inherit; border-radius: 10px; padding: 14px 26px;
  background: var(--accent); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: #eef2f7; }
.btn.warm { background: var(--warm); color: #3d2a08; }
.btn.warm:hover { background: #e08c28; }
.btn[disabled] { opacity: .55; cursor: default; }

/* Sections */
section.band { padding: 44px 0; }
section.band.alt { background: #f3efe6; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.card .num {
  display: inline-flex; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 10px; font-size: .95rem;
}
ul.plain { padding-left: 20px; margin: 0 0 14px; }
ul.plain li { margin-bottom: 8px; }

/* Two-column is/isn't */
.isnt { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 640px) { .isnt { grid-template-columns: 1fr; } }
.isnt .card h3 { display: flex; align-items: center; gap: 8px; }

/* Tutor chat */
.tutor-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(40, 50, 70, .07);
  max-width: 720px; margin: 26px auto 0; overflow: hidden; text-align: left;
}
.tutor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: #f6f3ec;
}
.tutor-head .t-title { font-weight: 600; font-size: .95rem; }
.tutor-head .t-free { font-size: .8rem; color: var(--ink-soft); }
.tutor-log {
  height: 380px; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; font-size: .96rem; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.tutor { align-self: flex-start; background: #f1eee6; border-bottom-left-radius: 4px; }
.msg.thinking { color: var(--ink-soft); font-style: italic; }
.tutor-input { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.tutor-input textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: .96rem; min-height: 46px; max-height: 130px;
  background: var(--paper);
}
.tutor-input textarea:focus { outline: none; border-color: var(--accent); }
.tutor-input button { align-self: flex-end; }
.tutor-foot { padding: 0 16px 12px; display: flex; justify-content: space-between; align-items: center; }
.tutor-foot button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: .85rem; padding: 0; text-decoration: underline; }

.tutor-memory {
  padding: 10px 16px 12px; border-top: 1px dashed var(--line);
  background: var(--warm-soft); font-size: .88rem; color: #6b4a12; text-align: center;
}
.tutor-memory button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline;
}

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(30, 36, 44, .55);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius); max-width: 440px; width: 100%;
  padding: 30px 28px; position: relative; text-align: center;
}
.modal .x {
  position: absolute; top: 10px; right: 14px; background: none; border: 0;
  font-size: 1.4rem; color: var(--ink-soft); cursor: pointer;
}
.modal input[type=email], .modal input[type=text] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; margin-bottom: 10px; background: var(--paper);
}
.modal input:focus { outline: none; border-color: var(--accent); }
.price-line { font-family: Georgia, serif; font-size: 2rem; margin: 8px 0 2px; }
.price-line small { font-size: 1rem; color: var(--ink-soft); }

/* Forms */
form.contact { max-width: 520px; }
form.contact input, form.contact textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; margin-bottom: 12px; background: var(--card);
}
form.contact input:focus, form.contact textarea:focus { outline: none; border-color: var(--accent); }

/* FAQ */
details {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--ink-soft); }

/* Footer */
footer.site {
  border-top: 1px solid var(--line); margin-top: 50px; padding: 30px 0 40px;
  color: var(--ink-soft); font-size: .9rem;
}
footer.site a { color: var(--ink-soft); margin-right: 16px; }

/* Notices */
.notice { background: var(--warm-soft); border: 1px solid #f3ddb6; border-radius: 10px; padding: 12px 16px; font-size: .92rem; }
.ok-note { color: var(--good); font-weight: 600; }

/* SEO pages */
.subject-hero { padding: 46px 0 10px; }
.subject-hero h1 { font-size: 2rem; }
.crumbs { font-size: .85rem; color: var(--ink-soft); padding-top: 18px; }
.crumbs a { color: var(--ink-soft); }
