/* ============================================================
   Jack's Free Lunch — jbstein.com
   Modern stylesheet for the restored 2001-era link archive.
   No frameworks, no JavaScript, system fonts only (offline-safe).
   ============================================================ */

:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #26302a;
  --muted: #5f6a5e;
  --line: #e3ddd0;
  --felt: #1d5c3a;
  --felt-dark: #14382a;
  --felt-soft: #e9f1ea;
  --brass: #a8802f;
  --brass-soft: #f4ead2;
  --link: #1a5c38;
  --link-visited: #6d4a86;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 48, 42, .06), 0 8px 24px -18px rgba(35, 48, 42, .35);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { color: var(--felt-dark); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #7fb08e;
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--felt-dark);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 50;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: linear-gradient(160deg, var(--felt-dark), var(--felt) 70%);
  color: #f2f6f0;
  border-bottom: 4px solid var(--brass);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  padding: 1.1rem 0 .9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
  text-decoration: none;
}
.brand:visited, .brand:hover { color: #fff; text-decoration: none; }

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #4a4a4a, #0c0c0c 70%);
  border: 2px solid #d8d2c2;
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.55);
  flex: none;
}
.brand-mark span {
  background: #fff;
  color: #111;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .72rem;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.15;
}
.brand-text small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c9d8c5;
}

.site-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.site-nav a {
  color: #e8efe4;
  text-decoration: none;
  font-size: .92rem;
  padding: .42rem .8rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.site-nav a:visited { color: #e8efe4; }
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.35);
  color: #fff;
}

/* ---------- Breadcrumbs ---------- */

.crumbs {
  font-size: .85rem;
  color: var(--muted);
  margin: 1.3rem 0 .4rem;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin: 0 .45rem; color: #b6b0a0; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Main & typography ---------- */

main { padding-bottom: 3rem; }

.page-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.2;
  margin: .6rem 0 .8rem;
  color: var(--felt-dark);
}

.page-lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 1.6rem;
}

h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  color: var(--felt-dark);
  margin: 2.2rem 0 .8rem;
}

h3 {
  font-size: 1.12rem;
  color: var(--felt-dark);
  margin: 1.6rem 0 .55rem;
}

.rule {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 1.6rem 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--brass);
  margin: 1.8rem 0 .4rem;
}

/* ---------- Cards & grids ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
}

.card h3 { margin: .2rem 0 .45rem; }
.card p { margin: 0 0 .6rem; font-size: .95rem; color: var(--muted); }
.card .more { font-weight: 600; font-size: .92rem; }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--felt-soft);
  display: grid;
  place-items: center;
  margin-bottom: .7rem;
  color: var(--felt);
}
.card-icon svg { width: 24px; height: 24px; }

/* ---------- Hero (home) ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem;
  align-items: center;
  padding: 2.4rem 0 1.2rem;
}
.hero h1 { margin: .2rem 0 .7rem; }
.hero p { max-width: 56ch; }
.hero .banner { display: block; max-width: 100%; height: auto; margin-bottom: 1rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.1rem; }

.btn {
  display: inline-block;
  background: var(--felt);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .62rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--felt-dark);
}
.btn:visited { color: #fff; }
.btn:hover { background: var(--felt-dark); color: #fff; }
.btn.alt { background: transparent; color: var(--felt); border-color: var(--felt); }
.btn.alt:visited { color: var(--felt); }
.btn.alt:hover { background: var(--felt-soft); color: var(--felt-dark); }

/* ---------- Sections ---------- */

.section { margin-top: 2.6rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.section-head h2 { margin: 0; }
.section-head .more { font-size: .92rem; white-space: nowrap; }

/* ---------- Photo album ---------- */

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .9rem;
}
.photo-strip figure { margin: 0; }
.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #ddd;
}
.photo-strip figcaption {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .35rem;
  text-align: center;
}

/* ---------- Article pages ---------- */

.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 3rem);
  max-width: 860px;
  margin: 1.2rem auto 0;
}

.article .prose { font-family: var(--serif); font-size: 1.06rem; max-width: 70ch; }
.article .prose p { margin: 0 0 1.05rem; }
.article .byline { color: var(--muted); font-size: .95rem; margin-bottom: 1.8rem; }
.article .byline strong { color: var(--ink); }

.article-figure { float: right; margin: 0 0 1rem 1.4rem; max-width: 240px; }
.article-figure img { border-radius: 10px; border: 1px solid var(--line); width: 100%; height: auto; }
.article-figure figcaption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: .4rem; }

@media (max-width: 720px) {
  .article-figure { float: none; margin: 0 auto 1.2rem; }
}

/* ---------- Link directories ---------- */

.link-columns {
  columns: 3 240px;
  column-gap: 2.2rem;
  padding: 0;
  margin: 1.4rem 0 0;
  list-style: none;
}
.link-columns li { break-inside: avoid; margin: 0 0 .55rem; }
.link-columns a { font-weight: 500; }

.archival-note {
  background: var(--brass-soft);
  border: 1px solid #e2d3a8;
  border-radius: 10px;
  padding: .8rem 1rem;
  font-size: .88rem;
  color: #6b5a26;
  margin: 1.4rem 0 0;
}

.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: .9rem;
  box-shadow: var(--shadow);
}
.entry h3 { margin: 0 0 .3rem; }
.entry p { margin: 0; font-size: .95rem; color: var(--muted); }
.entry .meta { font-size: .8rem; color: #96917f; margin-left: .5rem; font-weight: 400; }

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1rem 0 1.6rem;
  padding: 0;
  list-style: none;
}
.topic-nav a {
  display: inline-block;
  background: var(--felt-soft);
  color: var(--felt-dark);
  border: 1px solid #cfe0d1;
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.topic-nav a:visited { color: var(--felt-dark); }
.topic-nav a:hover { background: #d9e8db; }
.topic-nav [aria-current="page"] { background: var(--felt); border-color: var(--felt); color: #fff; }
.topic-nav [aria-current="page"]:visited { color: #fff; }

/* ---------- Definition lists / FAQ ---------- */

.faq-item { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq-item:first-of-type { border-top: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 .45rem; font-size: 1.08rem; }
.faq-item p, .faq-item div { margin: 0; max-width: 70ch; }

/* ---------- Tables (OS/2 files) ---------- */

.file-list { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.file-list th, .file-list td { text-align: left; vertical-align: top; padding: .85rem .9rem; border-bottom: 1px solid var(--line); }
.file-list th { background: var(--felt-soft); color: var(--felt-dark); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.file-list td:first-child { width: 30%; font-weight: 600; }
.file-list td:last-child { font-size: .95rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
  background: #182420;
  color: #c9d2c6;
  margin-top: 3rem;
  padding: 2.4rem 0 1.6rem;
  font-size: .92rem;
}
.site-footer a { color: #a9d3b4; }
.site-footer a:visited { color: #b9a9d6; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-grid h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa38c; margin: 0 0 .7rem; font-family: var(--sans); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-note { margin: .4rem 0 0; color: #9aa895; max-width: 46ch; }
.footer-legal {
  border-top: 1px solid #2c3a32;
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  font-size: .82rem;
  color: #8d9a89;
}

/* ---------- 404 ---------- */

.error-hero { text-align: center; padding: 3rem 0 1rem; }
.error-hero .ball {
  width: 84px; height: 84px; margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #4a4a4a, #0c0c0c 70%);
  border: 2px solid #d8d2c2;
  display: grid; place-items: center;
}
.error-hero .ball span {
  background: #fff; color: #111; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.6rem; }
  .site-nav { margin-left: 0; }
  .header-inner { padding-bottom: .6rem; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  body { font-size: .98rem; }
}

@media print {
  .site-header, .site-footer, .skip-link, .topic-nav { display: none; }
  body { background: #fff; }
}