:root {
  --background: #fefdfb;
  --surface: #faf8f3;
  --surface-warm: #f3efe6;
  --ink: #1c1c1a;
  --muted: #666460;
  --line: #d8d4cc;
  --rust: #8a5a36;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --content-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--background);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(calc(100% - 3rem), var(--content-width));
  margin-inline: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6.4rem;
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--rust);
  text-underline-offset: 0.45rem;
  text-decoration-thickness: 1px;
}

.page-view {
  min-height: calc(100vh - 10rem);
  padding: 3rem 0 6rem;
  animation: view-in 400ms ease both;
}

.page-view[hidden] {
  display: none;
}

.page-view:focus-visible {
  outline: none;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 4rem;
  align-items: center;
  min-height: 70vh;
}

.hero-descriptor,
.section-kicker,
.section-label,
.card-tags {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-descriptor {
  margin-bottom: 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.hero-blurb {
  max-width: 440px;
  margin: 0 0 2.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1.15rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.sketch-border {
  border: 1px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

.sketch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.sketch-button:hover {
  background: var(--surface-warm);
  transform: translateY(-2px);
}

.text-link,
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.portrait-wrap {
  position: relative;
  margin: 0;
  height: auto;
  aspect-ratio: 5 / 6;
  overflow: visible;
  background: var(--surface);
}

.hero-portrait {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  filter: grayscale(10%);
}

@media (min-width: 801px) {
  .portrait-wrap {
    width: 90%;
    justify-self: end;
  }
}

.content-column {
  max-width: 800px;
}

.page-title {
  max-width: 800px;
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.editorial-intro {
  max-width: 760px;
  margin: 0 0 4rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.35;
}

.work-section {
  margin: 0 0 5rem;
}

.section-label {
  margin-bottom: 1.5rem;
}

.timeline {
  margin-left: 0;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.timeline-node {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-node::before {
  position: absolute;
  top: 0.6rem;
  left: calc(-1.5rem - 4px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.timeline-node:last-child {
  margin-bottom: 0;
}

.timeline-node h3,
.scope-card h3,
.project-card h2,
.contact-panel h2,
.dialog-inner h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
}

.timeline-node h3 {
  font-size: 1.5rem;
}

.timeline-node p {
  color: var(--ink);
}

.timeline-node .role {
  margin: 0.1rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-feature p + p {
  margin-top: 1.1rem;
}

.evolution-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.evolution-chain span:nth-child(odd) {
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: var(--surface-warm);
  color: var(--ink);
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.scope-card {
  padding: 1rem;
  background: #f4f1ea;
  font-size: 0.85rem;
}

.scope-card:last-child {
  grid-column: auto;
}

.scope-card h3 {
  margin-bottom: 0.25rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
}

.scope-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
}

.building-copy p {
  margin: 0 0 1.25rem;
  color: #333230;
}

.philosophy-box {
  margin: 4rem 0;
  padding: 2rem;
  background: var(--surface-warm);
}

.philosophy-box > p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.35;
}

.philosophy-box footer {
  max-width: 680px;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.credentials {
  margin: 0;
}

.credentials div {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.credentials dt {
  font-weight: 600;
}

.credentials dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.projects-header {
  max-width: 800px;
  margin-bottom: 3rem;
}

.hand-note,
.card-note {
  color: var(--rust);
  font-family: var(--hand);
}

.hand-note {
  margin: 0;
  color: var(--muted);
  font-size: 1.4rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  padding: 2rem;
  background: var(--surface);
  transition: transform 160ms ease;
}

.project-card:hover {
  transform: translateY(-3px) rotate(-0.1deg);
}

.project-card:nth-child(even):hover {
  transform: translateY(-3px) rotate(0.1deg);
}

.card-note {
  position: absolute;
  top: -12px;
  right: 15px;
  margin: 0;
  padding: 0 5px;
  background: var(--background);
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(-2deg);
}

.project-card h2 {
  font-size: 1.6rem;
}

.card-tags {
  margin: 0.5rem 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.project-card > p:not(.card-note, .card-tags) {
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.project-external-link[hidden] {
  display: none;
}

.page-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.page-cta p {
  margin: 0;
  color: var(--muted);
}

.about-layout {
  max-width: 650px;
}

.about-copy > p:not(.section-kicker) {
  margin: 0 0 1.5rem;
  color: #333230;
  font-size: 1.1rem;
}

.about-copy .page-title {
  margin-bottom: 2rem;
  font-size: 2.2rem;
}

.contact-block {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.contact-block h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.2;
}

.contact-block p {
  margin: 0 0 1.25rem;
}

.contact-panel {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  background: var(--surface-warm);
}

.contact-panel .hand-note {
  margin: -1rem 0 0.25rem;
}

.contact-panel h2 {
  font-size: 2rem;
}

.contact-panel > p:not(.hand-note, .form-status) {
  color: var(--muted);
}

.form-divider {
  height: 1px;
  margin: 2rem 0;
  background: var(--line);
}

.contact-panel h3 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
}

.form-status {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.contact-form {
  display: grid;
  gap: 0.45rem;
}

.contact-form label {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #aaa295;
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  min-height: 46px;
  margin-top: 0.8rem;
  border: 1px solid #aaa295;
  background: #ded7cc;
  color: #6b665f;
  cursor: not-allowed;
}

.project-dialog {
  width: min(640px, calc(100% - 2rem));
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.project-dialog::backdrop {
  background: rgba(28, 28, 25, 0.56);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  position: relative;
  max-height: 88vh;
  padding: clamp(1.7rem, 5vw, 3rem);
  overflow-y: auto;
  background: var(--background);
}

.dialog-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.8rem;
  cursor: pointer;
}

.dialog-inner h2 {
  margin-top: 0.5rem;
  padding-right: 2rem;
  font-size: 2.3rem;
}

.dialog-copy h3 {
  margin: 0 0 1rem;
  padding-right: 2rem;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.2;
}

.dialog-copy p {
  color: #45423d;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.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;
}

.noscript-message {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  max-width: 360px;
  padding: 1rem;
  background: var(--ink);
  color: var(--background);
  font-size: 0.85rem;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .site-header,
  main,
  .site-footer {
    width: min(calc(100% - 2rem), var(--content-width));
  }

  .site-nav {
    min-height: 5.5rem;
  }

  .hero-split,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .hero-split {
    gap: 2rem;
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: 2.8rem;
  }

  .portrait-wrap {
    width: min(100%, 560px);
  }

  .scope-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .scope-card:last-child {
    grid-column: auto;
  }

  .two-column-copy {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .project-card {
    min-height: 310px;
  }

  .about-layout {
    gap: 4rem;
  }

  .contact-panel {
    max-width: 560px;
  }
}

@media (max-width: 540px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.8rem 0 0.5rem;
  }

  .nav-brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links a {
    min-height: 44px;
  }

  .page-view {
    padding: 3.5rem 0 4.5rem;
  }

  .hero-descriptor {
    max-width: 280px;
  }

  .hero-actions {
    align-items: center;
    flex-direction: row;
    gap: 1.5rem;
  }

  .timeline {
    padding-left: 1.25rem;
  }

  .timeline-node::before {
    left: calc(-1.25rem - 4px);
  }

  .evolution-chain {
    align-items: flex-start;
    flex-direction: column;
  }

  .evolution-chain span:nth-child(even) {
    padding-left: 0.55rem;
    transform: rotate(90deg);
  }

  .credentials div,
  .page-cta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .credentials dd {
    text-align: left;
  }

  .project-card {
    min-height: 0;
  }

  .project-card .text-button {
    margin-top: 1.5rem;
  }

  .site-footer {
    min-height: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
