/* Connect Tutoring homepage. Visual standard: homepage/DESIGN.md (B2). */
:root {
  --navy: #133a5e;
  --ink: #18324b;
  --muted: #4a5d70;
  --yellow: #f6cf6a;
  --hand-blue: #2f74d0;
  --paper: #fdfdfb;
  --grid: #e8eef5;
  /* Banner fade: navy until --fade-start, easing to --fade-color at the right edge. */
  --fade-color: #3d74ad;
  --fade-start: 60%;
  --fade-start-phone: 45%;
  --footer-fade-color: #22507e; /* footer fades less: a blue closer to navy */
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
img { display: block; max-width: 100%; }
a { color: var(--ink); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--hand-blue); outline-offset: 3px; }
.banner a:focus-visible, .site-footer a:focus-visible { outline-color: var(--yellow); } /* blue is too faint on navy */
.hand { font-family: Caveat, "Segoe Print", cursive; font-weight: 600; color: var(--hand-blue); }
mark { background: linear-gradient(transparent 55%, var(--yellow) 55%); color: inherit; padding: 0 2px; }
.wrap { width: min(1040px, 100% - 32px); margin: 0 auto; }

/* Navy banner: sticky, with section links on the right. It shrinks (.is-compact, set by the
   inline script) once the page scrolls, keeping the logo and name. */
html { scroll-behavior: smooth; }
main section[id] { scroll-margin-top: 84px; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: linear-gradient(90deg, var(--navy) var(--fade-start), var(--fade-color) 100%); color: #fff; padding: max(22px, env(safe-area-inset-top)) 0 22px; transition: padding .25s; }
.banner .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 28px; }
.brand { display: flex; align-items: center; gap: 22px; color: #fff; text-decoration: none; }
.banner img { width: 112px; height: 112px; border-radius: 50%; border: 4px solid #fff; flex: none; transition: width .25s, height .25s, border-width .25s; }
.banner .name { display: block; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; line-height: 1.15; letter-spacing: .01em; transition: font-size .25s; }
.banner .hand { display: block; max-height: 3.4em; overflow: hidden; color: var(--yellow); font-size: 1.45rem; transition: max-height .25s, opacity .25s; }
.site-nav { display: flex; gap: 6px 24px; }
.site-nav a { flex: none; padding: 6px 0; color: #fff; font-weight: 700; text-decoration: none; }
.site-nav a:hover { box-shadow: inset 0 -3px 0 var(--yellow); }
.banner-simple { position: static; }
.prose { max-width: 44em; padding: 40px 0 16px; }
.prose h2 { margin-top: 28px; }
.prose ul li { margin-bottom: 8px; }
.form-privacy { flex-basis: 100%; margin: 0; }
.banner.is-compact { padding: max(8px, env(safe-area-inset-top)) 0 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.banner.is-compact img { width: 48px; height: 48px; border-width: 2px; }
.banner.is-compact .name { font-size: 1.3rem; }
.banner.is-compact .hand { max-height: 0; opacity: 0; }
/* Below 1024px the six links no longer fit beside the name, so they get their own row. */
@media (max-width: 1023px) {
  .banner .wrap { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; }
  main section[id] { scroll-margin-top: 134px; }
}

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 40px; align-items: center; padding: 48px 0 28px; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.1; margin: 0 0 16px; }
h1 mark { font-style: italic; }
.phone-break { display: none; }
.lead { font-size: 1.12rem; max-width: 36em; margin: 0; }
.btn { display: inline-block; min-height: 44px; margin-top: 18px; padding: 11px 18px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; }
.btn:hover { background: var(--ink); color: #fff; }
.polaroid { position: relative; margin: 0; background: #fff; padding: 10px 10px 38px; box-shadow: 0 4px 14px rgba(0,0,0,.14); transform: rotate(2deg); }
.polaroid img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 22%; }
.polaroid figcaption { position: absolute; bottom: 4px; left: 14px; font-size: 1.5rem; }

/* Sections */
main section { padding: 28px 0; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 4px; }
p { margin: 0 0 12px; }
ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 4px; }
.courses { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 721px) {
  /* Desktop: five core courses on one row, the two IB courses on a second, both centered. */
  .courses { justify-content: center; row-gap: 0; }
  .courses::before { content: ""; flex-basis: 100%; order: 2; }
  ul.courses li { order: 3; margin-block: 6px; }
  ul.courses li:nth-child(-n+5) { order: 1; }
}
.courses-note { margin: 16px 0 0; color: var(--muted); font-size: .97rem; }
@media (min-width: 721px) { .courses-note { text-align: center; } }
.courses li { margin: 0; padding: 10px 18px; background: #fff; border: 2px solid var(--ink); border-radius: 22px; box-shadow: 3px 3px 0 var(--navy); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 44px; }
.card { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 22px 24px; }
.muted { color: var(--muted); font-size: .97rem; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 16px 18px; margin: 0; }
.steps .hand { display: block; font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.faq { display: grid; gap: 12px; max-width: 46em; }
.faq details { background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; padding: 12px 18px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-family: Caveat, "Segoe Print", cursive; font-size: 1.8rem; line-height: 1; color: var(--hand-blue); }
.faq details[open] summary::after { content: "–"; }
.faq summary:focus-visible { outline: 3px solid var(--hand-blue); outline-offset: 2px; border-radius: 10px; }
.faq details p { margin: 0; padding: 0 18px 16px; }
.about { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 28px 44px; align-items: start; }
/* Desktop: story beside the Bruno snapshot, then the Background box full width. */
.snapshot { grid-column: 2; grid-row: 1; align-self: center; transform: rotate(-2deg); margin: 4px 8px 0; }
.snapshot img { aspect-ratio: 4 / 3; object-position: center; }
.background { grid-column: 1 / -1; grid-row: 2; padding-top: 16px; }
.background ul { columns: 2; column-gap: 44px; }
.background li { break-inside: avoid; }
@media (max-width: 1023px) {
  /* Tablets and phones: story, then the snapshot, then Background. */
  .about { grid-template-columns: 1fr; }
  .snapshot { grid-column: auto; grid-row: auto; order: 1; max-width: 320px; margin: 0 0 4px 6px; }
  .background { grid-column: auto; grid-row: auto; order: 2; }
}
.background h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 12px; }
.background li { margin-bottom: 6px; line-height: 1.4; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin: 18px 0 16px; }
.contact-form .wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; }
.field label span { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--hand-blue); outline-offset: 2px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.form-actions .btn { margin-top: 0; cursor: pointer; font: inherit; font-weight: 700; }
.form-actions .btn:disabled { opacity: .6; cursor: wait; }
.form-status { margin: 0; font-weight: 700; }
.form-status.ok { color: #1f6b3a; }
.form-status.error { color: #a12a2a; }

/* Footer */
.site-footer { margin-top: 32px; padding: 36px 0 max(24px, env(safe-area-inset-bottom)); background: linear-gradient(90deg, var(--navy) var(--fade-start), var(--footer-fade-color) 100%); color: #fff; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px 44px; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; flex: none; }
.footer-brand .name { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.footer-brand .hand { display: block; color: var(--yellow); font-size: 1.2rem; margin-bottom: 8px; }
.site-footer h2 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: #c9d6e4; margin: 4px 0 10px; }
.site-footer nav a, .social a { display: flex; align-items: center; gap: 10px; min-height: 32px; text-decoration: none; }
.site-footer nav a:hover, .social a:hover { text-decoration: underline; }
.social svg { width: 22px; height: 22px; fill: currentColor; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.25); margin-top: 28px; padding-top: 16px; font-size: .9rem; color: #c9d6e4; }
.footer-legal p { margin: 0 0 4px; }

@media (max-width: 720px) {
  .banner { background: linear-gradient(90deg, var(--navy) var(--fade-start-phone), var(--fade-color) 100%); }
  .site-footer { background: linear-gradient(90deg, var(--navy) var(--fade-start-phone), var(--footer-fade-color) 100%); }
  .banner img { width: 76px; height: 76px; border-width: 3px; }
  .banner .wrap { gap: 10px 14px; }
  .brand { gap: 14px; }
  .site-nav { justify-content: space-between; gap: 8px; font-size: .85rem; }
  /* 44px tap areas; the negative margins keep the visible spacing unchanged. */
  .site-nav a { padding: 11px 4px; margin: -7px -4px; }
  .site-footer nav a, .social a { min-height: 44px; }
  .banner.is-compact img { width: 36px; height: 36px; }
  .banner.is-compact .name { font-size: 1.1rem; }
  .banner.is-compact .wrap { row-gap: 4px; }
  main section[id] { scroll-margin-top: 104px; }
  .banner .hand { font-size: 1.2rem; }
  .phone-break { display: inline; }
  /* Phone: even tiles - three short courses, then two, then each IB course full width. */
  .courses { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .courses li { grid-column: span 2; padding: 10px 6px; text-align: center; font-size: .95rem; }
  .courses li:nth-child(4), .courses li:nth-child(5) { grid-column: span 3; }
  .courses li:nth-child(n+6) { grid-column: span 6; }
  h1 mark { white-space: nowrap; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .polaroid { max-width: 240px; margin-left: 6px; }
  .two, .steps, .about, .contact-form { grid-template-columns: 1fr; }
  .snapshot { max-width: 300px; }
  .background ul { columns: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
/* Narrow phones: a smaller logo and tagline keep the tagline on one line. */
@media (max-width: 374px) {
  .banner img { width: 64px; height: 64px; }
  .brand { gap: 12px; }
  .banner .hand { font-size: 1.1rem; }
  .site-nav { font-size: .8rem; }
  .site-nav a { padding-block: 12px; margin-block: -8px; }
}
/* The narrowest phones: the links wrap onto two centered rows. */
@media (max-width: 340px) {
  .banner .hand { font-size: 1rem; }
  .site-nav { flex-wrap: wrap; justify-content: center; column-gap: 18px; }
  main section[id] { scroll-margin-top: 128px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
