@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600&family=Source+Serif+4:ital,wght@0,400;1,400&display=swap');

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

:root {
  --ink: #1a1a18;
  --ink-mid: #4a4a44;
  --ink-light: #8a8a80;
  --cream: #faf9f5;
  --warm-white: #f4f2ec;
  --rule: #d8d4c8;
  --accent: #c4401c;
  --accent-light: #f9ede8;
  --link-blue: #1a4a7a;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --body-serif: 'Source Serif 4', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links a {
  display: block;
  padding: 0 1rem;
  height: 56px;
  line-height: 56px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

.nav-links a.active {
  border-bottom: 2px solid var(--accent);
}

/* ── HERO (home only) ── */
.hero {
  border-bottom: 1px solid var(--rule);
  padding: 5rem 2rem 4rem;
  max-width: 960px;
  margin: 0 auto;
}

.hero-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-family: var(--body-serif);
  font-size: 1.1rem;
  color: var(--ink-mid);
  max-width: 580px;
  line-height: 1.75;
}

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 2rem 2.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.page-hero .kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── MAIN CONTENT ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

/* ── HOME SECTIONS ── */
.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.about-section p {
  font-family: var(--body-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-mid);
}

.about-section h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.principle-block {
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.principle-block h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.principle-block .section-sub {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
}

.principle-card .num {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.6rem;
}

.principle-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.principle-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.65;
}

/* ── SUBJECT CARDS ── */
.subjects-section {
  padding: 3rem 0;
}

.subjects-section h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.subjects-section .section-sub {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.subject-card {
  display: block;
  border: 1px solid var(--rule);
  background: var(--warm-white);
  padding: 1.75rem 2rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.subject-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.subject-card .tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.subject-card h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.subject-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.55;
}

.subject-card .arrow {
  position: absolute;
  right: 1.75rem;
  bottom: 1.75rem;
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

.subject-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── WORKSHEET TABLE ── */
.worksheet-section {
  padding: 3rem 0 0;
}

.worksheet-section h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.worksheet-section h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.worksheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.worksheet-table thead {
  border-bottom: 1.5px solid var(--ink);
}

.worksheet-table thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 0 0 0.6rem;
}

.worksheet-table thead th:first-child {
  width: 130px;
}

.worksheet-table thead th:last-child {
  width: 240px;
}

.worksheet-table tbody tr {
  border-bottom: 1px solid var(--rule);
}

.worksheet-table tbody tr:last-child {
  border-bottom: none;
}

.worksheet-table tbody td {
  padding: 0.85rem 0;
  vertical-align: top;
  color: var(--ink-mid);
}

.worksheet-table tbody td:first-child {
  padding-right: 1.5rem;
}

.worksheet-table tbody td:last-child {
  font-size: 0.85rem;
  color: var(--ink-light);
  font-style: italic;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--link-blue);
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 4px 10px;
  transition: background 0.15s, color 0.15s;
}

.pdf-link:hover {
  background: var(--link-blue);
  color: #fff;
}

.pdf-link::before {
  content: '↓';
  font-style: normal;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 2rem;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

footer p {
  font-size: 0.82rem;
  color: var(--ink-light);
}

footer a {
  color: var(--ink-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── COPYRIGHT SECTION ── */
.copyright-section {
  padding: 3rem 0 0;
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
}

.copyright-section h2 {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.copyright-section p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  max-width: 620px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .about-section { grid-template-columns: 1fr; gap: 2rem; }
  .principle-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .subject-grid { grid-template-columns: 1fr; }
  .nav-links a { padding: 0 0.6rem; font-size: 0.78rem; }
  .worksheet-table thead th:last-child { display: none; }
  .worksheet-table tbody td:last-child { display: none; }
}
