/* Public character site: typed survivor records on paper. */
:root {
  color-scheme: light;
  --desk: #2b2a26;
  --desk-2: #33312c;
  --paper: #f3ecdc;
  --paper-edge: #e4d9c0;
  --ink: #2a2620;
  --ink-soft: #6b6152;
  --rule: #c9bb9c;
  --stamp: #a23b2a;
  --tape: rgba(233, 222, 180, .8);
  --radius: 3px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { background: var(--desk); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, var(--desk-2), transparent 70%),
    var(--desk);
  color: var(--ink);
  font: 16px/1.6 "Courier Prime", "Courier New", monospace;
  padding: 0 16px 48px;
}
a { color: inherit; }
h1, h2, h3, .stamp, .site-head p { font-family: "Special Elite", "Courier New", monospace; font-weight: normal; }

/* Index */
.site-head { max-width: 1040px; margin: 0 auto; padding: 48px 0 24px; color: var(--paper); }
.site-head h1 { margin: 0; font-size: clamp(32px, 6vw, 52px); line-height: 1.1; }
.site-head p { margin: 6px 0 0; color: #b8ad95; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.roster {
  max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px;
}
.card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 14px 16px; text-decoration: none;
  transition: transform .15s ease;
}
.card:nth-child(odd) { transform: rotate(-.6deg); }
.card:nth-child(even) { transform: rotate(.5deg); }
.card:hover, .card:focus-visible { transform: rotate(0) translateY(-3px); }
.card-portrait { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--paper-edge); margin-bottom: 10px; filter: sepia(.25) contrast(1.05); }
.card-name { font-family: "Special Elite", monospace; font-size: 20px; line-height: 1.2; }
.card-meta { color: var(--ink-soft); font-size: 14px; }

/* Character page */
.crumbs { max-width: 820px; margin: 0 auto; padding: 28px 0 16px; }
.crumbs a { color: #b8ad95; text-decoration: none; }
.crumbs a:hover { color: var(--paper); }
.sheet {
  max-width: 820px; margin: 0 auto;
  background: var(--paper);
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(160,140,100,.12) 31px 32px);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 48px);
}
.sheet-head { display: flex; gap: 28px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 24px; margin-bottom: 8px; }
.sheet-head h1 { margin: 2px 0 4px; font-size: clamp(28px, 5vw, 42px); line-height: 1.1; word-break: break-word; }
.stamp {
  display: inline-block; margin: 0; color: var(--stamp); border: 2px solid var(--stamp); border-radius: 2px;
  padding: 0 8px; font-size: 13px; letter-spacing: .15em; text-transform: uppercase; transform: rotate(-2deg);
}
.played-by { margin: 0; color: var(--ink-soft); }
.sheet-portrait {
  flex: none; width: 180px; aspect-ratio: 4 / 5; object-fit: cover;
  background: #fff; padding: 8px 8px 28px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transform: rotate(-2deg); filter: sepia(.2) contrast(1.05); position: relative;
}
.no-portrait {
  display: grid; place-items: center; font-family: "Special Elite", monospace; font-size: 48px;
  color: var(--rule); background: #ece3cf;
}
.card-portrait.no-portrait { font-size: 64px; }

.sheet-section { margin-top: 28px; }
.sheet-section h2, .journal h2 {
  margin: 0 0 12px; font-size: 22px; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px dashed var(--rule); padding-bottom: 4px;
}
dl { margin: 0; display: grid; gap: 14px; }
.field { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 16px; }
dt { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding-top: 2px; }
dd { margin: 0; }
dd p, .entry p { margin: 0 0 .7em; }
dd p:last-child, .entry p:last-child { margin-bottom: 0; }
.blank { color: var(--rule); }

.journal { margin-top: 40px; }
.entry { padding: 18px 0; border-bottom: 1px dashed var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry h3 { margin: 0; font-size: 20px; }
.entry-meta { margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; }
.empty { color: var(--ink-soft); font-style: italic; }
.roster .empty { color: #b8ad95; }

.site-foot { max-width: 1040px; margin: 40px auto 0; text-align: center; color: #8d846f; font-size: 13px; }

@media (max-width: 600px) {
  .sheet-head { flex-direction: column; align-items: center; text-align: center; }
  .sheet-portrait { width: 160px; }
  .field { grid-template-columns: 1fr; gap: 2px; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
