/* ==========================================================================
   Ashcombe
   Tokens are CSS custom properties, swapped once at :root for dark mode.
   Corner radius is 0 throughout, which suits the subject and keeps every
   surface on one shape system.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  --bg: #f1f1ef;
  --sunk: #e6e7e3;
  --ink: #17191a;
  --soft: #545a58;
  --line: rgba(23, 25, 26, 0.16);
  --line-soft: rgba(23, 25, 26, 0.08);
  --accent: #1f4a3a;
  --accent-ink: #f1f1ef;

  --shell: 1400px;
  --gutter: 1.25rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #101312;
    --sunk: #171b1a;
    --ink: #e9ebe9;
    --soft: #9ba4a1;
    --line: rgba(233, 235, 233, 0.18);
    --line-soft: rgba(233, 235, 233, 0.09);
    --accent: #7fb79c;
    --accent-ink: #0e1211;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #101312;
  --sunk: #171b1a;
  --ink: #e9ebe9;
  --soft: #9ba4a1;
  --line: rgba(233, 235, 233, 0.18);
  --line-soft: rgba(233, 235, 233, 0.09);
  --accent: #7fb79c;
  --accent-ink: #0e1211;
}

/* --------------------------------------------------------------- base ---- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.display {
  letter-spacing: -0.028em;
  line-height: 1.06;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: 7rem;
}

.section__title {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}

.skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------------- buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.85rem 1.6rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.button:hover {
  opacity: 0.9;
}

.button:active {
  transform: translateY(1px);
}

.button[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* -------------------------------------------------------------- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.wordmark {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin: 0;
}

.site-nav__end {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.site-nav__links a {
  color: var(--soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav__links a:hover {
  color: var(--ink);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.theme-toggle:hover {
  background: var(--sunk);
}

.theme-toggle:active {
  transform: translateY(1px);
}

/* ---------------------------------------------------------------- hero ---- */

.hero {
  display: grid;
  min-height: calc(100dvh - 4rem);
  grid-template-columns: 1fr;
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem var(--gutter);
}

.hero__title {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  max-width: 12ch;
}

.hero__lede {
  max-width: 46ch;
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  color: var(--soft);
}

.hero .button {
  margin-top: 2.5rem;
  align-self: flex-start;
}

.hero__media {
  position: relative;
  min-height: 58vh;
  background: var(--sunk);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------ projects ---- */

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4.5rem;
  margin-top: 3.5rem;
}

.card__media {
  overflow: hidden;
  background: var(--sunk);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.card--wide {
  aspect-ratio: 4 / 3;
}

.card--tall {
  aspect-ratio: 3 / 4;
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card__name {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.card__button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.card__button::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card {
  position: relative;
}

.card__year {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--soft);
}

.card__year--live {
  color: var(--accent);
}

.card__meta {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--soft);
}

.card__summary {
  max-width: 46ch;
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

/* ------------------------------------------------------------ featured ---- */

.featured {
  background: var(--sunk);
  padding-block: 6rem;
}

.featured__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured__body {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.featured__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.featured__text {
  max-width: 52ch;
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  color: var(--soft);
}

.featured__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  font-size: 0.875rem;
  align-self: end;
}

.featured__facts dt {
  color: var(--soft);
}

.featured__facts dd {
  margin: 0.25rem 0 0;
}

/* ------------------------------------------------------------- figures ---- */

.figures__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 1.5rem;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 3rem;
}

.figures__value {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-variant-numeric: tabular-nums;
}

.figures__grid dt {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--soft);
}

/* ------------------------------------------------------------ practice ---- */

.practice {
  display: grid;
  gap: 3.5rem;
}

.practice__text p {
  max-width: 58ch;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--soft);
}

.practice__text .section__title + p {
  margin-top: 2rem;
}

.practice__media {
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: var(--sunk);
}

.practice__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------- quote ---- */

.quote {
  max-width: 56rem;
  margin: 0;
}

.quote__text {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.25;
}

.quote__by {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--soft);
}

.quote__by span {
  display: block;
  color: var(--ink);
}

/* ------------------------------------------------------------- contact ---- */

.contact {
  border-top: 1px solid var(--line-soft);
}

.contact__grid {
  display: grid;
  gap: 3.5rem;
  padding-block: 7rem;
}

.contact__lede {
  max-width: 46ch;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--soft);
}

.contact__details {
  margin-top: 2.5rem;
  font-size: 0.9375rem;
}

.contact__details a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}

.contact__details a:hover {
  text-decoration-color: var(--accent);
}

.contact__details p + p {
  color: var(--soft);
}

.contact__address {
  margin-top: 1.5rem;
}

/* ---------------------------------------------------------------- form ---- */

.form {
  display: grid;
  gap: 1.75rem;
}

/* Grid items stretch by default; the submit button should size to its label. */
.form .button {
  justify-self: start;
}

.field label {
  display: block;
  font-size: 0.875rem;
}

.field__hint {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--soft);
}

.field input,
.field textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease;
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--soft);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline-offset: 1px;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--ink);
}

.field__error,
.form__status {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink);
}

.form__status {
  margin: 0;
}

.form__done {
  border: 1px solid var(--line);
  padding: 2rem 1.75rem;
}

.form__done-title {
  font-size: 1.0625rem;
}

.form__done p + p {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.form__submitting {
  color: var(--soft);
}

/* -------------------------------------------------------------- footer ---- */

.site-footer {
  border-top: 1px solid var(--line-soft);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block: 3rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  font-size: 0.875rem;
  color: var(--soft);
}

.site-footer__links a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--ink);
}

/* -------------------------------------------------------------- dialog ---- */

.dialog {
  width: min(46rem, calc(100vw - 2rem));
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  overflow: auto;

  /* Scrolls, but without a visible scrollbar. The sticky Close bar and the
     cut off content are what signal there is more to see. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dialog::-webkit-scrollbar {
  display: none;
}

.dialog::backdrop {
  background: rgba(10, 12, 11, 0.6);
  backdrop-filter: blur(2px);
}

/* Sticky bar rather than a floated button: the close control stays reachable
   while the dialog scrolls, without sitting on top of the photograph. */
.dialog__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem;
  background: var(--bg);
}

.dialog__close {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.dialog__close:hover {
  background: var(--sunk);
}

.dialog__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sunk);
}

.dialog__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog__content {
  padding: 2rem 1.75rem 2.5rem;
}

.dialog__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.dialog__meta {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.dialog__content p.dialog__para {
  max-width: 62ch;
  margin-top: 1.5rem;
  color: var(--soft);
}

.dialog__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
  font-size: 0.875rem;
}

.dialog__facts dt {
  color: var(--soft);
}

.dialog__facts dd {
  margin: 0.35rem 0 0;
  font-size: 1.0625rem;
}

/* ------------------------------------------------------------- reveals ---- */

/* Only hidden when JS is running, so the page is complete without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------- responsive ---- */

@media (min-width: 768px) {
  :root {
    --gutter: 2.5rem;
  }

  .section {
    padding-block: 9rem;
  }

  .projects {
    gap: 5rem;
  }

  .featured {
    padding-block: 8rem;
  }

  .featured__media {
    aspect-ratio: 21 / 9;
  }

  .featured__body {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: 3.5rem;
  }

  .featured__body > div:first-child {
    grid-column: 1 / span 7;
  }

  .featured__facts {
    grid-column: 9 / span 4;
  }

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

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .site-nav__links {
    gap: 1.75rem;
    font-size: 0.875rem;
  }

  .dialog__content {
    padding: 2.5rem 2.5rem 3rem;
  }

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

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: 5fr 7fr;
  }

  .hero__text {
    padding: 5rem 3.5rem 5rem
      max(2.5rem, calc((100vw - var(--shell)) / 2 + 4rem));
  }

  .hero__media {
    min-height: 100%;
  }

  /* Staggered index: spans and drop heights vary so the eye moves down the
     page at an angle rather than scanning tidy rows. */
  .projects {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
    row-gap: 5rem;
    align-items: start;
  }

  /* Rows are explicit: auto-placement will not backfill a column it has
     already passed, which would drop every card into a row of its own. */
  .card--a { grid-row: 1; grid-column: 1 / span 7; }
  .card--b { grid-row: 1; grid-column: 9 / span 4; margin-top: 6rem; }
  .card--c { grid-row: 2; grid-column: 6 / span 7; }
  .card--d { grid-row: 2; grid-column: 1 / span 4; margin-top: 6rem; }
  .card--e { grid-row: 3; grid-column: 1 / span 7; }
  .card--f { grid-row: 3; grid-column: 9 / span 4; margin-top: 5rem; }

  .practice {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4rem;
  }

  .practice__text {
    grid-column: 1 / span 5;
  }

  .practice__media {
    grid-column: 7 / span 6;
    margin-top: 4rem;
  }

  .contact__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4rem;
    padding-block: 9rem;
  }

  .contact__grid > div:first-child {
    grid-column: 1 / span 5;
  }

  .contact__grid > div:last-child {
    grid-column: 7 / span 6;
  }
}

@media (min-width: 1280px) {
  :root {
    --gutter: 4rem;
  }
}

/* ------------------------------------------------------ reduced motion ---- */

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
