@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff") format("woff");
}

:root {
  --paper: #f7f4ef;
  --paper-deep: #eee8df;
  --ink: #24241f;
  --ink-deep: #1c1c18;
  --frame-ink: #171815;
  --frame-secondary: #383a34;
  --muted: #686054;
  --hover: #806b4d;
  --page-pad-x: clamp(1.25rem, 3.2vw, 3.5rem);
  --page-pad-y: clamp(1.15rem, 2.4vw, 2rem);
  --footer-control-size: 2.75rem;
  --brand-sans: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
  font-family: var(--brand-sans);
  font-synthesis: none;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

html {
  min-width: 20rem;
  height: 100%;
  background: var(--paper);
}

body {
  height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

button,
a { font: inherit; }

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--hover);
  outline-offset: 0.35rem;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

.site-header,
.site-footer {
  position: relative;
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: var(--page-pad-y) max(var(--page-pad-x), env(safe-area-inset-right)) var(--page-pad-y) max(var(--page-pad-x), env(safe-area-inset-left));
  color: var(--frame-ink);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  line-height: 1.25;
}

.site-header { padding-top: max(var(--page-pad-y), env(safe-area-inset-top)); }

.site-footer {
  align-items: center;
  /* Reserve the same row even when Home has no CLOSE/BACK button. */
  min-height: calc(var(--footer-control-size) + var(--page-pad-y) + max(var(--page-pad-y), env(safe-area-inset-bottom)));
  padding-bottom: max(var(--page-pad-y), env(safe-area-inset-bottom));
}

.location-block {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.coordinates {
  color: var(--frame-secondary);
  letter-spacing: 0.025em;
}

.local-time {
  flex-shrink: 0;
  inline-size: 8ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Only page content scrolls; the shared header and footer keep their anchors. */
.site-main {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
.view { width: 100%; min-width: 0; min-height: 100%; }

/* Home — the approved clean direction remains unchanged. */
.home-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 14rem;
  padding: 0 var(--page-pad-x) 1rem;
}

.logo-stage {
  position: relative;
  display: block;
  width: min(31rem, 70vw);
  max-width: 100%;
  min-height: 0;
  height: clamp(15rem, 42vh, 22rem);
  max-height: 22rem;
  isolation: isolate;
}

#logo-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#logo-canvas:active { cursor: grabbing; }

.wordmark {
  flex-shrink: 0;
  margin-top: clamp(-1.1rem, -1.7vh, -0.35rem);
  padding-left: clamp(0.36rem, 0.85vw, 0.66rem);
  color: var(--ink);
  font-size: clamp(0.875rem, 1.15vw, 1.075rem);
  font-weight: 400;
  letter-spacing: clamp(0.36rem, 0.85vw, 0.66rem);
  line-height: 1;
  white-space: nowrap;
}

.text-action {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.75rem 0;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
}

.text-action:hover,
.contact-email:hover { color: var(--hover); }

.site-footer .text-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--footer-control-size);
  padding-block: 0;
  color: var(--frame-ink);
  font-weight: 500;
}

.site-footer .text-action:hover { color: var(--frame-secondary); }

.home-info {
  flex-shrink: 0;
  min-width: 7rem;
  margin-top: clamp(1.55rem, 4vh, 2.7rem);
}

.home-info span { margin-left: 0.8rem; }
.back-action span { margin-left: 0.55rem; }

/* Shared editorial pages */
.content-view {
  width: min(86%, 78rem);
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 2.5rem) 0 clamp(1.4rem, 4vh, 3rem);
}

.editorial-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--brand-sans);
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.17em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Information — navigation grouped beneath the title's right edge. */
.info-view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.info-composition {
  width: min(86%, 78rem);
}

.info-stack {
  --info-title-size: clamp(2rem, 7vw, 7.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

.info-preview {
  position: relative;
  display: grid;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: clamp(4rem, 10vw, 10rem);
}

.info-preview-word {
  grid-area: 1 / 1;
  color: var(--ink);
  font-family: var(--brand-sans);
  font-size: var(--info-title-size);
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-align: right;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.12em);
  transition:
    opacity 300ms ease,
    transform 620ms cubic-bezier(.22,.7,0,1);
  white-space: nowrap;
}

.info-preview-word.is-active {
  opacity: 1;
  transform: translateY(0);
}

.info-menu {
  display: flex;
  align-self: flex-end;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  column-gap: clamp(1.5rem, 2.2vw, 2.5rem);
  margin-top: clamp(0.75rem, 1.6vh, 1.25rem);
  /* Account for title tracking and the optical space after its final E. */
  margin-inline-end: calc(var(--info-title-size) * 0.24);
}

.info-menu-link {
  appearance: none;
  border: 0;
  background: transparent;
  min-height: 2.75rem;
  padding: 0.75rem 0;
  color: var(--frame-ink);
  font-size: clamp(0.75rem, 0.65vw, 0.8125rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: color 320ms ease, opacity 360ms ease, transform 480ms cubic-bezier(.22,.7,0,1);
}

.info-menu-link:hover,
.info-menu-link:focus-visible {
  color: var(--hover);
  transform: translateY(-0.1rem);
}

.info-menu.is-choosing .info-menu-link {
  pointer-events: none;
  opacity: 0.25;
}

.info-menu.is-choosing .info-menu-link.is-selected { opacity: 1; }

/* Projects — the photographs open only on request. */
.projects-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.projects-view .editorial-title {
  margin-bottom: clamp(3.5rem, 8vh, 7rem);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 9vw, 10rem);
  align-items: start;
}

.project-entry {
  min-width: 0;
  transition: color 500ms ease, transform 700ms cubic-bezier(.22,.7,0,1);
}

.project-entry:nth-child(2) {
  padding-top: clamp(2.25rem, 6vh, 5.5rem);
}

.project-entry h2 {
  max-width: 100%;
  margin: 0 0 1.5rem;
  color: var(--ink);
  font-family: var(--brand-sans);
  font-size: clamp(1.4rem, 2.4vw, 2.75rem);
  font-weight: 300;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
  transition: color 500ms ease, transform 700ms cubic-bezier(.22,.7,0,1);
}

.project-entry h2 span { display: block; }

.project-open {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: left;
  text-transform: inherit;
}

.project-address {
  margin: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.065em;
  line-height: 1.55;
  text-transform: uppercase;
  transition: color 500ms ease, transform 700ms cubic-bezier(.22,.7,0,1);
}

.project-entry:hover h2,
.project-entry:focus-within h2 {
  color: var(--hover);
  transform: translateY(-0.18rem);
}

.project-entry:hover .project-address {
  color: var(--ink);
  transform: translateY(0.12rem);
}

/* Contact sits directly above the bottom-left footer, on every screen. */
.view.contact-view {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  padding: 2rem max(var(--page-pad-x), env(safe-area-inset-right)) 0 max(var(--page-pad-x), env(safe-area-inset-left));
}

.contact-composition {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
}

.contact-composition .editorial-title {
  margin-bottom: 0.55rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.4;
}

.contact-email {
  display: inline-block;
  max-width: 100%;
  color: var(--ink);
  font-family: var(--brand-sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: color 500ms ease, transform 700ms cubic-bezier(.22,.7,0,1);
}

.contact-email:hover,
.contact-email:focus-visible {
  color: var(--hover);
  transform: translateY(-0.18rem);
}

.copy-email {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.75rem;
  margin-top: 0.4rem;
  border: 0;
  background: transparent;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
  transition: color 400ms ease, transform 500ms cubic-bezier(.22,.7,0,1);
}

.copy-email:hover,
.copy-email.is-copied {
  color: var(--ink);
  transform: translateY(-0.12rem);
}

/* Footer-origin route reveal. */
.route-transition {
  position: fixed;
  z-index: 100;
  inset: 0;
  visibility: hidden;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--paper);
  pointer-events: none;
  -webkit-clip-path: inset(100% 0 0 0);
  clip-path: inset(100% 0 0 0);
  transition:
    -webkit-clip-path 620ms cubic-bezier(.76,0,.24,1),
    clip-path 620ms cubic-bezier(.76,0,.24,1);
}

.route-transition.is-active {
  visibility: visible;
  pointer-events: auto;
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
}

.route-transition.is-active.is-revealing {
  -webkit-clip-path: inset(0 0 100% 0);
  clip-path: inset(0 0 100% 0);
}

.route-transition-label {
  position: absolute;
  left: max(var(--page-pad-x), env(safe-area-inset-left));
  bottom: max(var(--page-pad-y), env(safe-area-inset-bottom));
  font-family: var(--brand-sans);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.09em;
  line-height: 1;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(0.35rem);
  transition: opacity 260ms ease 180ms, transform 420ms cubic-bezier(.22,.7,0,1) 150ms;
}

.route-transition.is-active .route-transition-label {
  opacity: 1;
  transform: translateY(0);
}

.route-transition.is-revealing .route-transition-label {
  opacity: 0;
  transform: translateY(-0.35rem);
  transition-delay: 0ms;
}

/* Page entrance motion */
.view.is-entering { animation: view-in 520ms cubic-bezier(.22,.7,0,1) both; }

.view.is-entering .editorial-title,
.view.is-entering .info-preview-word.is-active,
.view.is-entering .project-entry,
.view.is-entering .contact-email,
.view.is-entering .copy-email {
  animation: reveal-up 720ms cubic-bezier(.22,.7,0,1) both;
}

.view.is-entering .project-entry:nth-child(2),
.view.is-entering .contact-email { animation-delay: 90ms; }

.view.is-entering .copy-email { animation-delay: 150ms; }

@keyframes view-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(1.2rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Phones */
@media (max-width: 35rem) {
  :root {
    --page-pad-x: 1.25rem;
    --page-pad-y: 1.15rem;
  }

  .site-header,
  .site-footer { font-size: 0.6875rem; }

  .content-view {
    width: auto;
    margin-inline: var(--page-pad-x);
    padding-block: 1rem 1.5rem;
  }

  .info-view {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .info-composition {
    display: flex;
    justify-content: center;
    width: calc(100% - (var(--page-pad-x) * 2));
  }

  .info-preview {
    min-height: 3.5rem;
  }

  .info-stack {
    --info-title-size: clamp(1.65rem, 7.2vw, 3rem);
  }

  .info-preview-word { text-align: center; }

  .logo-stage {
    width: min(26rem, 95vw);
    height: clamp(14rem, 38vh, 19rem);
  }

  .wordmark {
    padding-left: 0.34rem;
    font-size: 0.8rem;
    letter-spacing: 0.34rem;
  }

  .home-info { margin-top: 1.7rem; }

  .info-menu {
    align-self: center;
    justify-content: center;
    width: auto;
    column-gap: 1.75rem;
    margin-top: 0.75rem;
    margin-inline-end: 0;
  }

  .info-menu-link {
    min-height: 2.75rem;
    padding-block: 0.65rem;
    font-size: 0.6875rem;
  }

  .editorial-title {
    font-size: clamp(1.8rem, 7.5vw, 2.6rem);
  }

  .projects-view .editorial-title {
    margin-bottom: clamp(2.8rem, 7vh, 4.5rem);
  }

  .project-list {
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 7vh, 4rem);
  }

  .project-entry:nth-child(2) { padding-top: 0; }

  .project-entry h2 {
    max-width: 100%;
    margin-bottom: 1rem;
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
  }

  .project-address { font-size: 0.625rem; }

  .route-transition-label { font-size: 0.6875rem; }
}

/* Tablets and compact notebooks */
@media (min-width: 35.01rem) and (max-width: 64rem) {
  .content-view { width: min(86%, 54rem); }
  .info-view { width: 100%; }
  .info-composition { width: min(86%, 54rem); }
  .logo-stage { width: min(30rem, 66vw); }
  .project-list { gap: clamp(3rem, 7vw, 5rem); }
  .project-entry h2 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); }
}

/* Short laptop screens and landscape phones */
@media (max-height: 45rem) {
  :root { --page-pad-y: 0.9rem; }

  .logo-stage {
    width: min(24rem, 58vw);
    height: min(15rem, 42vh);
  }

  .wordmark { margin-top: -0.55rem; }
  .home-info { margin-top: 1.15rem; }
  .content-view { padding-block: 0.5rem 0.8rem; }
  .info-view { padding: 0; }
  .info-preview { min-height: 3.5rem; }
  .editorial-title { font-size: clamp(1.8rem, 4.5vw, 3.5rem); }
  .projects-view .editorial-title { margin-bottom: 2rem; }
  .project-entry:nth-child(2) { padding-top: 1rem; }
  .project-entry h2 { margin-bottom: 0.7rem; }
}

/* 24-inch desktop and larger */
@media (min-width: 90rem) and (min-height: 48rem) {
  .logo-stage {
    width: 32rem;
    height: 23rem;
  }

  .content-view { width: min(82%, 84rem); }
  .info-view { width: 100%; }
  .info-composition { width: min(82%, 84rem); }
}

/* Ultrawide displays keep a deliberate central composition. */
@media (min-width: 120rem) {
  :root { --page-pad-x: 4.5rem; }
  .logo-stage { width: 34rem; height: 24rem; }
  .content-view { width: 84rem; }
  .info-view { width: 100%; }
  .info-composition { width: 84rem; }
}

/* A photograph floats above the current page and keeps its proportions. */
body.photo-is-open { overflow: hidden; }
body.photo-is-open .site-main { overflow: hidden; }

.project-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  background: transparent;
  color: var(--paper);
  overflow: auto;
  overscroll-behavior: contain;
}

.project-modal[open] { display: grid; place-items: center; }

.project-modal::backdrop {
  background: rgb(25 24 21 / 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background 240ms ease, backdrop-filter 240ms ease;
}

.project-modal.is-visible::backdrop {
  background: rgb(25 24 21 / 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.project-modal-frame {
  width: min(100%, 72rem);
  margin: auto;
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 240ms ease, transform 360ms cubic-bezier(.22,.7,0,1);
}

.project-modal.is-visible .project-modal-frame { opacity: 1; transform: none; }

.project-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 0.75rem;
}

.project-modal-header h2 {
  margin: 0;
  font-size: clamp(0.625rem, 1vw, 0.8rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-transform: uppercase;
}

.project-modal-close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
}

.project-modal-close:focus-visible { outline-color: var(--paper); outline-offset: 0.2rem; }

.project-photo-area { display: grid; place-items: center; min-height: 8rem; }

#project-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  object-fit: contain;
  opacity: 1;
  transition: opacity 240ms ease;
}

.project-photo-area[aria-busy="true"] #project-photo { opacity: 0; }

#project-photo-error { margin: 1rem 0; font-size: 0.875rem; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .route-transition { display: none; }
}
