/* RYLEIGH. portfolio — plain CSS, no build step */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --lime: #B8CE3E;
  --plum: #5C1646;
  --grey: #5a5a5a;
  --line: #000000;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 2.4vw, 32px);
  --header-h: 64px;
  /* Feature A sizes */
  --wm-big: clamp(64px, 14.5vw, 250px);
  --wm-small: clamp(28px, 4.85vw, 84px);
  --wm: var(--wm-big);
  --ease: cubic-bezier(.2, .8, .1, 1);
}
body.wm-small { --wm: var(--wm-small); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  /* bottom padding so the last content scrolls clear of the fixed wordmark */
  padding-bottom: calc(var(--wm) * 0.9 + 56px);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }

.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;
}
.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 50;
  background: var(--lime); padding: 8px 12px; font-size: 14px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- Header: nav (top left) + Feature B tagline (top right) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: 18px var(--gutter) 14px;
  background: var(--paper);
}
.home .site-header { background: transparent; pointer-events: none; }
.home .site-header > * { pointer-events: auto; }
.nav { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
.nav a { text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--lime); }
.nav .dot, .wordmark .dot { color: var(--plum); }
.tagline {
  margin: 0; max-width: 36ch; text-align: right;
  font-size: 13px; line-height: 1.45; letter-spacing: .01em;
}
main { position: relative; z-index: 1; padding-top: calc(var(--header-h) + 24px); }

/* ---------- Feature A: wordmark fixed bottom right ---------- */
.wordmark {
  position: fixed; right: var(--gutter); bottom: calc(var(--gutter) * .55); z-index: 0;
  margin: 0; font-size: var(--wm); font-weight: 800; line-height: .78;
  letter-spacing: -.06em; white-space: nowrap; pointer-events: none; user-select: none;
}
/* content blocks are opaque so the wordmark never sits on top of text or images */
.solid { background: var(--paper); position: relative; }

/* ---------- Labels / small type ---------- */
.label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--grey); }
.ph {
  background: var(--lime); color: var(--ink); padding: 1px 4px;
  font-weight: 700; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* ---------- Reveal (bold, staggered) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(48px) skewY(3deg);
  clip-path: inset(0 0 100% 0);
  transition: opacity .7s var(--ease), transform .9s var(--ease), clip-path .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].in { opacity: 1; transform: none; clip-path: inset(-30% -30% -30% -30%); }
.js .wordmark[data-reveal] { transform: translateY(40%); clip-path: inset(0 0 100% 0); }
.js .wordmark[data-reveal].in { transform: none; clip-path: inset(-10% -10% -10% -10%); }

/* ---------- Home: one full image between the header and the wordmark band ---------- */
.home { padding-bottom: 0; overflow: hidden; height: 100vh; height: 100svh; cursor: pointer;
  --home-band: calc(var(--wm) * .78 + var(--gutter) * .55 + 20px); }
.home .site-header { background: var(--paper); }
.home main { padding: 0; position: fixed; left: 0; right: 0; top: var(--header-h); bottom: var(--home-band); z-index: 1; }
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--paper); }
.stage a.stage-link { position: absolute; inset: 0; z-index: 4; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; pointer-events: none; }
.hero-img.on { opacity: 1; }
.hero-label {
  position: absolute; left: var(--gutter); top: 12px; z-index: 3; margin: 0; pointer-events: none;
  font-size: 13px; line-height: 1.3; background: var(--lime); color: var(--ink); padding: 5px 9px;
}
.hero-label span { font-weight: 400; margin-left: 6px; }
.home .wordmark { z-index: 2; }
.hint {
  position: fixed; left: var(--gutter); bottom: calc(var(--gutter) * .8); z-index: 5;
  margin: 0; font-size: 13px; max-width: 24ch; line-height: 1.5; pointer-events: none;
}
.hint b { background: var(--lime); padding: 0 4px; font-weight: 700; }

/* ---------- Page heads ---------- */
.page { padding-left: var(--gutter); padding-right: var(--gutter); }
.page-head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; align-items: end;
  border-bottom: 2px solid var(--line); padding-bottom: 16px; margin-bottom: 24px;
}
.page-head h1 {
  grid-column: 1 / span 8; margin: 0; font-size: clamp(40px, 7vw, 104px);
  font-weight: 800; line-height: .9; letter-spacing: -.05em;
}
.page-head .aside { grid-column: 9 / span 4; justify-self: end; text-align: right; font-size: 13px; }

/* ---------- Projects grid ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }
.filters button {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  padding: 6px 14px; border-radius: 0;
}
.filters button:hover { background: var(--lime); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filters .count { font-weight: 400; margin-left: 6px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tile-flood { font-size: clamp(26px, 2.6vw, 44px); } }
.tile { display: block; text-decoration: none; color: inherit; background: var(--paper); }
.tile[hidden] { display: none; }
.tile-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #eee; }
.tile-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.tile-flood {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 20px;
  background: var(--flood, var(--lime)); color: var(--flood-ink, var(--ink));
  opacity: 0; transition: opacity .35s var(--ease);
  font-size: clamp(28px, 4vw, 64px); font-weight: 800; line-height: .95; letter-spacing: -.04em;
}
.tile.plum { --flood: var(--plum); --flood-ink: var(--paper); }
.tile:hover .tile-media img, .tile:focus-visible .tile-media img { transform: scale(1.09); }
.tile:hover .tile-flood, .tile:focus-visible .tile-flood { opacity: .92; }
.tile-info {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline;
  padding: 10px 0 4px; border-top: 2px solid var(--ink); margin-top: 8px;
}
.tile-info .t { font-weight: 700; font-size: 17px; }
.cursor-label {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  background: var(--lime); color: var(--ink); font-size: 13px; font-weight: 700;
  padding: 5px 9px; white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.cursor-label.on { opacity: 1; }

/* ---------- Project page ---------- */
.proj-head { grid-template-columns: repeat(12, 1fr); }
.proj-head .crumbs { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 18px; }
.proj-head .crumbs a { text-decoration: none; border-bottom: 2px solid var(--lime); }
.meta {
  grid-column: 9 / span 4; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  font-size: 14px; align-self: end;
}
.meta dt { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
.meta dd { margin: 0; }

.proj-body {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px;
  align-items: start; margin-bottom: 32px;
}
.motion { margin: 0; position: sticky; top: calc(var(--header-h) + 16px); }
.motion img, .motion video { display: block; width: 100%; height: auto; border: 2px solid var(--ink); background: #fff; }
.motion figcaption, .gallery figcaption { font-size: 13px; padding-top: 6px; }
.process { padding: 0; }
.process section + section { margin-top: 28px; }
.process h2 {
  margin: 0 0 10px; font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  display: inline-block; background: var(--ink); color: var(--paper); padding: 2px 8px;
}
.process h2::before { content: attr(data-n) " "; color: var(--lime); }
.process p { margin: 0 0 12px; max-width: 64ch; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { padding: 10px 0; border-top: 1px solid var(--ink); }
.steps li:last-child { border-bottom: 1px solid var(--ink); }
.steps b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--plum); }

.gallery-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 10px; margin-bottom: 14px; }
.gallery-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.gallery figure { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.gallery figure.big { grid-column: span 2; grid-row: span 2; }
.gallery figure.wide { grid-column: span 2; }
.gallery button {
  display: block; width: 100%; flex: 1; min-height: 0; padding: 0; border: 0; background: #f1f1f1;
  cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden;
}
.gallery figure.big button, .gallery figure.wide button { aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery .fit button { background: #fff; outline: 1px solid #e4e4e4; outline-offset: -1px; }
.gallery .fit img { object-fit: contain; padding: 4%; }
.gallery button:hover img { transform: scale(1.03); }
.gallery.steps-grid figure button { aspect-ratio: 1 / 1; }
.step-n { font-weight: 800; color: var(--plum); margin-right: 4px; }

.next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px;
  border-top: 2px solid var(--ink); padding-top: 14px;
}
.next a { text-decoration: none; display: block; padding: 10px 0; }
.next a:last-child { text-align: right; }
.next a span { display: block; }
.next a strong { font-size: clamp(20px, 2.6vw, 34px); letter-spacing: -.03em; }
.next a:hover strong { background: var(--lime); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(255,255,255,.97);
  display: none; align-items: center; justify-content: center; padding: 64px var(--gutter) 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; top: 16px; right: var(--gutter); font: inherit; font-weight: 700; font-size: 14px;
  background: var(--ink); color: var(--paper); border: 0; padding: 8px 14px; cursor: pointer;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px 16px; }
.about-photo { grid-column: 1 / span 4; margin: 0; }
.about-photo img { width: 100%; filter: grayscale(1); border: 2px solid var(--ink); }
.about-bio { grid-column: 5 / span 8; }
.about-bio p { margin: 0 0 14px; max-width: 64ch; font-size: 17px; }
.about-bio .lead { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.35; font-weight: 700; letter-spacing: -.02em; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 15px;
  background: var(--lime); color: var(--ink); padding: 10px 16px; border: 2px solid var(--ink);
}
.btn:hover { background: var(--plum); color: var(--paper); }
.cols { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.cols section { border-top: 2px solid var(--ink); padding-top: 10px; }
.cols h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--plum); }
.cols ul { list-style: none; margin: 0; padding: 0; }
.cols li { margin-bottom: 12px; font-size: 16px; line-height: 1.45; }
.cols li small { display: block; font-size: 13px; color: var(--grey); }
.contact a { text-decoration: none; border-bottom: 2px solid var(--lime); word-break: break-word; }
.contact a:hover { background: var(--lime); }

/* ---------- Project story: one step at a time, generous white space ---------- */
.story { margin-top: 8px; }
.story h2 {
  margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  display: inline-block; background: var(--ink); color: var(--paper); padding: 2px 8px;
}
.story h2::before { content: attr(data-n) " "; color: var(--lime); }
.story p { margin: 0 0 14px; max-width: 58ch; }
.step {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 16px;
  border-top: 1px solid var(--ink); padding-top: 18px;
  margin-bottom: clamp(88px, 11vw, 176px);
}
.step.intro { border-top: 0; padding-top: 0; }
.step-text { grid-column: 1 / span 4; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); padding-right: 12px; }
.step-media { grid-column: 6 / span 7; display: grid; gap: clamp(40px, 5vw, 80px); }
.step.text-only .step-text { grid-column: 1 / span 7; position: static; }
.step-label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--plum); }
.step h3 { margin: 6px 0 14px; font-size: clamp(24px, 2.4vw, 36px); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.step-text .sub { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--plum); }
.story-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: clamp(48px, 6vw, 96px); }
.story-head h2 { margin: 0; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 40px); align-items: end; }
.step-media figure { margin: 0; }
.step-media button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.step-media img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; object-position: left bottom; transition: opacity .3s; }
.row.two img { max-height: 56vh; }
.step-media button:hover img { opacity: .88; }
.step-media figcaption, .motion-fig figcaption { font-size: 13px; color: var(--grey); padding-top: 10px; }
.motion-fig video { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; object-position: left top; background: var(--paper); }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery figure.big { grid-row: auto; }
  .gallery figure.tablet-wide { grid-column: span 2; }
  .gallery figure.tablet-wide button { aspect-ratio: 16 / 9; }
  .proj-body { grid-template-columns: 1fr 1fr; gap: 24px; }
  .step-text { grid-column: 1 / span 5; }
  .step-media { grid-column: 6 / span 7; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta { grid-column: 1 / -1; margin-top: 14px; }
  .page-head h1 { grid-column: 1 / -1; }
  .page-head .aside { grid-column: 1 / -1; justify-self: start; text-align: left; margin-top: 8px; }
}

/* ---------- Phone: wordmark sits at the end of the content, not floating ---------- */
@media (max-width: 700px) {
  :root { --header-h: 92px; --wm-big: 19vw; --wm-small: 11vw; }
  body { padding-bottom: 0; }
  .site-header { gap: 12px; padding-top: 14px; }
  .nav { font-size: 14px; flex-direction: column; gap: 2px; }
  .nav a { align-self: flex-start; }
  .tagline { max-width: 54%; }
  .wordmark {
    position: static; display: block; text-align: right; right: auto; bottom: auto;
    padding: 32px var(--gutter) calc(var(--gutter) * .6);
  }
  .grid { grid-template-columns: 1fr; }
  .proj-body { grid-template-columns: 1fr; }
  .step { display: block; margin-bottom: 72px; }
  .step-text { position: static; padding-right: 0; margin-bottom: 24px; }
  .step-media { gap: 32px; }
  .row.two { grid-template-columns: 1fr; gap: 32px; }
  .step-media img, .row.two img, .motion-fig video { max-height: none; }
  .story-head { flex-direction: column; gap: 6px; }
  .motion { position: static; }
  .gallery { grid-template-columns: 1fr; }
  .gallery figure.big, .gallery figure.wide, .gallery figure.tablet-wide { grid-column: auto; grid-row: auto; }
  .gallery button, .gallery figure.big button, .gallery figure.wide button, .gallery figure.tablet-wide button { aspect-ratio: auto; }
  .gallery img { height: auto; }
  .gallery.steps-grid figure button { aspect-ratio: auto; }
  .about-photo { grid-column: 1 / -1; max-width: 320px; }
  .about-bio { grid-column: 1 / -1; }
  .cols { grid-template-columns: 1fr; }
  .next { grid-template-columns: 1fr; }
  .next a:last-child { text-align: left; }
  /* home on phones: stage fills the screen above the wordmark */
  .home { display: flex; flex-direction: column; height: 100svh; }
  .home main { position: relative; inset: auto; top: auto; bottom: auto; flex: 1; min-height: 0; margin-top: var(--header-h); }
  .home .stage { position: absolute; inset: 0; }
  .home .wordmark { flex: none; position: relative; z-index: 2; padding-bottom: 12px; }
  .hint { position: static; padding: 0 var(--gutter); max-width: none; margin-top: 4px; }
}

/* ---------- Touch: show titles, no cursor label ---------- */
@media (hover: none) {
  .cursor-label { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js [data-reveal], .js .wordmark[data-reveal] { opacity: 1; transform: none; clip-path: none; }
  .tile:hover .tile-media img { transform: none; }
}
