/* Caledonian Language School — Edinburgh English-learning resource
   Theme: Scottish heritage academic — deep navy + Saltire blue + warm amber.
   Fraunces (serif display) + Source Sans 3 (body). Custom grid, no CSS framework. */

:root {
  --navy: #15263f;
  --navy-800: #1c3252;
  --navy-700: #24405f;
  --blue: #2766a8;
  --blue-600: #21598f;
  --blue-050: #eaf1f8;
  --amber: #d0983a;
  --amber-dark: #b57e26;
  --thistle: #6b4f8a;

  --text: #212f3d;
  --text-light: #566575;
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --bg-warm: #faf7f1;
  --line: #e2e7ee;

  --maxw: 1140px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(21,38,63,.08), 0 1px 2px rgba(21,38,63,.06);
  --shadow: 0 10px 30px rgba(21,38,63,.10);
  --shadow-lg: 0 24px 60px rgba(21,38,63,.18);

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 18px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.18; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin: 1.8em 0 .55em; }
h3 { font-size: 1.25rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--amber); color: var(--navy);
  padding: 10px 16px; z-index: 200; border-radius: 0 0 var(--radius-sm) 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  border-bottom: 3px solid var(--amber);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px;
  background: linear-gradient(140deg, var(--blue) 0%, var(--thistle) 100%);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-head); color: #fff; font-weight: 600; font-size: 1.12rem; }
.brand__tag { color: #a9bcd6; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }

.nav__toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 1rem;
}
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: #dce6f2; font-weight: 600; font-size: .95rem; padding: 8px 12px;
  border-radius: 8px; text-decoration: none; transition: background .15s, color .15s;
}
.nav__links a:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
.nav__links a.is-active { color: #fff; background: var(--navy-800); box-shadow: inset 0 -2px 0 var(--amber); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--navy); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__overlay {
  position: relative;
  background: linear-gradient(180deg, rgba(15,26,45,.62) 0%, rgba(15,26,45,.78) 100%);
}
.hero--plain .hero__overlay {
  background: radial-gradient(120% 140% at 15% 0%, var(--navy-700) 0%, var(--navy) 60%);
}
.hero__inner { max-width: 780px; padding: 74px 0 66px; color: #fff; }
.hero h1 { color: #fff; }
.hero .lede { font-size: 1.24rem; color: #eaf1fa; margin-bottom: 1.4em; max-width: 42ch; }
.hero--home .hero__inner { padding: 104px 0 92px; max-width: 820px; }
.hero--home h1 { font-size: clamp(2.5rem, 5.6vw, 3.8rem); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Buttons */
.btn {
  display: inline-block; font-weight: 700; font-family: var(--font-body);
  padding: 13px 26px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s, box-shadow .12s, background .15s;
  font-size: 1rem;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--amber); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: #e0a94a; color: var(--navy); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Main / Article ---------- */
main { display: block; }
.page { padding: 46px 0 30px; }
.article { max-width: 760px; margin: 0 auto; }
.article > p:first-of-type { font-size: 1.05rem; }
.article .lede {
  font-size: 1.22rem; color: var(--navy-800); font-weight: 500;
  border-left: 4px solid var(--amber); padding-left: 18px; margin: 0 0 1.4em;
}
.article h2 {
  position: relative; padding-top: .2em;
}
.article h2::after {
  content: ""; display: block; width: 54px; height: 3px; background: var(--amber);
  margin-top: .35em; border-radius: 2px;
}
.article ul, .article ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.article li { margin: .35em 0; }
.article a { border-bottom: 1px solid rgba(39,102,168,.28); }
.article a:hover { border-bottom-color: var(--blue-600); }

/* Contact form */
.contact-form { display: grid; gap: 6px; max-width: 560px; margin: 1.2em 0 1.6em; }
.contact-form label { font-weight: 600; color: var(--navy-800); font-size: .95rem; margin-top: .5em; }
.contact-form input, .contact-form textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-alt); width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-050);
}
.contact-form button {
  justify-self: start; margin-top: 14px; background: var(--blue); color: #fff;
  border: none; padding: 12px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.contact-form button:hover { background: var(--blue-600); }

/* ---------- Feature strip (home) ---------- */
.strip { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip .container { padding-top: 52px; padding-bottom: 52px; }
.strip__head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.strip__head h2 { margin-top: 0; }
.strip__head p { color: var(--text-light); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon {
  width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center;
  background: var(--blue-050); color: var(--blue); font-size: 1.4rem; margin-bottom: 14px;
}
.card h3 { margin: 0 0 .4em; color: var(--navy); }
.card p { margin: 0 0 .6em; color: var(--text-light); font-size: .98rem; }
.card a { font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c6d3e4; margin-top: 40px; }
.site-footer a { color: #d7e2f0; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px;
  padding: 54px 0 30px;
}
.footer-brand .brand__name { font-size: 1.2rem; }
.footer-blurb { color: #9fb2ca; margin-top: 12px; max-width: 34ch; font-size: .96rem; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: .5em 0; }
.footer-col a { text-decoration: none; font-size: .97rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0 26px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  color: #8ea4c0; font-size: .86rem;
}
.footer-bottom p { margin: 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 90px 0 70px; max-width: 620px; margin: 0 auto; }
.notfound .big { font-family: var(--font-head); font-size: 5rem; color: var(--amber); margin: 0; line-height: 1; }

/* ---------- Entrance animation (CSS-only, ends visible) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero__inner { animation: rise .6s ease both; }
@media (prefers-reduced-motion: reduce) { .hero__inner { animation: none; } html { scroll-behavior: auto; } }

/* Safeguard: never let any reveal markup hide content waiting on JS */
[data-aos] { opacity: 1 !important; transform: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav__toggle { display: inline-block; }
  .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--navy-800); padding: 10px 14px 16px; border-bottom: 3px solid var(--amber);
  }
  .nav { position: relative; }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 12px; }
  .hero__inner { padding: 56px 0 48px; }
  .hero--home .hero__inner { padding: 66px 0 56px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
