/* ============================================
   IB IVY TUTORS — Design System
   Palette: deep ivy green, aged brass gold, paper ivory, ink
   Type: Fraunces (display) / Inter (body) / IBM Plex Mono (utility, "course codes")
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ivy-950: #101d17;
  --ivy-900: #16281f;
  --ivy-800: #1f3a2e;
  --ivy-700: #2c4f3d;
  --ivy-600: #3c6e52;
  --ivy-100: #e4ece5;
  --gold-600: #a9843f;
  --gold-500: #c9a96e;
  --gold-300: #e3d3ac;
  --paper: #faf7f0;
  --paper-dim: #f2ede1;
  --ink: #1c1c1a;
  --ink-soft: #4a4a44;
  --line: rgba(28, 28, 26, 0.12);
  --line-gold: rgba(169, 132, 63, 0.35);

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max: 1120px;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--gold-300); color: var(--ivy-950); }

:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-600);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--gold-600);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
  color: var(--ivy-950);
  letter-spacing: -0.01em;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.65;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ivy-950);
}

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ivy-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand .mark svg { width: 16px; height: 16px; }

.nav-menu {
  display: contents;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  color: var(--ivy-900);
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--gold-600);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-cta {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  background: var(--ivy-800);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 3px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--ivy-700); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ivy-950);
  margin: 5px 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 100px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top right, rgba(44, 79, 61, 0.07), transparent 60%),
    var(--paper);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  margin: 22px 0 24px;
}
.hero h1 em {
  font-style: italic;
  color: var(--ivy-700);
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 14px 26px;
  border-radius: 3px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn-primary {
  background: var(--ivy-800);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ivy-700); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--line);
  color: var(--ivy-950);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--gold-600); transform: translateY(-1px); }

/* Transcript card - signature element */
.transcript-card {
  background: var(--ivy-950);
  border: 1px solid var(--line-gold);
  border-radius: 6px;
  padding: 28px 26px;
  color: var(--paper);
  position: relative;
}
.transcript-card::before {
  content: 'RESULTS ON FILE';
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--gold-500);
  color: var(--ivy-950);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 2px;
  font-weight: 500;
}
.transcript-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 20px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(250, 247, 240, 0.16);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.transcript-row:last-child { border-bottom: none; }
.transcript-row .who { color: rgba(250, 247, 240, 0.6); }
.transcript-row .score {
  color: var(--gold-300);
  font-size: 1rem;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Section basics ---------- */
section { padding: 96px 0; }
.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  margin-top: 16px;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- About ---------- */
.about { background: var(--paper-dim); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-quote {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-style: italic;
  color: var(--ivy-800);
  line-height: 1.4;
  border-left: 2px solid var(--gold-600);
  padding-left: 24px;
}
.about-copy p { color: var(--ink-soft); margin: 0 0 18px; }
.about-copy p:last-child { margin-bottom: 0; }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.team-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.team-card:hover { border-color: var(--line-gold); transform: translateY(-3px); }

.team-photo {
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, var(--ivy-800), var(--ivy-950));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.team-photo img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 20%;
  position: absolute; inset: 0;
}
.team-photo .monogram {
  font-family: var(--serif);
  font-size: 3.4rem;
  color: var(--gold-300);
  opacity: 0.85;
  z-index: 1;
  display: none;
}
.team-photo .ring {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(227, 211, 172, 0.35);
  border-radius: 4px;
}

.team-body { padding: 22px 22px 26px; }
.team-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ivy-950);
}
.team-school {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--gold-600);
  text-transform: uppercase;
  margin: 4px 0 12px;
}
.team-body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0;
}

.bio-more {
  margin-top: 10px;
}
.bio-more summary {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-600);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  user-select: none;
}
.bio-more summary::-webkit-details-marker { display: none; }
.bio-more summary::after {
  content: '+';
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.2s ease;
}
.bio-more[open] summary::after { transform: rotate(45deg); }
.bio-more[open] summary { margin-bottom: 10px; }
.bio-more summary:hover { color: var(--ivy-800); }
.bio-more p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.bio-more p:last-child { margin-bottom: 0; }

/* ---------- Course Catalog (services) ---------- */
.catalog { background: var(--ivy-950); color: var(--paper); }
.catalog .eyebrow { color: var(--gold-500); }
.catalog .eyebrow::before { background: var(--gold-500); }
.catalog h2 { color: var(--paper); }
.catalog .lede { color: rgba(250, 247, 240, 0.65); }

.catalog-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.tab-btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  background: transparent;
  border: 1px solid rgba(250, 247, 240, 0.25);
  color: rgba(250, 247, 240, 0.7);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab-btn:hover { border-color: var(--gold-500); color: var(--paper); }
.tab-btn.is-active {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--ivy-950);
}

.catalog-table {
  margin-top: 24px;
  border-top: 1px solid rgba(250, 247, 240, 0.15);
}
.catalog-row.is-hidden { display: none; }
.catalog-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(250, 247, 240, 0.15);
  transition: padding-left 0.2s ease;
}
.catalog-row:hover { padding-left: 8px; }
.catalog-code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--gold-500);
  letter-spacing: 0.03em;
}
.catalog-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}
.catalog-level {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgba(250, 247, 240, 0.45);
}
.catalog-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--paper);
  border: 1px solid rgba(250, 247, 240, 0.3);
  padding: 8px 16px;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.catalog-row:hover .catalog-link {
  background: var(--gold-500);
  color: var(--ivy-950);
  border-color: var(--gold-500);
}

.catalog-note {
  margin-top: 28px;
  font-size: 0.88rem;
  color: rgba(250, 247, 240, 0.55);
}

/* ---------- Book Online ---------- */
.book { }
.book-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.book-steps {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  counter-reset: step;
}
.book-steps li {
  counter-increment: step;
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.book-steps li:first-child { padding-top: 0; }
.book-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gold-600);
  flex-shrink: 0;
  padding-top: 2px;
}
.book-steps strong { display: block; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.book-steps span { color: var(--ink-soft); font-size: 0.92rem; }

.form-card {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--gold-600);
}
.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-status {
  font-size: 0.85rem;
  margin: 14px 0 0;
  text-align: center;
  min-height: 1.2em;
}
.form-status.is-success { color: var(--ivy-700); font-weight: 600; }
.form-status.is-error { color: #a13a3a; font-weight: 600; }

/* ---------- Contact ---------- */
.contact { background: var(--paper-dim); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.contact-card {
  background: var(--ivy-950);
  color: var(--paper);
  border-radius: 8px;
  padding: 40px;
}
.contact-card .eyebrow { color: var(--gold-500); }
.contact-card .eyebrow::before { background: var(--gold-500); }
.contact-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.contact-line a { border-bottom: 1px solid rgba(250, 247, 240, 0.3); }
.contact-line a:hover { border-color: var(--gold-500); color: var(--gold-300); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-row .brand { font-size: 1rem; }
.footer-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- Reveal-on-scroll ----------
   Only hides content once JS confirms it can reveal it again
   (html.js is added by an inline script in <head>).
   Without JS, or before it runs, everything stays fully visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-menu { display: none; }
  .nav-menu.open-mobile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    padding: 20px 28px 28px;
    border-bottom: 1px solid var(--line);
  }
  .nav-menu.open-mobile .nav-links {
    flex-direction: column;
    gap: 0;
  }
  .nav-menu.open-mobile .nav-links a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-menu.open-mobile .nav-cta {
    display: inline-flex;
    justify-content: center;
    margin-top: 16px;
  }
  .nav-toggle { display: block; }
  .hero-grid, .about-grid, .book-grid, .contact-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .catalog-row { grid-template-columns: 70px 1fr; }
  .catalog-link { grid-column: 1 / -1; justify-self: start; }
  .form-row-split { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .team-grid { grid-template-columns: 1fr; }
  section { padding: 70px 0; }
  .hero { padding: 60px 0 70px; }
}
