/* ==========================================================================
   The Hermetic Order of the Golden Dawn, Alpha et Omega
   Visual system: black ground, red cross, white triangle.
   No JavaScript. Logical properties throughout (RTL-safe for Hebrew).
   ========================================================================== */

/* ---------- Fonts (self-hosted, subset per script) ---------- */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Greek subset — loads only if Greek glyphs appear on the page. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-greek-400-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
    U+03A3-03FF;
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-greek-600-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1,
    U+03A3-03FF;
}

/* Hebrew — loads only if Hebrew glyphs appear on the page (RTL handled via dir). */
@font-face {
  font-family: "Noto Serif Hebrew";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/noto-serif-hebrew-hebrew-400-normal.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #060606;
  --bg-raised: #0c0c0c;
  --line: #1d1d1d;
  --white: #f2efe9;
  --text: #cfcbc2;
  --muted: #918c81;
  --red: #a31621;
  --red-bright: #c8202e;
  --serif: "EB Garamond", "Noto Serif Hebrew", Georgia, "Times New Roman", serif;
  --measure: 42rem;
}

/* ---------- Base ---------- */

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

html {
  scroll-padding-block-start: 5.5rem; /* clear the sticky header on anchor jumps */
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--red);
  color: var(--white);
}

h1,
h2,
h3 {
  color: var(--white);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--red-bright);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
  border-radius: 1px;
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

cite {
  font-style: italic;
}

.wrap {
  inline-size: min(100% - 3rem, 68rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--red);
  color: var(--white);
}

.skip-link:focus {
  inset-block-start: 0.5rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: rgba(6, 6, 6, 0.88);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.875rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.wordmark-mark {
  inline-size: 1.125rem;
}

.wordmark-text {
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--white);
}

.site-nav .nav-apply {
  color: var(--white);
  border: 1px solid var(--red);
  padding: 0.375rem 0.875rem;
}

.site-nav .nav-apply:hover {
  background: var(--red);
}

@media (max-width: 720px) {
  .site-nav a:not(.nav-apply) {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  border-block-end: 1px solid var(--line);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: clamp(4.5rem, 12vh, 8.5rem);
}

.hero-emblem {
  inline-size: clamp(6.5rem, 16vw, 8.75rem);
  margin-block-end: 2.75rem;
}

.hero-eyebrow {
  color: var(--muted);
  font-size: clamp(0.8125rem, 2.4vw, 1rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-block-end: 0.875rem;
}

.hero-title {
  font-size: clamp(2.75rem, 9vw, 5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-sub {
  max-inline-size: 34rem;
  margin-block-start: 1.5rem;
  color: var(--text);
  font-size: clamp(1.0625rem, 2.6vw, 1.1875rem);
}

.hero-cta {
  margin-block-start: 2.75rem;
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  padding: 0.9375rem 2.25rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--red-bright);
  color: #fff;
}

.section-cta {
  text-align: center;
  margin-block-start: clamp(2.5rem, 6vw, 3.5rem);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.section-alt {
  background: var(--bg-raised);
  border-block: 1px solid var(--line);
}

.section-head {
  text-align: center;
  margin-block-end: clamp(2.5rem, 6vw, 3.5rem);
}

.eyebrow {
  color: var(--red-bright);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-block-end: 0.75rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.375rem);
}

.section-head::after {
  content: "";
  display: block;
  inline-size: 3.5rem;
  block-size: 2px;
  background: var(--red);
  margin: 1.5rem auto 0;
}

.prose {
  max-inline-size: var(--measure);
  margin-inline: auto;
}

.prose p + p {
  margin-block-start: 1.25rem;
}

.prose strong {
  color: var(--white);
  font-weight: 600;
}

/* ---------- Lineage timeline ---------- */

.timeline {
  max-inline-size: var(--measure);
  margin: 3rem auto 0;
  border-block-start: 1px solid var(--line);
}

.timeline-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  padding-block: 0.875rem;
  border-block-end: 1px solid var(--line);
}

.timeline dt {
  color: var(--red-bright);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timeline dd {
  margin: 0;
}

@media (max-width: 480px) {
  .timeline-row {
    grid-template-columns: 5rem 1fr;
    gap: 0.875rem;
  }
}

/* ---------- Curriculum grades ---------- */

.grades {
  list-style: none;
  max-inline-size: var(--measure);
  margin: 2.25rem auto;
  padding: 0;
  border-block-start: 1px solid var(--line);
}

.grades li {
  display: grid;
  grid-template-columns: 5.5rem 9.5rem 1fr;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.875rem;
  border-block-end: 1px solid var(--line);
}

.grade {
  color: var(--red-bright);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.grade-name {
  color: var(--white);
  font-weight: 600;
}

.grade-note {
  color: var(--muted);
}

@media (max-width: 560px) {
  .grades li {
    grid-template-columns: 4.5rem 1fr;
  }

  .grade-note {
    grid-column: 2;
  }
}

/* ---------- Application form ---------- */

.apply-form {
  max-inline-size: var(--measure);
  margin: 2.5rem auto 0;
}

.form-note {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-block-end: 1.5rem;
}

.apply-form fieldset {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.5rem;
  margin: 0 0 1.75rem;
}

.apply-form legend {
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  padding-inline: 0.625rem;
}

.field {
  margin-block-end: 1.25rem;
}

.field:last-child {
  margin-block-end: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.field label {
  display: block;
  color: var(--white);
  font-weight: 600;
  margin-block-end: 0.375rem;
}

.opt {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9375rem;
}

.field input,
.field textarea {
  inline-size: 100%;
  background: var(--bg);
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #2a2a2a;
  border-radius: 2px;
  padding: 0.75rem 0.875rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 0;
  border-color: var(--red-bright);
}

.field textarea {
  resize: vertical;
}

.hint {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-block-start: 0.375rem;
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.75rem;
  margin-block-end: 0.875rem;
}

.check:last-child {
  margin-block-end: 0;
}

.check input {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  margin-block-start: 0.3125rem;
  accent-color: var(--red);
}

.check label {
  color: var(--text);
}

/* Honeypot — visually removed, ignored by assistive tech via aria-hidden. */
.hp {
  position: absolute;
  inset-inline-start: -9999px;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.form-actions {
  margin-block-start: 0.5rem;
  text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  border-block-start: 1px solid var(--line);
  padding-block: 3rem;
  text-align: center;
}

.footer-name {
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.footer-note {
  color: var(--muted);
  margin-block-start: 0.5rem;
}

.footer-legal {
  color: var(--muted);
  font-size: 0.875rem;
  margin-block-start: 1.5rem;
}
