/* erhart.info — Familie Erhart
   Ein Schild, keine Website. One nameplate, not a website. */

@font-face {
  font-family: "Vollkorn";
  src: url("fonts/vollkorn-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vollkorn";
  src: url("fonts/vollkorn-var-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f6f5f1;
  --ink: #23211d;
  --muted: #6e6a61;
  --brass: #8a6b3f;
  --line: #dcd9d1;
  --plate: #fbfaf7;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181715;
    --ink: #e9e6e0;
    --muted: #97928a;
    --brass: #b3905b;
    --line: #34312c;
    --plate: #1d1c19;
  }
}
:root[data-theme="light"] {
  --paper: #f6f5f1;
  --ink: #23211d;
  --muted: #6e6a61;
  --brass: #8a6b3f;
  --line: #dcd9d1;
  --plate: #fbfaf7;
}
:root[data-theme="dark"] {
  --paper: #181715;
  --ink: #e9e6e0;
  --muted: #97928a;
  --brass: #b3905b;
  --line: #34312c;
  --plate: #1d1c19;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection {
  background: color-mix(in srgb, var(--brass) 30%, var(--paper));
}

/* paper grain — the ground is a material, not a hex value */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Vollkorn", Georgia, serif;
  font-weight: 420;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Language visibility */
html[data-lang="en"] .de { display: none; }
html:not([data-lang="en"]) .en { display: none; }

a { color: inherit; text-decoration: none; }

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

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: 1.5rem 1.75rem 0;
}

.lang-toggle {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.2rem 0.4rem 0.42em;
  transition: color 0.25s ease;
}
.lang-toggle:hover { color: var(--brass); }

/* ---------- main column ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2rem, 7vh, 5.5rem) 1.5rem 0;
}

/* wordmark */

.wordmark {
  font-size: clamp(2.7rem, 8.5vw, 5.2rem);
  font-weight: 440;
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* optically recenters letterspaced caps */
  text-transform: uppercase;
  line-height: 1.05;
}

.subline {
  margin-top: 0.9rem;
  font-style: italic;
  font-size: clamp(1.02rem, 2.4vw, 1.16rem);
  color: var(--muted);
}

/* the spine — one continuous thought from name to practice */

.spine {
  width: 1px;
  height: clamp(2.2rem, 5.5vh, 3.5rem);
  background: color-mix(in srgb, var(--muted) 60%, var(--paper));
  margin: clamp(1.4rem, 3.5vh, 2.4rem) auto;
}

/* ---------- lineage ---------- */

.lineage {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lineage li {
  font-size: 0.98rem;
}

.lineage .gen {
  color: var(--brass);
  font-size: 0.8em;
  letter-spacing: 0.08em;
  margin-right: 0.55rem;
}

.lineage .who {
  font-weight: 560;
  font-size: 0.78em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lineage .what {
  color: var(--muted);
}
.lineage .what::before {
  content: "\2014\00a0"; /* em dash */
  color: var(--line);
}

/* ---------- plates ---------- */

.plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  width: min(56rem, 100%);
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.plate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  background: var(--plate);
  border: 1px solid var(--line);
  padding: clamp(2.1rem, 4.5vh, 2.9rem) 2rem clamp(1.9rem, 4vh, 2.5rem);
  transition: border-color 0.3s ease;
}

/* engraver's inner hairline */
.plate::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--line) 55%, var(--plate));
  pointer-events: none;
  transition: border-color 0.3s ease;
}
.plate:hover::after {
  border-color: color-mix(in srgb, var(--brass) 35%, var(--plate));
}

.plate .field {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.plate h2 {
  font-size: clamp(1.14rem, 2.4vw, 1.3rem);
  font-weight: 540;
  line-height: 1.35;
  margin-top: 0.35rem;
  text-wrap: balance;
}

.plate .detail {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 24em;
  text-wrap: balance;
}

.plate .goto {
  margin-top: auto;
  padding-top: 1.1rem;
  font-size: 0.8rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  color: var(--brass);
}
.plate .goto::after {
  content: "\00a0\2192";
  display: inline-block;
  transition: transform 0.3s ease;
}

.plate:hover { border-color: var(--brass); }
.plate:hover .goto::after { transform: translateX(0.3em); }

/* ---------- footer ---------- */

footer {
  padding: 1.4rem 1.5rem 1.6rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

footer a { padding: 0.3rem 0.1rem; transition: color 0.25s ease; }
footer a:hover { color: var(--brass); }

footer .sep {
  margin: 0 0.55rem;
  color: var(--line);
}

/* ---------- legal pages ---------- */

.legal {
  display: block;
  flex: 1;
  width: min(38rem, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 1.5rem;
  text-align: left;
}
.legal h1 {
  font-size: 1.5rem;
  font-weight: 540;
  margin-bottom: 1.5rem;
}
.legal h2 {
  font-size: 1.05rem;
  font-weight: 560;
  margin: 1.8rem 0 0.5rem;
}
.legal p { margin-bottom: 0.8rem; }
.legal .back {
  display: inline-block;
  margin-bottom: 2.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--brass);
}

/* ---------- entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0;
    animation: rise 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  }
  .spine {
    transform-origin: top;
    animation: grow 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) backwards;
  }
  .d1 { animation-delay: 0.1s; }
  .d2 { animation-delay: 0.25s; }
  .d3 { animation-delay: 0.4s; }
  .d4 { animation-delay: 0.55s; }
  .d5 { animation-delay: 0.7s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(0.4rem); }
    to { opacity: 1; transform: none; }
  }
  @keyframes grow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
  }
}

/* ---------- small screens ---------- */

@media (max-width: 44rem) {
  .plates { grid-template-columns: 1fr; }
  .lineage .what { display: block; margin-top: 0.1rem; }
  .plate { padding-left: 1.4rem; padding-right: 1.4rem; }
  .plate .field { font-size: 0.68rem; letter-spacing: 0.14em; text-wrap: balance; }
  .lineage .what::before { content: none; }
}

/* legal pages: lists, inline links, mail, date */
.legal ul { list-style: disc; padding-left: 1.2rem; margin-bottom: 0.8rem; }
.legal li { margin-bottom: 0.2rem; }
.legal p a, .legal li a { text-decoration: underline; text-underline-offset: 0.15em; }
.legal p a:hover, .legal li a:hover { color: var(--brass); }
.legal .stand { margin-top: 2.2rem; font-size: 0.85rem; color: var(--muted); }

/* ---------- design pass: the spine runs through the generations ---------- */

@media (min-width: 44.01rem) {
  .spine.d2 { margin-bottom: 0; }
  .spine.d3 { margin-top: 0; }

  .lineage {
    position: relative;
    width: min(52rem, 100%);
    gap: 1.05rem;
    padding: 1.1rem 0;
  }
  .lineage::before {               /* the spine, continued behind the numerals */
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: color-mix(in srgb, var(--muted) 60%, var(--paper));
  }
  .lineage li {
    display: grid;
    grid-template-columns: 1fr 3.4rem 1fr;
    align-items: baseline;
  }
  .lineage .who  { grid-column: 1; grid-row: 1; text-align: right; }
  .lineage .gen  {
    grid-column: 2; grid-row: 1;
    position: relative;
    margin: 0;
    padding: 0.2rem 0;
    background: var(--paper);      /* knocks the line out around the numeral */
    font-size: 0.86em;
    letter-spacing: 0.06em;
  }
  .lineage .what { grid-column: 3; grid-row: 1; text-align: left; text-wrap: balance; }
  .lineage .what::before { content: none; }
}

/* ---------- design pass: titles above the name, as on a nameplate ---------- */

.plate h2 .titles {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.plate h2 .post { font-weight: 440; color: var(--muted); }
