/* ============================================================
   christianwiedmann.com — main stylesheet
   Visual system: editorial + documentary + quietly technical.
   Palette: bone / charcoal / rust. Thin rule = the one recurring
   graphic device. No icons. Serif for statements, sans for UI,
   mono for metadata/technical texture.
   ============================================================ */

:root {
  --bone: #EFE9DD;
  --bone-2: #E7DFCF;
  --charcoal: #262421;
  --charcoal-2: #322F2B;
  --rust: #8C4A2C;
  --rust-light: #B06B47;
  --line: #D8D0C2;
  --line-on-dark: #4A4642;
  --ink-soft: #5F5A53;
  --ink-soft-on-dark: #B9B2A6;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max-width: 1100px;
  --pad: clamp(20px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}
.rule--dark { border-top-color: var(--line-on-dark); }

.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--charcoal);
  color: var(--bone);
  padding: 12px 18px;
  z-index: 1000;
  font-family: var(--sans);
  font-weight: 600;
}
.skip-link:focus {
  left: var(--pad);
  top: 12px;
}

/* Consistent, visible focus state for every interactive element */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- Header / nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(239, 233, 221, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-header .brand {
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  text-decoration: none;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.site-nav li:not(:last-child) { margin-right: 28px; } /* fallback for browsers without flex gap support */
.site-nav ul li:not(:last-child) { }
@supports (gap: 1px) {
  .site-nav li:not(:last-child) { margin-right: 0; }
}
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--rust); }

.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 20px;
    cursor: pointer;
  }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bone);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--pad);
  }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a { display: block; padding: 14px 0; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding-top: clamp(56px, 9vw, 108px);
  padding-bottom: clamp(40px, 6vw, 64px);
}
.hero .eyebrow { display: block; margin-bottom: 22px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.6vw, 62px);
  line-height: 1.12;
  margin: 0 0 22px;
  max-width: 18ch;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}
.hero .sub {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 30px;
}
.hero .coords {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ---------------- Portrait ---------------- */
.portrait-section {
  padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 80px);
}
.portrait-frame {
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
@media (max-width: 640px) {
  .portrait-frame { aspect-ratio: 3 / 4; }
}
.portrait-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.portrait-caption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* ---------------- Field Note ---------------- */
.field-note { padding: clamp(40px, 6vw, 72px) 0; }
.field-note .meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.field-note p {
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.55;
  max-width: 62ch;
  margin: 0 0 20px;
}
.field-note strong { color: var(--rust); font-weight: 600; }

/* ---------------- Selected Work ---------------- */
.work-section { padding: clamp(48px, 7vw, 88px) 0; }
.section-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 36px;
}
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.work-card {
  background: var(--bone);
}
.work-card-body {
  padding: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.work-card-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--rust);
  margin-bottom: 10px;
}
.work-card h3 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 500;
  margin: 0 0 12px;
}
.work-card p {
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 48ch;
}
.work-card-status {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.work-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--charcoal);
}
.work-thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}

.work-card-hit {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  width: 100%;
  background: none; border: none; padding: 0; text-align: left; font: inherit; color: inherit;
}
@media (max-width: 780px) {
  .work-card-hit { grid-template-columns: 1fr; }
}
.work-card-hit:hover .work-thumb-wrap img { transform: scale(1.03); }
.work-card.has-link .work-card-hit,
.work-card.is-expandable .work-card-hit { cursor: pointer; }

.expand-caret {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--rust);
  margin-left: 6px;
}

.work-card-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
  background: var(--bone-2);
  border-top: 0px solid var(--line);
}
.work-card-detail.is-open {
  border-top-width: 1px;
}
.work-card-detail-inner {
  padding: 24px clamp(24px, 4vw, 40px) 32px;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ---------------- Speaking (inverted) ---------------- */
.speaking-section {
  background: var(--charcoal);
  color: var(--bone);
  padding: clamp(56px, 8vw, 96px) 0;
}
.speaking-section .section-title { color: var(--ink-soft-on-dark); }
.speaking-section p {
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.55;
  max-width: 62ch;
  margin: 0 0 22px;
}
.speaking-section .closing {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--rust-light);
  margin-top: 32px;
}

/* ---------------- What's Next / doors ---------------- */
.next-section { padding: clamp(48px, 7vw, 88px) 0; }
.next-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 0 0 40px;
  max-width: 20ch;
}
.doors-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 900px) {
  .doors-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .doors-grid { grid-template-columns: 1fr; }
}
.door {
  background: var(--bone);
  padding: 26px 22px;
}
.door h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px;
}
.door p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
}
.next-closing {
  margin-top: 44px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 23px);
}

/* ---------------- Contact ---------------- */
.contact-section {
  padding: clamp(48px, 7vw, 88px) 0;
  border-top: 1px solid var(--line);
}
.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.8vw, 30px);
  font-style: italic;
  color: var(--charcoal);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rust);
  margin-bottom: 40px;
}
.contact-cta:hover { color: var(--rust); }

.contact-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-bottom: 8px;
}
.contact-channels a:not(:last-child) { margin-right: 28px; }
@supports (gap: 1px) {
  .contact-channels a:not(:last-child) { margin-right: 0; }
}
.contact-channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}
.contact-channel:hover { border-bottom-color: var(--rust); color: var(--rust); }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.site-footer .footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .footer-links a:not(:last-child) { margin-right: 20px; }
@supports (gap: 1px) {
  .site-footer .footer-links a:not(:last-child) { margin-right: 0; }
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--rust); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .work-thumb-wrap img,
  .work-card-detail { transition: none; }
}
