:root {
  --ground: #E8E7DE;
  --surface: #DEDBCE;
  --ink: #26241F;
  --ink-soft: #57544A;
  --line: #b9b4a6;
  --accent: #2A4736;
  --accent-ink: #F2F1EA;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #201F1B;
    --surface: #2A2925;
    --ink: #EDEAE2;
    --ink-soft: #A39F94;
    --line: #48453D;
    --accent: #6FA482;
    --accent-ink: #12140F;
  }
}

:root[data-theme="dark"] {
  --ground: #201F1B;
  --surface: #2A2925;
  --ink: #EDEAE2;
  --ink-soft: #A39F94;
  --line: #48453D;
  --accent: #6FA482;
  --accent-ink: #12140F;
}

:root[data-theme="light"] {
  --ground: #E8E7DE;
  --surface: #DEDBCE;
  --ink: #26241F;
  --ink-soft: #57544A;
  --line: #b9b4a6;
  --accent: #2A4736;
  --accent-ink: #F2F1EA;
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.serif { font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.shell { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* header */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .shell { display: flex; align-items: center; justify-content: space-between; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.wordmark { font-size: 1.05rem; font-weight: 500; letter-spacing: 0.01em; margin: 0; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { font-size: 0.85rem; text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }
.theme-toggle { font-size: 0.75rem; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: transparent; border: 1px solid var(--line); color: var(--ink-soft); border-radius: 2px; padding: 0.3rem 0.6rem; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }

/* hero */

.hero { padding: 3.2rem 0 2.6rem; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 2.9rem); font-weight: 500; margin: 0 0 0.6rem; text-wrap: balance; }
.hero p { font-size: 1.02rem; color: var(--ink-soft); margin: 0 0 1rem; max-width: 46ch; line-height: 1.6; }
.hero .domain { font-size: 0.75rem; color: var(--accent); letter-spacing: 0.04em; }

/* galleries */

.gallery { padding: 2.4rem 0; border-bottom: 1px solid var(--line); }
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; }
.gallery-head h2 { font-size: 1.1rem; font-weight: 500; margin: 0; }
.gallery-head .roman { color: var(--accent); margin-right: 0.5rem; }
.gallery-head .count { font-size: 0.75rem; color: var(--ink-soft); }

.ledger { border-top: 1px solid var(--line); }
.ledger-row { display: grid; grid-template-columns: 3.2rem 1fr 4rem; gap: 1rem; align-items: baseline; padding: 0.8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.ledger-row:hover .ledger-row-title { color: var(--accent); }
.ledger-row .no { font-size: 0.78rem; color: var(--accent); }
.ledger-row-title { font-size: 1.02rem; }
.ledger-row .yr { font-size: 0.82rem; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }

/* work detail */

.detail { padding: 2.6rem 0 3rem; }
.detail-back { display: inline-block; font-size: 0.78rem; color: var(--ink-soft); text-decoration: none; margin-bottom: 1.2rem; }
.detail-back:hover { color: var(--accent); }
.detail h2 { font-size: 1.6rem; font-weight: 500; margin: 0 0 1rem; text-wrap: balance; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; font-size: 0.8rem; color: var(--ink-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.7rem 0; margin-bottom: 1.6rem; }
.detail-meta strong { color: var(--ink); font-weight: 500; }
.detail-image {
  aspect-ratio: 4 / 3;
  background-image: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--ground) 10px, var(--ground) 20px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.detail-image span { font-size: 0.72rem; color: var(--ink-soft); background: var(--ground); padding: 0.2rem 0.5rem; border: 1px solid var(--line); }
.detail p.desc { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.65; max-width: 58ch; }

/* plain content pages (about, contact) */

.page { padding: 2.6rem 0 3rem; }
.page h1 { font-size: 1.8rem; font-weight: 500; margin: 0 0 1.4rem; text-wrap: balance; }
.page p { font-size: 0.98rem; color: var(--ink-soft); line-height: 1.7; max-width: 58ch; }

/* style guide */

.styleguide-section { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.styleguide-section h2 { font-size: 1.3rem; font-weight: 500; margin: 0 0 1.4rem; }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem; }
.swatch-fill { aspect-ratio: 3 / 2; border: 1px solid var(--line); margin-bottom: 0.5rem; }
.swatch-name { font-size: 0.8rem; margin: 0; }
.swatch-desc { font-size: 0.78rem; color: var(--ink-soft); margin: 0.15rem 0; }
.swatch-hex { font-size: 0.68rem; color: var(--ink-soft); margin: 0; }

.type-specimen { margin-bottom: 1.6rem; }
.label { font-size: 0.7rem; color: var(--ink-soft); margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }

.type-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 1.8rem; }
.type-table th, .type-table td { text-align: left; padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.type-table th { color: var(--ink-soft); font-weight: 500; font-size: 0.75rem; }

/* footer */

.site-footer { padding: 1.6rem 0 2.6rem; }
.site-footer p { font-size: 0.75rem; color: var(--ink-soft); margin: 0; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 520px) {
  .ledger-row { grid-template-columns: 2.4rem 1fr 3rem; }
  .site-nav { gap: 1rem; }
}
