:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #f0f1ed;
  --text: #17191b;
  --text-soft: #50565c;
  --border: #cfd5da;
  --border-strong: #959ca3;
  --accent: #1f3a52;
  --max-width: 1280px;
  --narrow-width: 940px;
  --shadow: 0 8px 24px rgba(23, 25, 27, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration-color: rgba(31, 58, 82, 0.35);
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  text-decoration-color: currentColor;
}

button,
.button {
  font: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  background: var(--text);
  color: #fff;
}

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

.container {
  width: min(calc(100% - 0.75rem), var(--max-width));
  margin: 0 auto;
}

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

.section {
  padding: 4.5rem 0;
}

.section-muted {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 247, 244, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.site-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.93rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.98rem;
}

.site-nav a.is-active,
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-toggle {
  display: none;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.hero {
  padding-top: 5.5rem;
}

.hero-grid,
.cta-panel,
.contact-grid,
.skill-groups {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: 2.3fr 1fr;
  align-items: start;
}

.hero-copy,
.hero-panel,
.project-card,
.cta-panel,
.contact-item,
.resume-entry,
.skill-group,
.project-figure,
.note-section {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.cta-panel,
.resume-entry,
.skill-group,
.project-figure,
.note-section {
  padding: 1.75rem;
}

.hero h1,
.page-header h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
}

.page-header h1 {
  font-size: clamp(2.25rem, 5vw, 3.6rem);
}

.hero-headline {
  margin: 1rem 0 0;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  color: var(--text);
  max-width: 38rem;
}

.hero-intro,
.lead,
.section-heading p,
.project-card p,
.cta-panel p,
.contact-item p,
.resume-entry p,
.project-section p,
.skill-group p {
  color: var(--text-soft);
}

.eyebrow,
.card-index {
  margin: 0 0 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.75rem 1.05rem;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button-primary {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #2d3135;
  border-color: #2d3135;
}

.button-secondary {
  background: var(--surface);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: var(--surface-muted);
}

.compact-list,
.tag-list,
.resume-entry ul,
.project-section ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.compact-list li,
.tag-list li,
.resume-entry li,
.project-section li {
  margin-bottom: 0.55rem;
}

.section-heading {
  margin-bottom: 1.8rem;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card {
  padding: 0;
}

.project-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.28rem;
}

.project-card-link {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  height: 100%;
  padding: 1.5rem;
  text-decoration: none;
}

.project-card-link,
.project-card-link:hover,
.project-card-link:focus-visible,
.project-card-link * {
  text-decoration: none;
}

.project-card-link:hover,
.project-card-link:focus-visible {
  background: var(--surface-muted);
}

.project-card-link-wide {
  grid-template-columns: 1fr;
  min-height: 10rem;
  align-items: center;
}

.project-card-media {
  margin: 0;
  height: 100%;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #eef1f3;
}

.project-card-body {
  min-width: 0;
}

.project-card h3 a,
.project-card-link h3 {
  text-decoration: none;
}

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

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

.project-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.project-list-figure {
  margin: 0;
}

.project-list-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #eef1f3;
}

.project-list-figure figcaption {
  padding-top: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.cta-panel {
  grid-template-columns: 2fr auto;
  align-items: center;
}

.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-item {
  padding: 1.4rem;
}

.contact-item h3,
.resume-entry h3,
.skill-group h3,
.project-section h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.resume-section + .resume-section,
.project-section + .project-section {
  margin-top: 1.35rem;
}

.resume-section h2 {
  margin-bottom: 1rem;
}

.resume-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.skill-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-figure img {
  width: 100%;
  border: 1px solid var(--border);
  background: #eef1f3;
}

.project-figure figcaption {
  padding-top: 0.9rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.note-section {
  border-left: 4px solid var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  color: var(--text-soft);
}

@media (max-width: 860px) {
  .hero-grid,
  .cta-panel,
  .contact-grid,
  .skill-groups,
  .project-list-grid {
    grid-template-columns: 1fr;
  }

  .project-card-link {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: flex-start;
    padding: 1rem 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 0.8rem 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 560px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .container,
  .narrow {
    width: min(calc(100% - 0.5rem), 100%);
  }

  .hero-copy,
  .hero-panel,
  .cta-panel,
  .resume-entry,
  .skill-group,
  .project-figure,
  .note-section {
    padding: 1.25rem;
  }
}
