/* Studio: a small page that follows the device's colour scheme. */
:root {
  color-scheme: light dark;
  --paper: #f8f9fa;
  --ink: #20262b;
  --muted: #606b75;
  --hover: #e9edf1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171a1d;
    --ink: #e9edf0;
    --muted: #a4acb3;
    --hover: #242a30;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
::selection { background: var(--ink); color: var(--paper); }
.page {
  width: min(calc(100% - 84px), 900px);
  min-height: 100svh;
  margin-inline: auto;
  padding-top: 30px;
  padding-bottom: 48px;
}
.masthead { text-align: center; }
.domain,
.project-domain {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.02em;
  color: var(--muted);
}
main {
  --intro-height: clamp(205px, 28svh, 300px);
  --portrait-height: clamp(287px, 39.2svh, 360px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px minmax(0, 1fr);
  align-items: start;
  gap: clamp(56px, 6.25vw, 80px);
  padding-top: clamp(96px, calc(32svh - 50px), 270px);
}
.portrait {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  min-height: 0;
  min-width: 0;
  align-self: stretch;
}
.portrait img {
  flex: none;
  display: block;
  height: var(--portrait-height);
  margin-block: calc((var(--intro-height) - var(--portrait-height)) / 2);
  width: auto;
  max-width: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-height: var(--intro-height);
}
h1 {
  margin: 0;
  font-size: 58px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.intro p {
  margin: 24px 0 0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -.02em;
  color: var(--muted);
  text-wrap: pretty;
}
.projects {
  margin-top: 0;
  align-self: stretch;
  justify-self: start;
  width: max-content;
  max-width: 100%;
}
.project-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 0;
}
.project {
  display: block;
  margin-inline: -16px;
  padding: 22px 16px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 150ms ease;
}
.project-details { display: grid; gap: 9px; }
.project-name {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.project-domain { overflow-wrap: anywhere; }
@media (hover: hover) {
  .project:hover { background: var(--hover); }
}
.project:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  background: var(--hover);
}
@media (max-width: 1000px) {
  .page { width: min(calc(100% - 56px), 570px); }
  main {
    --intro-height: 142.7265625px;
    --portrait-height: 168.4140625px;
    grid-template-columns: minmax(0, .7fr) minmax(0, 1.45fr);
    column-gap: 28px;
    row-gap: 28px;
    padding-top: clamp(96px, 16svh, 160px);
  }
  .portrait img {
    margin-inline: auto;
  }
  .intro { display: block; text-align: left; }
  .projects {
    grid-column: 2;
    margin-top: 0;
    justify-self: stretch;
    align-self: start;
    width: auto;
  }
  .project-list { display: grid; height: auto; }
}
@media (max-width: 560px) {
  .page {
    width: calc(100% - 56px);
    display: grid;
    grid-template-rows: auto minmax(min-content, 1fr) auto;
    padding-top: 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(24px, 3.3svh, 28px);
    align-self: center;
    padding-top: 0;
  }
  .portrait {
    width: 156px;
    align-self: start;
    justify-self: center;
  }
  .portrait img {
    margin: 0;
    width: 100%;
    height: auto;
  }
  h1 { font-size: 44px; word-spacing: .10em; }
  .intro { min-height: 0; max-width: 340px; }
  .intro p { margin-top: 24px; }
  .projects { grid-column: 1; margin-top: 0; }
  .project { padding: 18px 16px; }
}
@media (max-width: 560px) and (max-height: 700px) {
  .portrait { width: 135px; }
}
@media (prefers-reduced-motion: reduce) {
  .project { transition: none; }
}

/* The contact control mirrors the masthead and opens towards the page. */
[hidden] { display: none !important; }
.visually-hidden,
.contact-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.contact-footer {
  position: fixed;
  z-index: 5;
  inset-inline: 0;
  bottom: max(30px, env(safe-area-inset-bottom));
  margin-inline: auto;
  width: min(calc(100% - 56px), 1000px);
  text-align: center;
}
.contact-toggle,
.contact-fallback {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -.02em;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.contact-toggle:hover { color: var(--ink); }
.contact-toggle:focus-visible { outline: 2px solid var(--muted); outline-offset: 6px; }
.contact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px minmax(0, 1fr);
  column-gap: 12px;
  align-items: end;
  text-align: left;
  opacity: 0;
  transform: translateY(10px) scale(.96);
  transform-origin: bottom center;
  transition: opacity 220ms ease, transform 260ms ease;
}
.contact-form.is-open { opacity: 1; transform: none; }
.contact-message,
.contact-email {
  position: relative;
  border-radius: 26px;
  background: var(--hover);
  color: var(--ink);
  transition: box-shadow 150ms ease;
}
.contact-message { grid-column: 2; grid-row: 1; min-width: 0; }
.contact-message:focus-within,
.contact-email:focus-within { box-shadow: 0 0 0 1px var(--muted); }
.contact-message textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: min(280px, 35svh);
  padding: 16px 42px 16px 20px;
  border: 0;
  outline: none;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  overflow-y: hidden;
}
.contact-message.has-text textarea { padding-bottom: 34px; }
.contact-message textarea::placeholder,
.contact-email input::placeholder { color: var(--muted); opacity: 1; }
.contact-close {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}
.contact-close:hover { color: var(--ink); }
.contact-count {
  position: absolute;
  bottom: 12px;
  left: 20px;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.contact-count.is-over { color: light-dark(#a52a32, #f1a0a6); }
.contact-controls { grid-column: 1; grid-row: 1; display: flex; padding-left: 62px; align-items: center; }
.contact-email { flex: 1; min-width: 0; }
.contact-email input {
  width: 100%;
  height: 52px;
  padding: 16px 32px 16px 18px;
  border: 0;
  outline: none;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
}
.contact-email-check { position: absolute; right: 14px; top: 17px; font-size: 14px; color: var(--muted); }
.contact-send {
  display: grid;
  place-items: center;
  grid-column: 3;
  grid-row: 1;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 26px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 150ms ease;
}
.contact-send:disabled { opacity: .35; cursor: default; }
.contact-send:focus-visible,
.contact-close:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
.contact-status {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 100%);
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}
body.contact-open .page { padding-bottom: 240px; }
@media (max-width: 1000px) {
  .contact-footer { width: min(calc(100% - 56px), 570px); }
  .contact-form { grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; }
  .contact-message { grid-column: 1 / -1; grid-row: 1; }
  .contact-controls { grid-column: 1; grid-row: 2; padding-left: 0; }
  .contact-send { grid-column: 2; grid-row: 2; }
  .contact-email input { padding-left: 20px; }
  body.contact-open .page { padding-bottom: 350px; }
}
@media (max-width: 560px) {
  .contact-footer {
    position: relative;
    inset: auto;
    width: 100%;
  }
  body.contact-open .page {
    grid-template-rows: auto auto auto;
    align-content: start;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  body.contact-open main {
    margin-block: var(--mobile-gap-before, 0) var(--mobile-gap-after, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .contact-form, .contact-send, .contact-message, .contact-email { transition: none; }
}
