html {
  --paper: #f4f1e9;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  width: min(calc(100% - (var(--gutter) * 2)), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 1rem;
  left: 1rem;
  padding: 0.55rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.hero {
  min-height: min(900px, 94vh);
  display: grid;
  align-items: center;
  padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(4rem, 8vw, 7rem);
}

.hero__shell {
  display: grid;
  grid-template-columns: minmax(23rem, 0.92fr) minmax(28rem, 1.08fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(2.5rem, 6vw, 7rem);
  align-items: center;
}

.nav {
  grid-column: 1 / -1;
  justify-self: end;
  display: flex;
  gap: clamp(1.2rem, 2.3vw, 2.4rem);
  margin-bottom: clamp(3rem, 6vh, 5.5rem);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.nav a,
.contact__links a,
.footer__inner a {
  position: relative;
  width: fit-content;
}

.nav a::after,
.contact__links a::after,
.footer__inner a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.25rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.nav a:hover::after,
.contact__links a:hover::after,
.footer__inner a:hover::after,
.nav a:focus-visible::after,
.contact__links a:focus-visible::after,
.footer__inner a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero__copy {
  align-self: center;
  width: fit-content;
  padding-bottom: 2vh;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  white-space: nowrap;
  font-size: clamp(2.9rem, 4.25vw, 4rem);
  line-height: 1;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.hero__subtitle {
  margin-top: 1.4rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(0.9rem, 1vw, 1.08rem);
  letter-spacing: 0.28em;
  text-transform: lowercase;
  text-align: center;
  /* letter-spacing adds a trailing space after the last character, which pulls
     centred text left by half that amount. Nudge it back. */
  text-indent: 0.14em;
}

/* The artwork's paper is pure white, so multiplying it against --paper returns
   --paper exactly and the image has no visible edge.
   isolation + background are load-bearing: mix-blend-mode blends against the
   nearest isolated group, and the reveal animation leaves a transform here,
   which silently creates one. Isolating deliberately and painting --paper
   underneath means the blend cannot be broken by an ancestor's transform,
   filter, or opacity. */
.hero__art {
  justify-self: stretch;
  align-self: center;
  margin: 0;
  background: var(--paper);
  isolation: isolate;
}

.hero__art img {
  display: block;
  width: min(100%, 590px);
  height: auto;
  max-height: min(72vh, 700px);
  margin-inline: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.section {
  padding-block: var(--section-space);
  scroll-margin-top: 2rem;
}

.section + .section { border-top: 1px solid var(--hairline); }

.section__grid {
  display: grid;
  grid-template-columns: minmax(9rem, 0.34fr) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 9rem);
  align-items: start;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.1;
}

/* Same compositing contract as the hero: white paper multiplied against
   --paper disappears, and isolating here keeps the blend independent of the
   reveal animation's transform. Kept deliberately smaller than the hero so it
   reads as a mark beside the text, not a second artwork. */
.about__portrait {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  max-width: 14rem;
  background: var(--paper);
  isolation: isolate;
}

.about__portrait img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.statement {
  max-width: 45rem;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.45vw, 2.35rem);
  line-height: 1.32;
  letter-spacing: -0.018em;
  /* Keeps a single word from being stranded on the last line. Ignored by
     browsers that do not support it, which just get the default wrap. */
  text-wrap: pretty;
}

/* About runs on its own grid so both paragraphs share the text column's left
   edge and the long one sits right of centre, under the lead. */
.about__grid {
  display: grid;
  grid-template-columns: minmax(9rem, 0.34fr) minmax(0, 1fr);
  column-gap: clamp(3rem, 8vw, 9rem);
  row-gap: clamp(3.5rem, 7vw, 6rem);
  align-items: start;
}

.about__aside {
  grid-column: 1;
  grid-row: 1;
}

/* The aside is taller than four lines of text, so the lead centres against it
   rather than leaving a void beneath. balance evens the rag of a block short
   enough for the browser to reflow it. */
.about__grid > .statement:not(.statement--wide) {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  /* Sits a little below the drawing's midline rather than dead centre. */
  transform: translateY(clamp(1rem, 2.5vw, 2.25rem));
  text-wrap: balance;
}

/* A feathered oval around the drawing. It lives outside .about__portrait so it
   is not inside that element's isolated blend group, where the multiply would
   darken it. */
.about__frame {
  position: relative;
  width: fit-content;
}

.about__frame::before {
  content: "";
  position: absolute;
  inset: -11% -19%;
  border: 1px solid var(--frame);
  border-radius: 50%;
  pointer-events: none;
  /* A radial-gradient ring reads uneven here: on an ellipse the ray length
     changes with angle, so a fixed-percentage band is thicker at the poles
     than the flanks. A real border keeps one weight all the way round; a
     single-layer mask fades it top and bottom, leaving two arcs. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
}

/* The second paragraph steps out of the label/portrait grid and centres on the
   shell, so it reads as its own passage rather than a continuation. */
.statement--wide {
  --frame-pad: clamp(1.75rem, 3.5vw, 2.75rem);
  position: relative;
  grid-column: 2;
  grid-row: 2;
  /* Pulled left by its own padding so the text inside lines up with the
     paragraph above rather than sitting indented from it. */
  margin: 0 0 0 calc(-1 * var(--frame-pad));
  padding: clamp(2rem, 4vw, 3.25rem) var(--frame-pad);
}

/* Three typographic levels inside the passage, so it reads as a structure
   rather than a wall of display serif. Sizes are in em so they track the
   statement's own clamp. */
.statement--wide > p + p { margin-top: 0.85em; }

.about__quote {
  margin: 2.35em 0 0;
  font-size: 0.62em;
  line-height: 1.45;
}

.about__quote blockquote {
  margin: 0;
  font-style: italic;
}

.about__quote figcaption {
  margin-top: 0.65em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.62em;
  font-style: normal;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* A feathered frame: each edge is a hairline that fades out before it reaches
   the corners, so the block is framed without cutting a hard rectangle into the
   page. Built from four gradients rather than a masked border, because
   mask-composite and -webkit-mask-composite take different keywords and
   disagree about which one wins. */
.statement--wide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent, var(--frame) 28%, var(--frame) 72%, transparent) top left / 100% 1px no-repeat,
    linear-gradient(to right, transparent, var(--frame) 28%, var(--frame) 72%, transparent) bottom left / 100% 1px no-repeat,
    linear-gradient(to bottom, transparent, var(--frame) 28%, var(--frame) 72%, transparent) top left / 1px 100% no-repeat,
    linear-gradient(to bottom, transparent, var(--frame) 28%, var(--frame) 72%, transparent) top right / 1px 100% no-repeat;
}

.work h2 { margin-bottom: clamp(4rem, 8vw, 7rem); }

.project {
  padding-top: clamp(2rem, 3vw, 3rem);
  border-top: 1px solid var(--ink);
  /* Nav "Work" targets this block, not the section, so the whole RISE entry
     lands in view. The offset scales with viewport height, not width: the block
     is ~634px tall, and a short laptop clips it if the gap is sized off vw. */
  scroll-margin-top: clamp(2.5rem, 7vh, 5.5rem);
}

.project h3 {
  font-size: clamp(3rem, 5.6vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.project__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  grid-template-rows: auto auto;
  gap: clamp(1.25rem, 2.5vw, 2rem) clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(2.25rem, 4.5vw, 3.75rem);
}

/* Title sits centred over the thumbnail; the copy starts level with the
   image top, so row 1 of the second column is intentionally empty. */
.project__title {
  grid-column: 1;
  grid-row: 1;
  text-align: center;
}

.project__media {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  background: var(--paper);
  isolation: isolate;
}

.project__media img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.project__copy {
  grid-column: 2;
  grid-row: 2;
}

.project__copy > p {
  max-width: 34rem;
  margin-top: 0;
  font-size: clamp(1.1rem, 1.45vw, 1.32rem);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.72rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
  border-color: var(--btn-edge);
  color: var(--ink);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* The live demo is the highest-value link on the page, so it takes the ink.
   Ink is the body-copy colour, so a filled button sits inside the palette
   rather than beside it; the hairline keeps the secondary quiet. */
.btn--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn--solid:hover,
.btn--solid:focus-visible {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.contact__links {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__email {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.contact { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }

.footer {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(2.75rem, 5vw, 4rem) clamp(1.75rem, 3vw, 2.25rem);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hidden only when scripting is present to reveal it. Without JS the class is
   never set and everything stays visible. */
.js-reveal [data-reveal] { opacity: 0; }

[data-reveal].is-visible {
  animation: reveal-in 600ms ease both;
}

[data-reveal][data-reveal-delay="1"].is-visible {
  animation-delay: 100ms;
}

@media (max-width: 980px) {
  .hero__shell {
    grid-template-columns: minmax(20rem, 0.88fr) minmax(24rem, 1.12fr);
    column-gap: 2rem;
  }

  h1 { font-size: clamp(2.55rem, 4.4vw, 3.25rem); }
}

@media (max-width: 760px) {
  .hero {
    min-height: auto;
    padding-top: 1.4rem;
  }

  .hero__shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .nav {
    grid-column: 1;
    justify-self: start;
    grid-row: 1;
    margin-bottom: clamp(4.5rem, 14vw, 7rem);
  }

  .hero__copy {
    grid-row: 2;
    padding-bottom: 0;
  }

  h1 {
    white-space: normal;
    font-size: clamp(2.15rem, 11vw, 3.1rem);
    letter-spacing: 0.06em;
  }

  .hero__subtitle {
    margin-top: 1rem;
    font-size: 0.86rem;
    letter-spacing: 0.22em;
    /* The title wraps and left-aligns here, so centring the subtitle on the
       container would float it away from the name above it. */
    text-align: left;
    text-indent: 0;
  }

  .hero__art {
    grid-row: 3;
    margin-top: clamp(3.5rem, 10vw, 6rem);
  }

  .hero__art img {
    width: min(100%, 33rem);
    max-height: none;
  }

  .section__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about__grid {
    grid-template-columns: 1fr;
    row-gap: 2.5rem;
  }

  .about__aside { grid-row: auto; }

  /* These mirror the desktop selectors exactly. A shorter selector loses to the
     base rule's :not(), which silently left the lead in column 2 and forced an
     implicit second track. */
  .about__grid > .statement:not(.statement--wide) {
    grid-column: 1;
    grid-row: auto;
    align-self: start;
    transform: none;
  }

  .about__grid > .statement--wide {
    grid-column: 1;
    grid-row: auto;
    /* The desktop pull-left would hang the frame outside the gutter here. */
    margin-left: 0;
    --frame-pad: 1.35rem;
  }

  /* The desktop inset is wider than the gutter at this size, which clipped the
     oval against the viewport edge. */
  .about__frame::before { inset: -10% -9%; }

  .about__portrait { max-width: 10.5rem; }
  .project__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project__title,
  .project__media,
  .project__copy {
    grid-column: 1;
    grid-row: auto;
  }

  .project__title { text-align: left; }

  .project__media {
    max-width: 20rem;
  }
  .project h3 { font-size: clamp(2.75rem, 15vw, 4.5rem); }

  .project__links { gap: 0.7rem; }
  .btn { flex: 1 1 100%; justify-content: center; }
}


@media (max-width: 380px) {
  .nav { gap: 1rem; }
  h1 { font-size: 2.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  /* Animations are off here, so the hidden start state would never be undone. */
  .js-reveal [data-reveal] { opacity: 1; }
}
