/*
 * theology.techatpt.com — a filing drawer of index cards.
 *
 * One drawer, pulled open. Behind the main card, a stack of tabbed cards
 * rises toward the back (the division, the apps); in front of it, a lower
 * stack holds the paperwork (privacy, terms, refunds). A tab is a link; the
 * card it belongs to slides into the main slot. Everything is drawn with
 * borders, not images, so it prints like the paper it imitates.
 */

:root {
  --paper: #f6f4ee;
  --card: #ffffff;
  --ink: #111111;
  --ink-soft: #444444;
  --rule: #111111;
  --mono: "Space Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --tab-h: 44px;
  --row-step: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

/* Scanned-paper grain over everything, below nothing that matters. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* A few specks, like a photocopy. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, var(--ink) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 88% 9%, var(--ink) 0 .9px, transparent 1.3px),
    radial-gradient(circle at 6% 71%, var(--ink) 0 1px, transparent 1.4px),
    radial-gradient(circle at 93% 64%, var(--ink) 0 1.4px, transparent 1.8px),
    radial-gradient(circle at 48% 96%, var(--ink) 0 .8px, transparent 1.2px);
  opacity: .55;
}

.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 56px 20px 48px; }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.masthead .mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.masthead .mark img { width: 46px; height: 46px; }
.masthead .mark b { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .24em; text-transform: uppercase; }
.masthead .mark small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.masthead .stamp { border: 1.5px solid var(--ink); padding: 6px 10px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }

/* ── The drawer ───────────────────────────────────────────────────────── */
.cabinet { position: relative; padding-top: calc(7 * var(--row-step) + var(--tab-h)); }

/* A card in the stack: only its top edge and its tab ever show. */
.row {
  position: absolute; left: 0; right: 0;
  height: 400px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 14px 14px 0 0;
}
.stack-top .row { top: 0; }
.stack-top { position: absolute; left: 0; right: 0; top: 0; height: calc(7 * var(--row-step) + var(--tab-h) + 40px); }
.stack-top .row:nth-child(1) { transform: translateY(calc(var(--tab-h) + 0 * var(--row-step))); z-index: 7; }
.stack-top .row:nth-child(2) { transform: translateY(calc(var(--tab-h) + 1 * var(--row-step))); z-index: 6; }
.stack-top .row:nth-child(3) { transform: translateY(calc(var(--tab-h) + 2 * var(--row-step))); z-index: 5; }
.stack-top .row:nth-child(4) { transform: translateY(calc(var(--tab-h) + 3 * var(--row-step))); z-index: 4; }
.stack-top .row:nth-child(5) { transform: translateY(calc(var(--tab-h) + 4 * var(--row-step))); z-index: 3; }
.stack-top .row:nth-child(6) { transform: translateY(calc(var(--tab-h) + 5 * var(--row-step))); z-index: 2; }
.stack-top .row:nth-child(7) { transform: translateY(calc(var(--tab-h) + 6 * var(--row-step))); z-index: 1; }
/* The front card of the back stack is the one at the very bottom (nearest the main card). */
.stack-top .row:nth-child(1) { z-index: 1; } .stack-top .row:nth-child(7) { z-index: 7; }
.stack-top .row:nth-child(2) { z-index: 2; } .stack-top .row:nth-child(6) { z-index: 6; }
.stack-top .row:nth-child(3) { z-index: 3; } .stack-top .row:nth-child(5) { z-index: 5; }
.stack-top .row:nth-child(4) { z-index: 4; }

/* The tab: a folder ear, drawn as an SVG so the shoulders curve. */
.tab {
  position: absolute; top: calc(-1 * var(--tab-h) + 1.5px); height: var(--tab-h); width: 36%;
  text-decoration: none; display: grid; place-items: center;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
  transition: transform .18s ease;
}
.tab svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tab svg { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; overflow: visible; }
.tab span { position: relative; padding-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88%; }
.tab.left { left: 26%; } .tab.right { left: 50%; }
.tab:hover { transform: translateY(-4px); }
.tab[aria-current="page"] svg { fill: var(--ink); }
.tab[aria-current="page"] { color: var(--paper); }
.tab.home span::before, .tab.home span::after { content: "___"; opacity: .8; }
/* The home tab sits on the main card itself, at the left, like a drawer label. */
.tab.home { left: 8%; width: 24%; }

/* ── Main card ────────────────────────────────────────────────────────── */
.main {
  position: relative; z-index: 20;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 14px 14px 0 0;
  padding: 26px 26px calc(5 * var(--row-step) + var(--tab-h) + 30px);
  min-height: 560px;
}
.main::after {
  /* the card's shadow sheet, a second card slightly offset */
  content: ""; position: absolute; inset: 8px -6px -6px 10px; z-index: -1;
  border: 1.5px solid var(--ink); border-radius: 14px 14px 0 0; background: var(--card);
}
.sheet {
  border: 1.5px dashed var(--ink);
  padding: 22px 22px 26px;
  min-height: 420px;
}
.card { display: none; }
.card.active { display: block; }

/* Card header: the big block letters and the mark box. */
.card-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding-bottom: 14px; border-bottom: 1.5px dashed var(--ink); }
.card-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 4.6vw, 34px); line-height: 1.05; letter-spacing: .22em; text-transform: uppercase; }
.card-head h1 span { display: inline-block; background: var(--ink); color: var(--paper); padding: 2px 8px 2px 10px; margin-bottom: 4px; }
.card-head h1 em { display: block; font-style: normal; font-weight: 500; letter-spacing: .3em; font-size: .46em; margin-top: 6px; }
.card-head .box { width: 88px; height: 56px; border: 1.5px solid var(--ink); display: grid; place-items: center; }
.card-head .box img { width: 46px; height: 46px; }

/* Labelled sections in the mono voice. */
.lbl { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.two { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; margin-top: 18px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

/* The black event block, and the inverted title lines. */
.black { background: var(--ink); color: var(--paper); padding: 16px 18px; }
.black .big { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 4.4vw, 30px); letter-spacing: .12em; text-transform: uppercase; line-height: 1.1; }
.black .big small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .2em; margin-top: 6px; opacity: .85; }
.black .line { border-top: 1px solid rgba(246,244,238,.35); margin-top: 12px; padding-top: 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 12px; }

/* The 66-book diagram: 39 + 27 cells. */
.books { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; border: 1.5px solid var(--ink); padding: 8px; }
.books i { aspect-ratio: 1; border: 1px solid var(--ink); font-style: normal; font-size: 7px; display: grid; place-items: center; }
.books i.nt { background: var(--ink); color: var(--paper); }
.books-key { display: flex; gap: 14px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; margin-top: 8px; }
.books-key i { display: inline-block; width: 9px; height: 9px; border: 1px solid var(--ink); margin-right: 5px; vertical-align: -1px; font-style: normal; }
.books-key i.nt { background: var(--ink); }

/* Days row, like the showroom hours. */
.days { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; }
.days span::before { content: ""; display: inline-block; width: 9px; height: 9px; border: 1.2px solid var(--ink); border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.days span.on::before { background: var(--ink); }

/* Key / value strip (FROM / TO). */
.kv { display: grid; grid-template-columns: auto 1fr; border: 1.5px solid var(--ink); margin-top: 18px; }
.kv > div { padding: 8px 12px; border-bottom: 1.5px solid var(--ink); }
.kv > div:nth-child(odd) { border-right: 1.5px solid var(--ink); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv b { font-weight: 700; }

/* Buttons, as stamped labels. */
.btn { display: inline-block; border: 1.5px solid var(--ink); padding: 9px 14px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; background: var(--card); box-shadow: 3px 3px 0 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--ink); }
.btn.solid { background: var(--ink); color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Prose cards (policies). */
.prose { max-width: 60ch; }
.prose h2 { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; margin: 26px 0 8px; padding-top: 14px; border-top: 1.5px dashed var(--ink); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 18px; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ul, .prose ol { padding-left: 18px; }
.prose .meta { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 14px; }
.prose table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; font-size: 12px; }
.prose th, .prose td { border: 1.5px solid var(--ink); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose th { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; }
.prose code { font-family: inherit; background: var(--paper); border: 1px solid var(--ink); padding: 0 4px; }
.note { border: 1.5px solid var(--ink); padding: 10px 12px; margin: 14px 0; font-size: 12px; background: var(--paper); }

/* ── Front stack (the paperwork) ──────────────────────────────────────── */
.stack-bottom { position: absolute; left: 0; right: 0; bottom: 176px; height: calc(5 * var(--row-step) + var(--tab-h) + 60px); pointer-events: none; }
.stack-bottom .row { top: 0; height: 150px; pointer-events: auto; }
.stack-bottom .row:nth-child(1) { transform: translateY(calc(var(--tab-h) + 0 * var(--row-step))); z-index: 21; }
.stack-bottom .row:nth-child(2) { transform: translateY(calc(var(--tab-h) + 1 * var(--row-step))); z-index: 22; }
.stack-bottom .row:nth-child(3) { transform: translateY(calc(var(--tab-h) + 2 * var(--row-step))); z-index: 23; }
.stack-bottom .row:nth-child(4) { transform: translateY(calc(var(--tab-h) + 3 * var(--row-step))); z-index: 24; }
.stack-bottom .row:nth-child(5) { transform: translateY(calc(var(--tab-h) + 4 * var(--row-step))); z-index: 25; }

/* ── Drawer front ─────────────────────────────────────────────────────── */
.drawer { position: relative; z-index: 40; margin: -6px -30px 0; height: 210px; }
.drawer svg { width: 100%; height: 100%; display: block; }
.drawer svg path, .drawer svg line { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.drawer svg .handle { fill: none; }

/* ── Footer strip ─────────────────────────────────────────────────────── */
.strip { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 28px; align-items: start; }
@media (max-width: 560px) { .strip { grid-template-columns: 1fr; } }
.strip .blurb { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; text-align: justify; text-align-last: left; line-height: 1.7; word-spacing: .4em; }
.strip table { border-collapse: collapse; width: 100%; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.strip th, .strip td { border: 1.5px solid var(--ink); padding: 6px 10px; text-align: left; }
.strip th { width: 30%; font-weight: 700; font-size: 9px; letter-spacing: .2em; }
.strip a { text-decoration: none; }
.strip a:hover { text-decoration: underline; }
.colophon { margin-top: 26px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.colophon a { text-decoration: none; }
.colophon a:hover { text-decoration: underline; }

/* ── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  :root { --tab-h: 34px; --row-step: 16px; }
  .page { padding: 32px 12px 32px; }
  .masthead .stamp { display: none; }
  .tab { font-size: 9px; letter-spacing: .1em; width: 40%; }
  .tab.left { left: 20%; } .tab.right { left: 52%; }
  .tab.home { left: 4%; width: 30%; }
  .main { padding: 16px 14px calc(5 * var(--row-step) + var(--tab-h) + 24px); }
  .sheet { padding: 14px 12px 20px; }
  .drawer { margin: -6px -14px 0; height: 150px; }
  .stack-bottom { bottom: 126px; }
}

/* Reduced motion: tabs simply change, no lift. */
@media (prefers-reduced-motion: reduce) { .tab, .btn { transition: none; } }

/* Print: every card, in order, without the furniture. */
@media print {
  body::before, body::after, .stack-top, .stack-bottom, .drawer, .masthead .stamp { display: none; }
  .cabinet { padding-top: 0; }
  .main { border: 0; padding: 0; }
  .main::after { display: none; }
  .card { display: block; page-break-after: always; }
}
