:root {
  --bg: #f5f4f0;
  --text: #151515;
  --muted: #6f6d67;
  --line: #d7d4cc;
  --accent: #046c94;
  --max: 1180px;
  --side: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

img {
  max-width: 100%;
  height: auto;
}

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

button { font: inherit; }

a {
  color: inherit;
  text-decoration: none;
}

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

nav {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 18px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  color: var(--muted);
  font-size: 14px;
}

.nav-links a { transition: color .2s ease; }
.nav-links a:hover { color: var(--text); }

.hero {
  min-height: calc(100svh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: center;
  gap: clamp(42px, 8vw, 90px);
  padding: clamp(56px, 8vw, 90px) 0 clamp(72px, 9vw, 105px);
}

.eyebrow {
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 108px);
  line-height: .91;
  letter-spacing: -.075em;
  font-weight: 700;
  max-width: 850px;
}

.hero-copy {
  max-width: 540px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 19px);
}

.portrait-wrap { width: 100%; }

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #ddd9d0;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  filter: saturate(.82);
}

.portrait-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

section {
  padding: clamp(78px, 11vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 50px);
  margin-bottom: clamp(42px, 6vw, 65px);
}

.section-number {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
}

h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.055em;
  max-width: 760px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 6vw, 60px);
  margin-left: clamp(0px, 23vw, 270px);
  max-width: 900px;
}

.about-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.project-card {
  padding: clamp(28px, 4vw, 42px) 0 clamp(34px, 5vw, 52px);
  border-top: 1px solid var(--line);
}

.project-card:last-child { border-bottom: 1px solid var(--line); }

.project-top {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: start;
}

.project-number {
  color: var(--muted);
  font-size: 13px;
  padding-top: 6px;
}

.project-top h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.project-top p {
  margin: 0;
  color: var(--muted);
  max-width: 680px;
  font-size: 15px;
}

.project-tech {
  justify-self: end;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.more-button {
  border: 0;
  border-bottom: 1px solid var(--text);
  background: transparent;
  padding: 4px 0 5px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.more-button span {
  display: inline-block;
  margin-left: 8px;
  transition: transform .2s ease;
}

.more-button:hover span { transform: translate(3px, -3px); }

.statement {
  min-height: 60svh;
  display: flex;
  align-items: center;
}

.statement p {
  margin: 0;
  max-width: 1000px;
  font-size: clamp(38px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -.06em;
}

.statement em {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

footer {
  padding: 28px 0 45px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}

footer a { color: var(--text); }

.fade {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeIn .8s ease forwards;
}

.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  padding: max(16px, env(safe-area-inset-top))
           max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom))
           max(16px, env(safe-area-inset-left));
  background: rgba(21, 21, 21, .76);
  align-items: center;
  justify-content: center;
}

.modal.is-open { display: flex; }

.modal-panel {
  width: min(1040px, 100%);
  max-height: min(90svh, 920px);
  overflow: auto;
  background: var(--bg);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-title {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -.045em;
  line-height: 1;
}

.modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.modal-gallery img {
  width: 100%;
  display: block;
  background: #dedbd3;
}

/* Medium */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    min-height: auto;
  }

  .portrait {
    width: min(460px, 100%);
  }

  .about-grid {
    margin-left: 0;
  }
}

/* Tablet / small screens */
@media (max-width: 760px) {
  nav {
    min-height: 70px;
  }

  .nav-links {
    gap: 16px;
    font-size: 13px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-top {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
  }

  .project-tech {
    grid-column: 2;
    justify-self: start;
    text-align: left;
    margin-top: 3px;
  }

  .project-action {
    justify-content: flex-start;
    margin-left: 60px;
  }

  .modal {
    align-items: flex-end;
  }

  .modal-panel {
    width: 100%;
    max-height: 94svh;
    padding: 18px 16px 20px;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }
}

/* Phones */
@media (max-width: 520px) {
  :root { --side: 16px; }

  .nav-links a:first-child { display: none; }

  .hero {
    padding-top: 54px;
    gap: 42px;
  }

  .hero-copy {
    margin-top: 28px;
  }

  .portrait-caption {
    font-size: 11px;
  }

  section {
    padding: 72px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-top h3 {
    font-size: 25px;
  }

  .project-top p {
    font-size: 14px;
  }

  .project-action {
    margin-left: 60px;
  }

  .statement {
    min-height: 48svh;
  }

  footer {
    flex-direction: column;
  }
}

/* Very narrow phones */
@media (max-width: 360px) {
  .brand { font-size: 16px; }
  .nav-links { font-size: 12px; }
  h1 { font-size: 48px; }
  .project-top {
    grid-template-columns: 36px minmax(0,1fr);
    gap: 12px;
  }
  .project-action { margin-left: 48px; }
}

.logo-link {
  display:inline-flex;
  align-items:center;
  width:clamp(270px, 31vw, 390px);
  flex:0 0 auto;
}
.logo-link img {
  display:block;
  width:100%;
  height:auto;
}
@media (max-width:760px) {
  .logo-link { width:270px; }
}
@media (max-width:520px) {
  .logo-link { width:225px; }
}
