/* Wes Masco Design — wesmasco.com */

:root {
  --shell: #f2eee7;
  --ink: #1a1a1a;
  --muted: #645b4f;
  --rule: rgba(26, 26, 26, 0.22);
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --gutter: clamp(20px, 5vw, 72px);
  --top: clamp(20px, 2.4vw, 32px);
}

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

html {
  background: var(--shell);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.125rem/1.55 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html:has(dialog[open]) {
  overflow: hidden;
}

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

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

h1,
h2,
h3,
p,
ul {
  margin: 0;
  font: inherit;
}

ul {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: var(--top);
  z-index: 20;
  font: 500 0.6875rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.skip:not(:focus) {
  clip-path: inset(50%);
}

/* Small uppercase label: menu, project names, section labels */
.label,
.wordmark,
.menu-toggle,
.work-title,
.project-title {
  font: 500 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- top corners ---------- */

.wordmark {
  position: absolute;
  top: var(--top);
  left: var(--gutter);
}

.menu-toggle {
  position: fixed;
  top: var(--top);
  right: var(--gutter);
  z-index: 10;
  margin: -12px;
  padding: 12px;
  border: 0;
  background: none;
  color: #fff;
  mix-blend-mode: difference; /* stays legible over photography */
  cursor: pointer;
}

/* ---------- menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--shell);
  color: var(--ink);
  opacity: 0;
  transition:
    opacity 0.3s ease,
    overlay 0.3s ease allow-discrete,
    display 0.3s ease allow-discrete;
}

.menu[open] {
  display: grid;
  place-items: center;
  opacity: 1;
}

@starting-style {
  .menu[open] {
    opacity: 0;
  }
}

.menu::backdrop {
  background: transparent;
}

.menu .menu-close {
  color: var(--ink);
  mix-blend-mode: normal;
}

.menu ul {
  display: grid;
  gap: 0.6em;
  text-align: center;
  font: 400 clamp(1.625rem, 2.6vw, 2.125rem)/1.2 var(--serif);
}

.menu a:hover {
  color: var(--muted);
}

/* ---------- identity ---------- */

.identity {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--gutter);
}

.identity img {
  width: clamp(180px, 21vw, 300px);
}

/* ---------- work ---------- */

.work {
  padding: clamp(32px, 8vh, 96px) var(--gutter) clamp(120px, 24vh, 260px);
}

#projects {
  scroll-margin-top: var(--gutter);
}

.work-list {
  display: grid;
  gap: clamp(96px, 20vh, 220px);
}

.work-item a {
  display: block;
  width: min(100%, calc(var(--ar) * 86svh));
}

.work-item picture {
  display: block;
}

.work-item img {
  width: 100%;
  transition: opacity 0.6s ease;
}

.work-item a:hover img.loaded {
  opacity: 0.88;
}

.work-title {
  margin-top: 1.5rem;
}

.work-location {
  margin-top: 0.15rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .work-item a {
    width: min(78%, calc(var(--ar) * 86svh));
  }

  .work-item:nth-child(even) a {
    margin-left: auto;
  }
}

/* ---------- project page ---------- */

.project {
  padding: clamp(120px, 22vh, 220px) var(--gutter) clamp(96px, 16vh, 180px);
}

.project-head {
  margin-bottom: clamp(56px, 10vh, 112px);
}

.project-meta {
  margin-top: 0.15rem;
  color: var(--muted);
}

.project-text {
  max-width: 34rem;
  margin: calc(-1 * clamp(24px, 5vh, 56px)) 0 clamp(56px, 10vh, 112px);
}

.project-text p + p {
  margin-top: 1em;
}

.gallery {
  display: grid;
  justify-items: center;
  gap: clamp(48px, 10vh, 120px);
}

.gallery-item {
  width: min(100%, 1800px, calc(var(--ar) * 90svh));
}

.gallery-item img {
  width: 100%;
}

.project-next {
  margin-top: clamp(96px, 18vh, 200px);
}

.project-next a {
  font-size: 1.25rem;
}

.project-next span {
  display: block;
  font: 500 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-next a:hover {
  color: var(--muted);
}

/* ---------- about, contact ---------- */

.page {
  max-width: 34rem;
  padding: clamp(120px, 24vh, 240px) var(--gutter) clamp(96px, 16vh, 180px);
}

@media (min-width: 900px) {
  .page {
    margin-left: 33.333%;
    padding-left: 0;
  }
}

.page-title {
  font-size: 1.5rem;
  line-height: 1.3;
}

.credential {
  color: var(--muted);
}

.statement {
  margin-top: 2.5rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.about .label {
  margin-top: 4.5rem;
  color: var(--muted);
}

.services {
  margin-top: 1rem;
  font: 400 0.875rem/2 var(--sans);
}

.direct {
  margin-top: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.6;
}

.direct a:hover,
.statement a:hover {
  color: var(--muted);
}

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

.form {
  display: grid;
  gap: 1.75rem;
  margin-top: 4rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
  font: 500 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  letter-spacing: normal;
  text-transform: none;
  resize: vertical;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.form button {
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0 0 0.3rem;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: none;
  color: var(--ink);
  font: 500 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.form button:disabled {
  color: var(--muted);
  border-color: var(--rule);
  cursor: default;
}

.form-status {
  min-height: 1.5em;
  font: 400 0.875rem/1.5 var(--sans);
  color: var(--muted);
}

.form-status a {
  border-bottom: 1px solid var(--rule);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  padding: 2.5rem var(--gutter);
  font: 400 0.6875rem/1.5 var(--sans);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.footer p:last-child {
  margin-left: auto;
}

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

@media (max-width: 599px) {
  .footer p:last-child {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ---------- image loading ---------- */

.js img.fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.js img.fade.loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
