:root {
  --ink: #16202e;
  --ink-soft: #4a5566;
  --paper: #ffffff;
  --paper-alt: #f4f1ec;
  --line: #e2ddd4;
  --brand: #1f3a5f;
  --brand-dark: #142a47;
  /* Accent is the red sandstone of Carlisle Castle, matching the logo. */
  --accent: #a9503c;
  --accent-dark: #8e3f2f;
  --accent-text: #a9503c;
  --link: #1f3a5f;
  --heading: #142a47;
  --field-bg: #ffffff;
  --field-border: #bfb8ac;
  --ok: #2f6b3a;
  --ok-bg: #e7f3e9;
  --error: #a3261b;
  --error-bg: #fbe9e7;
  --radius: 10px;
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

/* Dark mode follows the visitor's system setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e9ee;
    --ink-soft: #a9b3c2;
    --paper: #0f1722;
    --paper-alt: #151f2c;
    --line: #2a3646;
    --brand: #22416b;
    --brand-dark: #16263b;
    --accent-text: #e08a6c;
    --link: #9fc0e8;
    --heading: #f1f3f6;
    --field-bg: #0b121b;
    --field-border: #3a4759;
    --ok: #8fd19e;
    --ok-bg: #16301d;
    --error: #f2a097;
    --error-bg: #3a1a17;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; font-weight: 700; font-size: 1.3rem; color: var(--heading); text-decoration: none; letter-spacing: 0.02em; }
.logo:hover { color: var(--heading); }
.logo-mark { width: 32px; height: 32px; flex: none; margin-right: 10px; }
.logo span { color: var(--accent); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.97rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-text); }

.menu-toggle { display: none; }

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-block; background: none; border: 1px solid var(--line); border-radius: 6px;
    padding: 6px 12px; font: inherit; color: var(--ink); cursor: pointer;
  }
  .site-nav { display: none; width: 100%; padding-bottom: 14px; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 10px; }
}

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: var(--radius); font-weight: 600; border: 0; cursor: pointer; font: inherit; font-weight: 600;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--link); border: 2px solid var(--link); }
.btn-ghost:hover { background: var(--link); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }

/* Sections */
.hero { background: linear-gradient(160deg, var(--brand-dark), var(--brand)); color: #fff; padding: 84px 0 76px; }
.hero h1 { max-width: 18em; }
.hero p.lead { font-size: 1.2rem; max-width: 38em; color: #dfe6f0; }
.hero .btn-ghost { color: #fff; border-color: #fff; }
.hero .btn-ghost:hover { background: #fff; color: var(--brand-dark); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--accent-text); margin-bottom: 0.8em; }
.hero .eyebrow { color: #f0b49a; }

.page-head { background: var(--paper-alt); padding: 60px 0 48px; border-bottom: 1px solid var(--line); }
.page-head p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40em; }

section.block { padding: 64px 0; }
section.alt { background: var(--paper-alt); }

.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column;
}
.card p { color: var(--ink-soft); }
.card .more { margin-top: auto; font-weight: 600; text-decoration: none; }
.card .tag { font-size: 0.8rem; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4em; }

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { padding-left: 1.6em; position: relative; margin-bottom: 0.5em; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-text); font-weight: 700; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 10px; }

.cta-band { background: var(--brand-dark); color: #fff; padding: 56px 0; text-align: center; }
.cta-band p { color: #dfe6f0; max-width: 36em; margin: 0 auto 1.4em; }

.two-col { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1.4fr 1fr; } }

/* Form */
.form { display: grid; gap: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--field-bg); color: var(--ink);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(169, 80, 60, 0.35); border-color: var(--accent); }
.field .error { color: var(--error); font-size: 0.9rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.row-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 14px 16px; border-radius: 8px; }
.notice.error { background: var(--error-bg); color: var(--error); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
[hidden] { display: none !important; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--ink-soft); font-size: 0.93rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; }
.site-footer a { color: var(--ink-soft); }

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; }

/* Course pages */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.notice.byo { background: var(--paper-alt); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 24px 26px; }
.notice.byo h2 { font-size: 1.4rem; }
.notice.byo p:last-child { margin-bottom: 0; }
.price-card .price { color: var(--heading); margin-bottom: 0.6em; }
.price-card .now { font-size: 2rem; font-weight: 700; }
.price-card .unit { color: var(--ink-soft); margin-left: 6px; }
.price-card .btn { margin-top: auto; align-self: flex-start; }
.small { font-size: 0.93rem; color: var(--ink-soft); margin-top: 1.4em; }
.card.featured { border: 2px solid var(--accent); }
.card.featured p:not(.tag) { color: var(--ink); }
.warn-icon { flex: none; color: var(--accent); }
.notice.byo h2 { display: flex; align-items: center; gap: 10px; }
.notice.byo h2 .warn-icon { width: 1.2em; height: 1.2em; }
.byo-line { display: flex; align-items: flex-start; gap: 8px; }
.byo-line .warn-icon { margin-top: 0.2em; }
