:root {
  --ink: #172033;
  --muted: #3d4654;
  --blue: #0b53a2;
  --blue-deep: #08356b;
  --navy: #071e3d;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #ddd4c4;
  --warn: #8a3d2f;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
h1 {
  font-size: clamp(2rem, 5vw, 4.15rem);
  margin: 0 0 14px;
  max-width: min(14em, 100%);
  overflow-wrap: break-word;
}
h2 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); margin: 0 0 12px; }
h3 { font-family: var(--sans); font-size: 1.05rem; letter-spacing: 0; margin: 1.15em 0 0.35em; }
p { margin: 0 0 0.9em; }

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
  z-index: 80;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spine { display: none; }
@media (min-width: 1320px) {
  .spine {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 42px;
    align-items: center;
    justify-content: center;
    margin: 0;
    pointer-events: none;
  }
  .spine span {
    transform: rotate(-90deg);
    letter-spacing: 0.38em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--blue);
    white-space: nowrap;
  }
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.mast {
  background: var(--paper);
  border-top: 8px solid var(--blue);
}

.mast-top-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.mast-top-inner p { margin: 0; }

.age {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 0 5px;
  margin-right: 6px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.mast-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand img { width: 52px; height: 52px; flex: none; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.mast-cta { display: flex; gap: 8px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--blue);
  line-height: 1;
  cursor: pointer;
}
.btn-solid { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-solid:hover { background: var(--blue-deep); }
.btn-ghost:hover { background: #e7f0fa; }

.index-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  border-top: 1px solid var(--ink);
  border-bottom: 4px solid var(--blue);
}
.index-nav a {
  color: inherit;
  text-decoration: none;
  padding: 12px 14px;
  white-space: nowrap;
  min-height: 48px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}
.index-nav a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--blue);
  font-weight: 700;
}
.index-nav a:hover { background: rgba(11, 83, 162, 0.06); }

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin: 0 0 8px;
}

.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  max-width: 38em;
  color: #243044;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  grid-template-areas:
    "copy ticket"
    "ledger ledger";
  gap: 28px 36px;
  align-items: start;
  padding: 28px 0 10px;
}
.hero-copy { grid-area: copy; min-width: 0; }
.hero .ticket { grid-area: ticket; }
.ledger { grid-area: ledger; }

.ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 22px;
  list-style: none;
  padding: 0;
  margin: 6px 0 10px;
}
.ledger a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 2px solid var(--ink);
  text-decoration: none;
  color: inherit;
  min-height: 48px;
}
.ledger a:hover strong { color: var(--blue); }
.ledger .num {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--blue);
  line-height: 1;
}
.ledger-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ledger-text span { color: var(--muted); font-size: 0.92rem; }

.ticket {
  background: var(--card);
  border: 1px solid var(--ink);
  padding: 18px 18px 16px;
  box-shadow: 6px 6px 0 var(--blue);
  margin: 0 8px 8px 0;
}
.ticket-no {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin: 0 0 8px;
}
.ticket h2 { font-size: 1.85rem; }
.ticket p { margin: 0 0 14px; }
.ticket-foot { font-size: 0.84rem; color: var(--muted); margin: 12px 0 0; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ticket-compact .ticket-actions { flex-direction: column; }
.ticket-compact .btn { width: 100%; }

.chapter {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px 18px;
  padding-top: 26px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 18px;
}
.chapter > div { max-width: 68ch; min-width: 0; }
.chap-no {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--blue);
  line-height: 1;
}
.chapter p,
.chapter li { overflow-wrap: break-word; }
.chapter ul,
.chapter ol { padding-left: 1.15rem; }
.chapter li { margin: 0.35em 0; }
.chapter a { text-underline-offset: 3px; }

.pull {
  margin: 20px 0;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--blue);
  font-family: var(--serif);
  font-size: 1.42rem;
  line-height: 1.28;
}
.pull p { margin: 0; }

.note {
  background: var(--card);
  border-left: 4px solid var(--warn);
  padding: 12px 14px;
  margin: 16px 0;
}
.note p { margin: 0; }

.table-wrap { overflow-x: auto; margin: 8px 0 18px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 0.98rem; }
caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 0 0 8px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  border-bottom: 2px solid var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.crumbs { margin: 22px 0 6px; font-size: 0.92rem; }
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.sheet-head { padding: 8px 0 6px; }
.sheet-head h1 { max-width: 16em; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px 42px;
  align-items: start;
  margin-top: 8px;
}
.prose, .rail { min-width: 0; }
@media (min-width: 901px) {
  .rail { position: sticky; top: 16px; }
}

.toc { margin-top: 18px; }
.toc-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.toc a:hover { color: var(--blue); }

.related { list-style: none; padding: 0; margin: 0; }
.related a { display: inline-block; padding: 7px 0; }

.faq { margin-top: 36px; max-width: 68ch; scroll-margin-top: 18px; }
.faq dt {
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  margin-top: 1.05em;
}
.faq dd { margin: 0.35em 0 0; }

.band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 42px 8px 12px 0;
  padding: 22px;
  background: var(--blue);
  color: #fff;
  box-shadow: 6px 6px 0 var(--navy);
  scroll-margin-top: 18px;
}
.band h2,
.band p,
.band .kicker { color: #fff; }
.band h2 { font-size: clamp(1.45rem, 2vw, 1.9rem); max-width: 16em; }
.band p:last-child { margin: 0; }
.band .btn-solid { background: #fff; color: var(--blue); border-color: #fff; }
.band .btn-solid:hover { background: var(--paper); }
.band .btn-ghost { color: #fff; border-color: #fff; background: transparent; }
.band .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: var(--paper);
  margin-top: 48px;
}
.site-footer::before {
  content: "Tümbet";
  position: absolute;
  right: -2vw;
  bottom: -7vw;
  font-family: var(--serif);
  font-size: 18vw;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 239, 230, 0.16);
  pointer-events: none;
  white-space: nowrap;
}
.foot-grid,
.foot-base { position: relative; z-index: 1; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 1fr;
  gap: 28px;
  padding: 42px 0 20px;
}
.site-footer a { color: var(--paper); }
.site-footer p { color: #e6e0d4; }
.brand-on-dark,
.brand-on-dark strong { color: var(--paper); }
.brand-on-dark small { color: #c9d3e2; }
.foot-nav { display: grid; align-content: start; gap: 2px; }
.foot-nav a {
  text-underline-offset: 3px;
  padding: 4px 0;
  min-height: 36px;
}
.foot-base {
  border-top: 1px solid rgba(243, 239, 230, 0.2);
  padding: 14px 0 28px;
  font-size: 0.9rem;
}

.dock { display: none; }

.empty-title { margin-top: 28px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 28px; }
.empty-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "ticket"
      "ledger";
  }
  .ledger { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; order: -1; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .mast-cta { display: none; }
  h1 { font-size: 2rem; }
  .ticket, .band { margin-right: 0; }
  .dock .btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 10px;
    font-size: 1rem;
  }
  .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 40;
    display: flex;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--ink);
  }
  .dock .btn { flex: 1; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .band { flex-direction: column; align-items: stretch; }
  .ledger { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 0; }
  .chap-no { margin: 0 0 6px; }
  .brand strong { font-size: 1.45rem; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 28px); }
  .index-nav a { padding: 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .dock, .mast-cta, .spine, .ticket, .band { display: none !important; }
  body { background: #fff; padding: 0; }
  .site-footer { background: #fff; color: #000; }
  .site-footer::before { display: none; }
  a { color: #000; }
}
