:root {
  color-scheme: dark;
  --bg: #161714;
  --text: #f0f0e9;
  --muted: #96998d;
  --accent: #e4e4de;
  --line: #35372f;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { width: min(calc(100% - 80px), 1040px); margin: 0 auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }
header {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr);
  align-items: end;
  gap: var(--s12);
  padding-block: var(--s16);
}
.role {
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 1.6px;
}
h1 {
  margin: 0;
  font-size: clamp(64px, 8.5vw, 104px);
  line-height: 1;
  letter-spacing: -.06em;
  font-weight: 750;
  white-space: nowrap;
}
h1 .ending { color: var(--accent); font-weight: 400; }
h1 .mark {
  display: inline-block;
  vertical-align: top;
  margin: var(--s2) 0 0 var(--s4);
  color: var(--accent);
  font-size: .3em;
  letter-spacing: 0;
}
.intro-block { max-width: 300px; min-width: 0; justify-self: end; }
.highlights { margin: 0; font-size: 12px; line-height: 20px; }
.highlights > div { display: grid; grid-template-columns: 44px 1fr; gap: var(--s2); }
.highlights > div + div { margin-top: var(--s1); }
.highlights dt { color: var(--muted); }
.highlights dd { margin: 0; }
.highlights strong { font-weight: 600; }
section[aria-labelledby="projects-title"] { padding-top: 80px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
h2 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 500; }
#project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s6); }
.project { min-width: 0; }
.project-logo { display: flex; align-items: center; justify-content: center; height: clamp(130px, 15vw, 170px); padding: var(--s4); }
.project-logo img { display: block; max-width: 80%; max-height: 80%; width: auto; height: auto; transition: opacity .45s ease, transform .55s cubic-bezier(.2,.7,.2,1); }
.project-logo:hover img { opacity: .75; transform: scale(1.035); }
.project-details { display: flex; align-items: center; gap: var(--s3); padding-top: var(--s2); }
.project-main { flex: 1; min-width: 0; }
.project-links { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: 12px; line-height: 20px; color: var(--muted); }
.project-arrow { font-size: 22px; line-height: 28px; color: var(--muted); }
footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s6);
  margin-top: var(--s12);
  padding-block: var(--s6) var(--s8);
  border-top: 1px solid var(--line);
}
#socials { min-width: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); font-size: 12px; line-height: 20px; color: var(--muted); }
.contact { display: inline-block; margin-top: var(--s6); border: 1px solid rgb(240 240 233 / .38); color: rgb(240 240 233 / .72); text-align: center; border-radius: 5px; padding: 8px 16px; font-size: 11px; line-height: 18px; font-weight: 400; white-space: nowrap; }
.contact:hover { border-color: rgb(240 240 233 / .72); color: var(--text); }
@media (max-width: 760px) {
  main { width: calc(100% - 48px); }
  section[aria-labelledby="projects-title"] { padding-top: var(--s16); }
  header { grid-template-columns: 1fr; gap: var(--s6); padding-block: var(--s12); }
  h1 { font-size: clamp(56px, 12vw, 88px); }
  .role { margin-top: var(--s3); }
  .intro-block { justify-self: start; max-width: none; }
  #project-grid { gap: var(--s8) var(--s4); }
  .project-details { gap: var(--s2); }
  .project-arrow { font-size: 20px; line-height: 24px; }
  .project-links { gap: var(--s1) var(--s3); }
  footer { margin-top: var(--s8); }
}
@media (max-width: 600px) {
  main { width: calc(100% - 40px); }
  header { padding-block: var(--s8) var(--s12); }
  .section-heading { margin-bottom: var(--s4); }
  #project-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .project-logo { height: 130px; padding: var(--s3); }
  .project-details { min-width: 0; }
  .project-links { gap: 4px 12px; font-size: 12px; line-height: 20px; }
  footer { gap: var(--s4); padding-block: var(--s6); }
  #socials { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--s2) var(--s3); }
  .contact { padding-inline: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* The cutout sits behind the header content, without a frame. */
header {
  position: relative;
  isolation: isolate;
  background: var(--bg);
  min-height: 660px;
  overflow: hidden;
  padding-block: 160px var(--s6);
}
.hero-portrait {
  position: absolute;
  z-index: -2;
  right: 0;
  top: 24px;
  width: 100%;
  height: calc(100% - 24px);
  object-fit: cover;
  object-position: center top;
  --portrait-opacity: .78;
  opacity: var(--portrait-opacity);
  mix-blend-mode: normal;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}
header::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 46%, rgb(22 23 20 / .3) 70%, rgb(22 23 20 / .8) 100%);
}
.hero-name, .intro-block { position: relative; top: 21px; }
header .highlights { text-shadow: 0 1px 12px var(--bg); }
@media (max-width: 760px) {
  header { min-height: 520px; margin-inline: -24px; padding: 260px 24px var(--s6); }
  .hero-portrait { right: 0; width: 100%; height: 100%; --portrait-opacity: .55; object-position: center top; }
  header::after { background: linear-gradient(90deg, rgb(22 23 20 / .55), transparent 85%), linear-gradient(to bottom, transparent 25%, var(--bg) 95%); }
  .intro-block { max-width: 320px; }
}
@media (max-width: 600px) {
  header { margin-inline: -20px; gap: var(--s6); padding-inline: 20px; padding-top: 260px; }
  header h1 { font-size: clamp(48px, 11vw, 64px); }
}

.project-links a { max-width: 100%; overflow-wrap: anywhere; }
.project-arrow { flex: 0 0 auto; }

/* The photo and copy enter in sequence, echoing the reference site's opening rhythm. */
.hero-portrait { animation: portrait-enter 1.1s cubic-bezier(.2,.7,.2,1) both; }
.hero-name h1 { animation: rise-enter .65s cubic-bezier(.2,.7,.2,1) .2s both; }
.hero-name .role { animation: rise-enter .65s cubic-bezier(.2,.7,.2,1) .35s both; }
.highlights { animation: rise-enter .65s cubic-bezier(.2,.7,.2,1) .5s both; }
.contact { animation: rise-enter .65s cubic-bezier(.2,.7,.2,1) .58s both; }
.section-heading { animation: rise-enter .6s cubic-bezier(.2,.7,.2,1) .65s both; }
.project { animation: card-enter .6s cubic-bezier(.2,.7,.2,1) var(--card-delay, .98s) both; }
.project-arrow { transition: transform .3s ease, color .3s ease; }
.project:hover .project-arrow { transform: translate(3px, -3px); color: var(--text); }
.project-links a { position: relative; }
.project-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.project-links a:hover::after, .project-links a:focus-visible::after { transform: scaleX(1); }
.contact { transition: border-color .3s ease, color .3s ease; }
@keyframes portrait-enter {
  from { opacity: 0; transform: scale(1.03); filter: brightness(.7); }
  to { opacity: var(--portrait-opacity); transform: none; filter: none; }
}
@keyframes rise-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes card-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 380px) {
  #socials { grid-template-columns: 1fr; }
  .contact { font-size: 11px; padding-inline: var(--s3); }
}
