:root {
  color-scheme: light dark;
  --font-body: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-display-baskerville: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-display-cambria: "Cambria", "Georgia", "Times New Roman", serif;
  --font-display-palatino: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-display: var(--font-display-palatino);
  --font-mono: "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  --bg: #f5f1e8;
  --bg-elevated: rgba(255, 252, 246, 0.78);
  --bg-strong: #fffdf8;
  --text: #1d1d1b;
  --text-soft: #53514c;
  --line: rgba(29, 29, 27, 0.16);
  --line-strong: rgba(29, 29, 27, 0.3);
  --accent: #7d5a2f;
  --shadow: 0 18px 50px rgba(20, 20, 18, 0.08);
  --max-width: 65rem;
}

:root[data-theme="dark"] {
  --bg: #151618;
  --bg-elevated: rgba(28, 30, 34, 0.82);
  --bg-strong: #1c1e22;
  --text: #ece8de;
  --text-soft: #b7b0a3;
  --line: rgba(236, 232, 222, 0.14);
  --line-strong: rgba(236, 232, 222, 0.28);
  --accent: #c8a56e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top, rgba(125, 90, 47, 0.08), transparent 28rem),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06), transparent 16rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

button {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.7rem 1rem;
  background: var(--bg-strong);
  border: 1px solid var(--line-strong);
}

.skip-link:focus {
  top: 1rem;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--accent);
  background: rgba(200, 165, 110, 0.16);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: rgba(200, 165, 110, 0.26);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.masthead,
.content-section {
  backdrop-filter: blur(10px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.masthead {
  display: grid;
  gap: 1.25rem;
  padding: 1rem 1.1rem 1.25rem;
}

.site-header {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1.5fr auto;
  align-items: start;
  padding: 0;
}

.site-header > div:first-child {
  display: grid;
  gap: 0.4rem;
}

.eyebrow,
.section-tag,
.card-kicker,
.entry-date,
.panel-title,
.theme-toggle__label,
.theme-toggle__value,
.meta-list,
.site-nav {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.eyebrow,
.section-tag,
.card-kicker,
.entry-date,
.panel-title {
  color: var(--accent);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.1;
  font-weight: 600;
}

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.3vw, 3rem);
  letter-spacing: -0.015em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3.7vw, 2.35rem);
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1.2rem;
}

.subtitle,
.lead,
.prose p,
.card p,
.entry p {
  color: var(--text-soft);
}

.subtitle {
  max-width: 38rem;
  margin-bottom: 0;
  font-size: 0.98rem;
}

.entry-meta {
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.availability-note {
  justify-self: end;
  width: max-content;
  max-width: 100%;
  padding: 0.45rem 0.8rem;
  margin-left: auto;
  margin-bottom: 0;
  background: rgba(200, 165, 110, 0.12);
  border: 1px solid rgba(200, 165, 110, 0.38);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(200, 165, 110, 0.06) inset;
}

.header-actions {
  display: grid;
  gap: 0.75rem;
  justify-items: end;
}

.header-stack {
  display: grid;
  max-width: 18rem;
  justify-items: end;
  gap: 0.22rem;
  margin-bottom: 0;
  padding-top: 0.1rem;
}

.header-stack__label,
.header-stack__list {
  margin-bottom: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
}

.header-stack__label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-stack__list {
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  position: relative;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  transition:
    color 140ms ease,
    border-color 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
}

.theme-toggle__value {
  color: var(--accent);
}

main {
  display: grid;
  gap: 1.5rem;
  margin-top: 0;
}

.content-section {
  padding: 1.25rem;
}

.hero {
  display: block;
  padding: 0;
  backdrop-filter: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.hero-copy {
  min-width: 0;
}

.overview-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr);
  align-items: start;
}

.overview-text {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  max-width: 38rem;
}

.overview-text .section-tag,
.overview-text .lead,
.overview-text .overview-secondary {
  margin-bottom: 0;
}

.lead {
  margin-bottom: 0;
  max-width: 38rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.overview-lead {
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
}

.overview-emphasis {
  color: inherit;
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: rgba(200, 165, 110, 0.55);
  text-underline-offset: 0.12em;
  text-decoration-thickness: 0.08em;
}

.overview-secondary {
  max-width: 38rem;
  margin-bottom: 0;
  color: var(--text-soft);
}

.overview-aside {
  margin-top: 0.35rem;
  margin-bottom: 0;
  max-width: 38rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
}

.overview-aside a {
  color: inherit;
  text-decoration: none;
}

.overview-aside a:hover,
.overview-aside a:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.overview-aside-label {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

.portrait-placeholder {
  margin: 0;
}

.portrait-image {
  display: block;
  width: min(100%, 15rem);
  height: auto;
  border: 1px solid var(--line-strong);
  background: var(--bg-strong);
}

.portrait-placeholder figcaption {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
}


.card,
.contact-box {
  background: var(--bg-strong);
  border: 1px solid var(--line);
}

.focus-inline-label {
  margin-bottom: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overview-notes {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-note {
  display: grid;
  gap: 0.18rem;
  align-content: start;
  min-height: 100%;
  padding: 0.6rem 0.66rem;
  background: var(--bg-strong);
  border: 1px solid var(--line);
}

.overview-note p {
  margin-bottom: 0;
}

.overview-note p:last-child {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(0.82rem, 1.02vw, 0.92rem);
}

.overview-note__detail {
  font-size: 0.92rem;
  line-height: 1.4;
}

.compact-list,
.meta-list {
  margin: 0;
  padding-left: 1.2rem;
}

.section-heading {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.section-heading--with-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.section-action {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--accent);
  background: rgba(200, 165, 110, 0.16);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.section-action:hover,
.section-action:focus-visible {
  background: rgba(200, 165, 110, 0.26);
}

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-grid--extra {
  margin-top: 1rem;
}

.projects-hint {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  cursor: pointer;
}

.projects-hint__dots {
  display: inline-flex;
  gap: 0.45rem;
}

.projects-hint__dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.75;
}

.projects-hint__text {
  margin-bottom: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.projects-hint:hover .projects-hint__dots span,
.projects-hint:focus-visible .projects-hint__dots span {
  opacity: 1;
}

.projects-hint:hover .projects-hint__text,
.projects-hint:focus-visible .projects-hint__text {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.22em;
}

.card {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--accent);
  border: 1px solid var(--line);
  background: transparent;
  text-decoration: none;
}

.project-link:hover,
.project-link:focus-visible {
  border-color: var(--accent);
  background: rgba(200, 165, 110, 0.12);
}

.project-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

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

.meta-list {
  color: var(--text-soft);
}

.stack {
  display: grid;
  gap: 1rem;
}

.section-footer {
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.section-link,
.entry-link {
  text-decoration: none;
}

.section-link {
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-link:hover,
.section-link:focus-visible,
.entry-link:hover,
.entry-link:focus-visible {
  color: var(--accent);
}

.entry {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.entry-link {
  text-decoration: none;
}

.entry-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.post-shell,
.post-body {
  padding: 1.5rem;
}

.post-title {
  max-width: 18ch;
}

.post-body {
  max-width: 48rem;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.two-column {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
}

.contact-box {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
}

.contact-box p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.contact-box p:last-child {
  margin-bottom: 0;
}

.contact-note {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
}

@media (min-width: 1600px) {
  :root {
    --max-width: 72rem;
  }

  html {
    font-size: 16px;
  }
}

@media (max-width: 900px) {
  .overview-layout,
  .overview-notes,
  .site-header,
  .section-heading--with-action,
  .two-column,
  .project-grid,
  .entry {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
    justify-items: start;
  }

  .site-header__intro {
    display: contents;
  }

  .header-actions {
    order: 2;
  }

  .site-header__intro .eyebrow {
    order: 1;
  }

  .site-header__intro h1,
  .site-header__intro .subtitle {
    order: 3;
  }

  .section-action {
    justify-self: start;
  }

  .portrait-placeholder {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.5rem;
  }

  .masthead,
  .content-section {
    padding: 0.9rem;
  }

  h1 {
    font-size: clamp(1.55rem, 8.5vw, 2.2rem);
  }

  h2 {
    font-size: clamp(1.4rem, 7vw, 1.9rem);
  }

  h3 {
    font-size: 1.08rem;
  }

  .site-header {
    gap: 0.75rem;
  }

  .header-actions {
    gap: 0.65rem;
  }

  .site-nav {
    width: auto;
    gap: 0.75rem;
  }

  .availability-note {
    justify-self: start;
    width: auto;
    margin-left: 0;
    text-align: left;
    white-space: normal;
  }

  .theme-toggle {
    width: auto;
  }

  .overview-layout {
    gap: 1rem;
  }

  .portrait-placeholder {
    justify-self: center;
  }

  .portrait-image {
    width: min(100%, 13rem);
  }

  .overview-text {
    gap: 0.85rem;
  }

  .overview-text .lead,
  .overview-text .overview-secondary,
  .overview-text .overview-aside {
    text-align: justify;
  }

  .site-header .intro-secondary {
    text-align: justify;
  }
  .project-grid {
    gap: 0.85rem;
  }

  .card {
    padding: 0.85rem;
  }

  .projects-hint {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .entry {
    gap: 0.5rem;
  }

  .post-shell,
  .post-body {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .page-shell {
    width: min(calc(100% - 0.75rem), var(--max-width));
  }

  .masthead,
  .content-section {
    padding: 0.8rem;
  }

  .site-nav {
    gap: 0.55rem 0.8rem;
  }

  .theme-toggle {
    padding: 0.45rem 0.65rem;
  }

  .overview-note {
    padding: 0.75rem 0.8rem;
  }

  .section-action {
    padding: 0.45rem 0.7rem;
  }

  .card-top {
    gap: 0.5rem;
  }

  .project-link {
    width: 1.8rem;
    height: 1.8rem;
  }

  .contact-box {
    gap: 0.6rem;
  }

  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.76rem;
  }
}
