:root {
  --bg: #e9e4da;
  --bg-header: #ebe6dd;
  --ink: #1c1915;
  --muted: #6a6358;
  --soft: #8a8276;
  --line: #d4cec3;
  --card: #f3efe7;
  --card-border: #d8d2c6;
  --white: #f7f4ee;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --max: 980px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-header) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  gap: 1.35rem;
  align-items: center;
}
.nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 500;
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--muted); }
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 5.2rem 0 3.4rem;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 600;
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 9vw, 6.1rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 1.15rem;
}
.lede {
  margin: 0 0 1.8rem;
  color: var(--ink);
  font-size: 1.15rem;
}
.actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-solid { background: var(--ink); color: var(--white); }
.btn-solid:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(28,25,21,0.06); }

hr.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* Sections */
section {
  padding: 3.4rem 0;
}
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 600;
  margin: 0 0 1.15rem;
}
.prose p {
  margin: 0 0 1.05rem;
  max-width: 38rem;
}
.prose p:last-child { margin-bottom: 0; }

/* Experience */
.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.job:first-of-type { padding-top: 0.2rem; }
.job:last-child { border-bottom: 0; }
.job h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.job .meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.job .dates {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  padding-top: 0.45rem;
}
.job ul {
  grid-column: 1 / -1;
  margin: 0.7rem 0 0;
  padding: 0 0 0 1.1rem;
  max-width: 42rem;
}
.job li {
  margin: 0 0 0.35rem;
  color: var(--ink);
}
.job li::marker { color: var(--soft); }

/* Projects */
.intro-note {
  color: var(--muted);
  margin: -0.4rem 0 1.4rem;
}
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ph {
  aspect-ratio: 16 / 11;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 0.6px), var(--card-border) calc(50% - 0.6px), var(--card-border) calc(50% + 0.6px), transparent calc(50% + 0.6px)),
    linear-gradient(to top right, transparent calc(50% - 0.6px), var(--card-border) calc(50% - 0.6px), var(--card-border) calc(50% + 0.6px), transparent calc(50% + 0.6px)),
    var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--soft);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem;
}
.ph-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 650;
}
.ph-sub { font-size: 0.82rem; margin-top: 0.25rem; }
.card-body { padding: 0.85rem 1rem 1.15rem; }
.ph-swap {
  font-size: 0.82rem;
  color: var(--soft);
  margin: 0 0 0.65rem;
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  margin: 0 0 0.2rem;
  font-weight: 600;
}
.card .meta { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.15rem; }
.card .dates { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.7rem; }
.card ul { margin: 0; padding-left: 1.1rem; }
.card li { margin: 0 0 0.4rem; }
.card .blurb { margin: 0; }

/* Skills */
.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}
.skill {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  padding: 1.15rem 1.15rem 1.25rem;
}
.skill h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  margin: 0 0 0.45rem;
  font-weight: 600;
}
.skill p { margin: 0; color: var(--ink); font-size: 0.98rem; }

/* Education / contact */
.edu-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.edu-head h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0;
  font-weight: 600;
}
.edu .when {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 600;
}
.edu p { margin: 0.3rem 0 0; color: var(--ink); }

.contact-intro { margin: 0 0 1.3rem; }
.field { margin: 0 0 1.1rem; }
.field .lbl {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 650;
  margin-bottom: 0.2rem;
}
.field a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
}
.footer-inner {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.foot-id { color: var(--muted); font-size: 0.92rem; }
.foot-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.foot-nav a { text-decoration: none; font-size: 0.92rem; }
.foot-nav a:hover { text-decoration: underline; }

@media (max-width: 800px) {
  .projects, .skills { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
  .job .dates { text-align: left; padding-top: 0.15rem; }
  .hero { padding: 3.2rem 0 2.4rem; }
  .hero h1 { font-size: clamp(3rem, 16vw, 4.4rem); }
}

@media (max-width: 720px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 24px 1rem;
    gap: 0.85rem;
  }
  .nav.open { display: flex; }
  .wrap, .header-inner, .footer-inner { width: min(var(--max), calc(100% - 32px)); }
  section { padding: 2.6rem 0; }
}

/* Header: a few more nav items */
.nav { gap: 1.1rem; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* Interests */
.interests p { max-width: 38rem; margin: 0 0 1.05rem; }
.interests p:last-child { margin-bottom: 0; }

/* Expanded experience prose */
.job .story {
  grid-column: 1 / -1;
  max-width: 42rem;
  margin: 0.7rem 0 0;
}
.job .story p { margin: 0 0 0.8rem; }
.job .story p:last-child { margin-bottom: 0; }

/* Designs */
.page { padding-bottom: 3rem; }
.hero.tight { padding-bottom: 2.2rem; }
.crumb { margin: 0 0 0.85rem; font-size: 0.95rem; color: var(--muted); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.designs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  padding: 2.4rem 0 1rem;
}
.design-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}
.design-cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
}
.design-cover img, .media-item img, .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.design-card h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.design-card h2 a { text-decoration: none; }
.design-card h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.thumb-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.55rem;
  margin-top: 1rem;
}
.thumb {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
}
.thumb img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--card-border);
  background: var(--bg);
}

/* Tabs */
.media-tabs { padding: 2.2rem 0 1rem; }
.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.2rem;
}
.tab {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.tab.is-selected, .tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--white);
}
.tab .count {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 0.15rem;
}
.tab-fallback {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 0.8rem;
}
body.js .tab-fallback { display: none; }
body.js .tab-panel { display: none; }
body.js .tab-panel.is-selected { display: block; }

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 800px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .designs-grid { gap: 1.8rem; }
}
.media-item {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.media-item img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--card); }
.media-item figcaption {
  padding: 0.55rem 0.75rem 0.7rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.pdf-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-height: 12rem;
  padding: 1.2rem;
  text-decoration: none;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 0.6px), var(--card-border) calc(50% - 0.6px), var(--card-border) calc(50% + 0.6px), transparent calc(50% + 0.6px)),
    linear-gradient(to top right, transparent calc(50% - 0.6px), var(--card-border) calc(50% - 0.6px), var(--card-border) calc(50% + 0.6px), transparent calc(50% + 0.6px)),
    var(--card);
}
.pdf-card span:last-child { font-weight: 600; }

@media (max-width: 900px) {
  .nav { gap: 0.85rem; }
}
