:root {
  --sky-deep: #1e5ea8;
  --sky: #3a8ad4;
  --sky-hot: #7ec4f4;
  --ink: #1b140f;
  --ink-soft: #3a2f28;
  --paper: rgba(255, 248, 232, 0.92);
  --paper-solid: #fff6e4;
  --wood: #241910;
  --wood-edge: #3a2a1c;
  --moss: #6ea53a;
  --bloom: #3b62e8;
  --link: #143d8c;
  --warn: #7a1f14;
  --radius: 14px;
  --measure: 42rem;
  --header-h: 4.25rem;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 20;
  padding: 0.6rem 0.85rem;
  background: var(--paper-solid);
  color: var(--ink);
  min-height: 44px;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid #c9a45c;
  outline-offset: 2px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background-color: var(--sky-deep);
  background-image: url("/tree-bg.svg");
  background-size: cover;
  background-position: center right;
  background-attachment: fixed;
  background-repeat: no-repeat;
  line-height: 1.6;
  font-size: 1.0625rem;
}

#sky-tree {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.eave {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    #1a120c 0 10px,
    #2b1d14 10px 12px,
    #3a281c 12px 22px,
    #1f150f 22px 24px
  );
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.eave-top {
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  border-bottom: 4px solid #0e0a07;
}

.eave-left,
.eave-right {
  top: 0;
  width: 14px;
  height: 100%;
  background: linear-gradient(#1a120c, #2a1c12);
}

.eave-left {
  left: 0;
}
.eave-right {
  right: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 3;
}

.site-header {
  z-index: 6;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.75rem 1.25rem 0.75rem 1.5rem;
  background: linear-gradient(180deg, rgba(22, 14, 10, 0.92), rgba(22, 14, 10, 0.78));
  color: #f3e6c8;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}

.mark-kana {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border: 2px solid #c9a45c;
  padding: 0.45rem 0.5rem;
  color: #e8d7a4;
}

.mark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.mark-text strong {
  font-weight: 600;
  font-size: 1rem;
}

.mark-text em {
  font-style: normal;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #cbb892;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid #c9a45c;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: #e8d7a4;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  color: #f3e6c8;
  text-decoration: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 248, 232, 0.14);
}

.site-nav a[aria-current="page"] {
  outline: 1px solid #c9a45c;
}

main {
  width: min(100% - 1.5rem, 46rem);
  margin: 1.5rem auto 3rem;
  background: var(--paper);
  border: 1px solid rgba(36, 25, 16, 0.18);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 2rem;
  box-shadow: 0 18px 50px rgba(12, 28, 48, 0.28);
}

@media (min-width: 768px) {
  main {
    padding: 2.25rem 2.5rem 2.75rem;
    margin-top: 2rem;
  }
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  margin: 0 0 0.85rem;
}

h2 {
  font-size: 1.28rem;
  margin: 2rem 0 0.6rem;
}

h3 {
  font-size: 1.08rem;
  margin: 1.4rem 0 0.4rem;
}

p,
li {
  color: var(--ink-soft);
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration-thickness: 2px;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink);
}

.kicker {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bloom);
  margin: 0 0 0.5rem;
}

.disclaimer,
.callout {
  border-left: 4px solid var(--warn);
  background: #f8e6d8;
  padding: 0.9rem 1rem;
  margin: 1.25rem 0 1.5rem;
}

.callout {
  border-left-color: var(--bloom);
  background: #e7eef8;
}

.meta-row {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #5c4e40;
  margin-bottom: 1.25rem;
}

ul,
ol {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.45rem;
}

.cards {
  display: grid;
  gap: 0.8rem;
  margin: 1.25rem 0;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper-solid);
  border: 1px solid rgba(36, 25, 16, 0.16);
  border-radius: 10px;
  padding: 1rem;
  min-height: 44px;
}

.card:hover {
  border-color: var(--bloom);
}

.card strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.card span {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.faq details {
  border-bottom: 1px solid rgba(36, 25, 16, 0.12);
  padding: 0.4rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-footer {
  background: rgba(16, 10, 7, 0.92);
  color: #ead9b6;
  padding: 1.75rem 1.25rem 2.5rem;
}

.site-footer p {
  color: #d9c59a;
  max-width: 46rem;
  margin: 0 auto 0.8rem;
}

.site-footer nav {
  max-width: 46rem;
  margin: 1rem auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.site-footer a {
  color: #f3e6c8;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.55rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.fine {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.7rem !important;
  color: #9a8866 !important;
}

.source-list a {
  overflow-wrap: anywhere;
}

.crumbs {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin: 0 0 1.15rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(36, 25, 16, 0.14);
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.crumbs li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: #5c4e40;
}

.crumbs li + li::before {
  content: "/";
  color: rgba(36, 25, 16, 0.32);
}

.crumbs a {
  color: var(--link);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.crumbs [aria-current="page"] {
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.6rem;
  border: 1px solid rgba(36, 25, 16, 0.16);
  border-radius: 10px;
  background: var(--paper-solid);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-wrap caption {
  caption-side: top;
  text-align: left;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5c4e40;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(36, 25, 16, 0.14);
}

.table-wrap thead th {
  background: rgba(59, 98, 232, 0.13);
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid rgba(36, 25, 16, 0.24);
}

.table-wrap th,
.table-wrap td {
  padding: 0.6rem 0.8rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(36, 25, 16, 0.1);
  color: var(--ink-soft);
  line-height: 1.45;
}

.table-wrap tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
}

.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.table-wrap tbody tr:hover {
  background: rgba(255, 248, 232, 0.75);
}

.table-wrap .claims {
  min-width: 42rem;
}

.table-wrap .claims th,
.table-wrap .claims td {
  min-width: 8rem;
}

.table-wrap .claims th:first-child,
.table-wrap .claims td:first-child {
  min-width: 11rem;
}

.table-wrap .claims td:last-child,
.table-wrap .claims th:last-child {
  min-width: 20rem;
}

.table-wrap .timeline {
  min-width: 24rem;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(36, 25, 16, 0.08);
  padding: 0.08em 0.32em;
  border-radius: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

@media (max-width: 430px) {
  .table-wrap th,
  .table-wrap td {
    padding: 0.55rem 0.6rem;
  }
}

@media (max-width: 1120px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 14px;
    right: 14px;
    z-index: 8;
    background: #1a120c;
    border: 1px solid #c9a45c;
    flex-direction: column;
    padding: 0.4rem;
  }

  .site-nav.is-open {
    display: flex;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 1rem;
    background-attachment: scroll;
  }

  main {
    width: min(100% - 1rem, 46rem);
    padding: 1.15rem 0.95rem 1.6rem;
  }

  .eave-left,
  .eave-right {
    width: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
