:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #e9e1d2;
  --ink: #182329;
  --muted: #5f6b6d;
  --line: #c9c1b4;
  --accent: #bc3f2f;
  --accent-dark: #8f2c21;
  --blue: #315f72;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgb(45 40 32 / 10%);
  font-family: Georgia, "Times New Roman", serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 31px, rgb(188 63 47 / 9%) 32px, transparent 33px),
    linear-gradient(var(--paper-deep) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 100%, 100% 32px, auto;
  line-height: 1.62;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid rgb(49 95 114 / 45%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(244 240 231 / 92%);
  backdrop-filter: blur(12px);
}

.header-inner,
.page-shell,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--accent);
  background: var(--white);
  font-size: 1.2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
}

.page-shell {
  padding-block: 4rem 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: 520px;
  padding-block: 2rem 4rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--blue);
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.1rem, 9vw, 7.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.page-title {
  max-width: 15ch;
  font-size: clamp(2.8rem, 7vw, 6.2rem);
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
}

.hero-copy {
  max-width: 57ch;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.glyph-poster {
  position: relative;
  display: grid;
  min-height: 390px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50% 50% 8px 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.glyph-poster::before,
.glyph-poster::after {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
}

.glyph-poster::before {
  width: 72%;
  aspect-ratio: 1;
}

.glyph-poster::after {
  width: 46%;
  aspect-ratio: 1;
}

.poster-glyph {
  z-index: 1;
  color: var(--accent);
  font-size: clamp(8rem, 20vw, 14rem);
  line-height: 1;
}

.poster-code {
  position: absolute;
  right: 1.5rem;
  bottom: 1.2rem;
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
}

.section {
  padding-block: 4.5rem;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.section-heading p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.category-grid,
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.category-card,
.quick-card,
.note-card {
  border: 1px solid var(--line);
  background: rgb(255 253 248 / 78%);
  box-shadow: 0 10px 24px rgb(45 40 32 / 5%);
}

.category-card {
  min-height: 260px;
  padding: 1.6rem;
  color: inherit;
  text-decoration: none;
}

.category-card:hover {
  color: inherit;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.category-number,
.meta-label {
  color: var(--blue);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-card h3 {
  margin-top: 3.8rem;
  font-size: 1.65rem;
}

.category-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.quick-card {
  position: relative;
  min-height: 190px;
  padding: 1.35rem;
}

.quick-glyph {
  display: block;
  margin-bottom: 1rem;
  font-size: 3.6rem;
  line-height: 1;
}

.quick-card code,
.symbol-table code,
.inline-code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  margin-top: 1rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font: 600 0.78rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--white);
  background: var(--ink);
}

.intro-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.45fr);
  gap: 3rem;
  align-items: end;
  padding-block: 1rem 4rem;
}

.intro-block p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.legend {
  padding: 1.2rem;
  border-left: 3px solid var(--accent);
  background: rgb(255 253 248 / 65%);
  font-size: 0.9rem;
}

.legend p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.symbol-table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, sans-serif;
}

.symbol-table th,
.symbol-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.symbol-table th {
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.symbol-table tr:last-child td {
  border-bottom: 0;
}

.table-glyph {
  min-width: 4.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.sample-box {
  min-width: 8rem;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.invisible-demo {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding-inline: 0.5rem;
  border: 1px dashed var(--blue);
  background: rgb(49 95 114 / 7%);
  white-space: pre;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.note-card {
  padding: 1.5rem;
}

.note-card h3 {
  margin-bottom: 0.75rem;
}

.note-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 3.5rem;
  font-size: 2rem;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 1.05rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.error-page {
  display: grid;
  min-height: 70vh;
  place-items: center;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--accent);
  font-size: clamp(7rem, 25vw, 16rem);
  line-height: 0.8;
}

@media (max-width: 820px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .hero,
  .section-heading,
  .intro-block {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .glyph-poster {
    min-height: 310px;
  }

  .category-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 210px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding-block: 2.5rem 4rem;
  }

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

  .symbol-table th:nth-child(4),
  .symbol-table td:nth-child(4) {
    display: none;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
