:root {
  --ink: #14213d;
  --muted: #566078;
  --paper: #f5f7fb;
  --white: #ffffff;
  --line: #dfe4ee;
  --blue: #1746d1;
  --blue-dark: #0e2f99;
  --cyan: #00a7c4;
  --green: #087f5b;
  --red: #b42318;
  --shadow: 0 18px 60px rgba(20, 33, 61, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-dark); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #f8bc3b; outline-offset: 3px; }

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 4rem);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.site-footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; }

.brand { color: var(--ink); font-weight: 850; letter-spacing: -0.03em; text-decoration: none; font-size: 1.25rem; }
.brand span { color: var(--blue); font-weight: 650; }
.text-link { font-weight: 700; text-decoration: none; }

.landing { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem) 5rem; }
.hero { padding: clamp(5rem, 12vw, 9rem) 0; max-width: 870px; }
.hero h1, .guide-intro h1, .error-page h1 { margin: 0.15em 0 0.25em; font-size: clamp(2.7rem, 7vw, 6.6rem); line-height: 0.97; letter-spacing: -0.055em; }
.guide-intro h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.lead { color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 760px; }
.eyebrow { color: var(--blue); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }

.section { padding: 3rem 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 1.5rem; }
.section-heading.compact { align-items: center; }
h2 { margin: 0.15em 0 0.6em; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.035em; }
h3 { line-height: 1.25; letter-spacing: -0.018em; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.event-card { padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.event-card h3 { font-size: 1.6rem; margin: 1rem 0 0.4rem; }
.event-card p { color: var(--muted); }
.event-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.event-meta span { color: var(--blue); }
.card-link { display: inline-flex; gap: 0.45rem; margin-top: 0.6rem; font-weight: 800; text-decoration: none; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.8rem; padding: 0.65rem 1rem; border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { color: var(--white); background: var(--blue); }
.button-primary:hover { color: var(--white); background: var(--blue-dark); }
.button-secondary { color: var(--ink); background: var(--white); border-color: var(--line); }

.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 840px); justify-content: center; gap: clamp(2rem, 6vw, 6rem); padding: 4rem clamp(1.25rem, 4vw, 4rem) 7rem; }
.guide-nav { position: sticky; top: 2rem; align-self: start; }
.guide-nav nav { display: grid; border-left: 1px solid var(--line); }
.guide-nav nav a { padding: 0.48rem 1rem; color: var(--muted); font-weight: 700; text-decoration: none; }
.guide-nav nav a:hover { color: var(--blue); background: var(--white); }
.guide-intro { padding-bottom: 2.5rem; }
.guide-section { position: relative; padding: 3rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.step-number { margin: 0 0 0.35rem; color: var(--cyan); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.13em; }

.notice { margin: 1.5rem 0; padding: 1.1rem 1.25rem; border-left: 4px solid var(--cyan); border-radius: 0 12px 12px 0; background: #eafaff; }
.notice-important { border-color: #f8bc3b; background: #fff8e6; }
.notice p { margin: 0.35rem 0 0; }

.steps { padding-left: 1.4rem; }
.steps li { margin: 0 0 1rem; padding-left: 0.35rem; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.rule-card { padding: 1.25rem 1.35rem; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.rule-card.allowed { border-top: 4px solid var(--green); }
.rule-card.blocked { border-top: 4px solid var(--red); }
.rule-card h3 { margin-top: 0; }
.rule-card ul { margin-bottom: 0; padding-left: 1.25rem; }
.rule-card li { margin: 0.35rem 0; }

code { padding: 0.12em 0.33em; border-radius: 5px; background: #e9edf5; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.9em; }
pre { overflow: auto; margin: 1rem 0; border-radius: 14px; }
pre code { display: block; padding: 1.35rem; background: transparent; font-size: 0.86rem; line-height: 1.65; white-space: pre-wrap; }
.prompt { color: #eaf0ff; background: #111a31; box-shadow: var(--shadow); }
.tree { color: var(--ink); background: var(--white); border: 1px solid var(--line); }
.small { color: var(--muted); font-size: 0.88rem; }

.checklist { display: grid; gap: 0.7rem; }
.checklist label { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.checklist input { width: 1.15rem; height: 1.15rem; margin-top: 0.18rem; accent-color: var(--blue); }
.sources ul { padding-left: 1.2rem; }

.error-page { max-width: 760px; margin: 12vh auto; padding: 2rem; }
.error-page p:not(.eyebrow) { color: var(--muted); font-size: 1.2rem; }

@media (max-width: 800px) {
  .guide-layout { grid-template-columns: 1fr; padding-top: 2rem; }
  .guide-nav { position: static; }
  .guide-nav nav { grid-template-columns: repeat(2, 1fr); border-left: 0; }
  .rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header, .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading.compact { align-items: flex-start; }
  .guide-nav nav { grid-template-columns: 1fr; }
  .event-meta { flex-direction: column; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
