/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --parchment: #F5F0E8;
  --parchment-warm: #F0EAE0;
  --navy: #1B2A4A;
  --navy-deep: #111D35;
  --seal-red: #8B2332;
  --gpo-blue: #2B5592;
  --brass: #B8860B;
  --brass-dim: rgba(184, 134, 11, 0.3);
  --ink: #1A1A1A;
  --ink-dim: #4A4A42;
  --ink-light: #6B6B60;
  --border-dark: #2A3A5A;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
  --font-serif: 'Libre Baskerville', 'Georgia', serif;
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-stamp: 'Special Elite', cursive;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--gpo-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h2 {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
  color: inherit;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.section-intro {
  font-family: var(--font-serif);
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 680px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

/* ─── Section Dividers ─── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--parchment);
  position: relative;
  height: 2px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--brass-dim);
}

.section-divider span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brass);
  transform: rotate(45deg);
  margin: 0 16px;
  flex-shrink: 0;
}

/* ─── Document Header Bar ─── */
.doc-header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 10px 24px;
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--brass);
}

@media (max-width: 768px) {
  .doc-header-bar {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    font-size: 0.58rem;
  }
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  position: relative;
  z-index: 2;
}

/* Watermark */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: var(--font-stamp);
  font-size: clamp(4rem, 12vw, 8rem);
  color: rgba(139, 35, 50, 0.08);
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  letter-spacing: 0.15em;
  user-select: none;
}

.watermark.stamp-in {
  animation: stampIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes stampIn {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-25deg) scale(1.5); }
  60% { opacity: 0.12; transform: translate(-50%, -50%) rotate(-25deg) scale(0.97); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-25deg) scale(1); }
}

/* Seal */
.seal {
  width: 140px;
  height: 140px;
  margin: 0 auto 2rem;
  opacity: 0.65;
}

.seal svg { width: 100%; height: 100%; }

.hero-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: #fff;
}

.hero-subtitle-box {
  border: 2px solid rgba(184, 134, 11, 0.3);
  padding: 24px 28px;
  margin-bottom: 0.5rem;
  text-align: left;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.hero-sub:last-child { margin-bottom: 0; }

.hero-cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 14px 32px;
  background: var(--seal-red);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  transition: background 0.2s;
}

.hero-cta:hover {
  text-decoration: none;
  background: #A02B3E;
}

/* ─── How It Worked ─── */
.how-it-worked {
  padding: 80px 0;
  background: var(--parchment);
}

.how-it-worked .section-label { color: var(--gpo-blue); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 2rem;
}

.process-step {
  padding: 0;
  border: 2px solid var(--ink);
  border-top: 6px solid var(--navy);
  background: #fff;
  transition: box-shadow 0.2s;
}

.process-step:hover {
  box-shadow: 4px 4px 0 var(--navy);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  display: inline-block;
  padding: 4px 12px;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

.process-step h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 20px 8px;
  color: var(--ink);
}

.process-step p {
  color: var(--ink-dim);
  font-size: 0.9rem;
  line-height: 1.7;
  padding: 0 20px 20px;
}

/* ─── Principles ─── */
.principles {
  padding: 80px 0;
  background: var(--navy);
  color: #fff;
}

.principles .section-label { color: var(--brass); }
.principles h2 { color: #fff; }

.principles .section-intro { color: rgba(255, 255, 255, 0.6); }

.principles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.principle {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s;
}

.principle:hover { border-color: rgba(184, 134, 11, 0.5); }

.principle-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  cursor: pointer;
  user-select: none;
}

.principle-header:hover { background: rgba(255, 255, 255, 0.03); }

.principle-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seal-red);
  flex-shrink: 0;
}

.principle-header h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
}

.principle-toggle {
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.4);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.3s;
}

.principle.open .principle-toggle {
  transform: rotate(-135deg);
}

.principle-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
  padding: 0 28px;
}

.principle-body.open {
  max-height: 800px;
  padding: 0 28px 28px;
}

.principle-body-inner {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 28px;
}

/* Vertical rule between columns */
.principle-rule {
  background: rgba(184, 134, 11, 0.3);
  width: 1px;
}

.principle-desc p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

blockquote {
  border-left: 3px solid var(--brass);
  padding-left: 16px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.7;
}

.principle-practice h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass);
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.principle-practice ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.principle-practice li {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}

.principle-practice li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--seal-red);
}

/* ─── Modern Issues ─── */
.modern {
  padding: 80px 0;
  background: var(--parchment-warm);
}

.modern .section-label { color: var(--seal-red); }

.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.issue-card {
  position: relative;
  padding: 28px 24px 24px;
  background: #fff;
  border: 2px solid var(--ink);
  border-top: 4px solid var(--seal-red);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.issue-card:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 rgba(27, 42, 74, 0.15);
  border-color: var(--seal-red);
}

.file-tab {
  position: absolute;
  top: -14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--navy);
  color: #fff;
  padding: 3px 10px;
}

.issue-icon {
  width: 40px;
  height: 40px;
  color: var(--navy);
  margin-bottom: 14px;
  opacity: 0.6;
}

.issue-card h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.issue-card p {
  color: var(--ink-dim);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ─── Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 74, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 24px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--parchment);
  border: 2px solid var(--ink);
  max-width: 800px;
  width: 100%;
  position: relative;
  animation: modalIn 0.3s ease;
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header-bar {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: #fff; }

.modal-content {
  padding: 36px 40px 40px;
}

.modal-content h3 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3em;
  color: var(--navy);
}

.modal-content .modal-subtitle {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modal-content h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gpo-blue);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.modal-content h4:first-of-type { margin-top: 0; }

.modal-content p {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 0.8rem;
}

.modal-content ul {
  list-style: none;
  margin-bottom: 1rem;
}

.modal-content li {
  color: var(--ink-dim);
  font-size: 0.88rem;
  line-height: 1.65;
  padding: 5px 0 5px 18px;
  position: relative;
}

.modal-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  background: var(--seal-red);
}

.modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.modal-option {
  padding: 16px 18px;
  border: 2px solid var(--ink);
  background: #fff;
}

.modal-option-letter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--seal-red);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.modal-option strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.modal-option span {
  font-size: 0.82rem;
  color: var(--ink-dim);
  line-height: 1.6;
}

.modal-precedent {
  margin-top: 1.5rem;
  padding: 16px 20px;
  background: rgba(184, 134, 11, 0.08);
  border-left: 3px solid var(--brass);
}

.modal-precedent strong {
  font-size: 0.72rem;
  color: var(--brass);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.modal-precedent span {
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.65;
}

/* ─── Precedents / Archive ─── */
.precedents {
  padding: 80px 0;
  background: var(--navy);
  color: #fff;
}

.precedents .section-label { color: var(--brass); }
.precedents h2 { color: #fff; }
.precedents .section-intro { color: rgba(255,255,255,0.6); }

.precedent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
}

.precedent {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px 24px;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
  transition: background 0.2s;
  text-decoration: none;
}

.precedent:first-child { border-top: 1px dashed rgba(255,255,255,0.12); }

.precedent:hover {
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}

.precedent-year {
  font-family: var(--font-stamp);
  font-size: 1.1rem;
  color: var(--seal-red);
  background: rgba(139, 35, 50, 0.15);
  padding: 4px 8px;
  text-align: center;
  margin-top: 2px;
}

.precedent-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.precedent-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
}

.precedent-desc {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
}

.archive-cta {
  text-align: center;
  margin-top: 2rem;
}

.archive-cta a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brass);
}

/* ─── Apply Checklist ─── */
.apply {
  padding: 80px 0;
  background: var(--parchment);
}

.apply .section-label { color: var(--seal-red); }

.form-wrapper {
  border: 2px solid var(--ink);
  background: #fff;
}

.form-header {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px;
}

.check-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.check-item:last-child { border-bottom: none; }

.check-box {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.check-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gpo-blue);
}

.check-content h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}

.check-content p {
  color: var(--ink-dim);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ─── Footer ─── */
footer {
  padding: 48px 0;
  background: var(--navy-deep);
  text-align: center;
}

.footer-seal {
  margin-bottom: 16px;
}

.footer-seal svg {
  display: inline-block;
}

.footer-rule {
  border: none;
  border-top: 1px solid var(--brass-dim);
  margin: 0 auto 20px;
  max-width: 400px;
}

footer p {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

footer a { color: var(--brass); }

.footer-colophon {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Subtle Paper Texture ─── */
.how-it-worked,
.modern,
.apply {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(0, 0, 0, 0.02) 27px,
      rgba(0, 0, 0, 0.02) 28px
    );
}

.how-it-worked { background-color: var(--parchment); }
.apply { background-color: var(--parchment); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  h2 { font-size: 1.6rem; }

  .principle-body.open .principle-body-inner {
    grid-template-columns: 1fr;
  }

  .principle-body.open .principle-rule { display: none; }

  .precedent { grid-template-columns: 60px 1fr; }

  .modal-content { padding: 24px 20px 28px; }
  .modal-options { grid-template-columns: 1fr; }

  .process-grid { grid-template-columns: 1fr; }

  .seal { width: 100px; height: 100px; }

  .form-header {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .hero-subtitle-box { padding: 16px 18px; }
}

@media (max-width: 480px) {
  .doc-header-bar span:nth-child(3) { display: none; }
  h2 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.8rem; }
  .issues-grid { grid-template-columns: 1fr; }
}
