/* ============================================================
   Trevor Lewis Photography — Production additions
   Layered on top of tokens.css and kit.css. Anything new for the
   full production build (mobile nav, parallax targets, caption
   reveal, hero word clip, contact form, stray-notes empty,
   about page, focus rings) lives here.
   ============================================================ */

/* ---- Global focus ring (keyboard only) ---------------------- */
:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
  border-radius: 0;
}

/* Plate hover ring shouldn't compete with focus. */
.plate:focus-visible { outline-offset: 6px; }

/* Smooth in-page anchor jumps but only when explicitly requested. */
html { scroll-behavior: auto; }

/* ---- Hero overlay darkening tracks scroll (set from JS) ----- */
.hero__overlay,
.cover__overlay {
  /* gradient stops modulated via --o (0..1) for scroll-darkening */
  background: linear-gradient(180deg,
    rgba(20,17,13, calc(0.55 + 0.20 * var(--o, 0))) 0%,
    rgba(20,17,13, calc(0.00 + 0.15 * var(--o, 0))) 30%,
    rgba(20,17,13, calc(0.00 + 0.15 * var(--o, 0))) 55%,
    rgba(20,17,13, calc(0.78 + 0.18 * var(--o, 0))) 100%);
}

/* ---- Hero word-by-word reveal (clipped slide) --------------
   Brief spec is explicit: each word starts at translateY(110%)
   clipped by its container, then slides up. */
.hero__h1 .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* Padding lets descenders + italic overshoots breathe. */
  padding-bottom: 0.12em;
  line-height: 0.95;
}
.hero__h1 .word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  opacity: 1;
}
.hero__h1.is-shown .word > span {
  transform: translateY(0);
}
/* Restore final state under reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .hero__h1 .word > span { transform: none !important; }
}

/* ---- Photo blur-up placeholder ----------------------------- */
.photo {
  background: var(--paper-deep);
}
.photo > img {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.photo.is-loaded > img { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .photo > img { opacity: 1 !important; transition: none !important; }
}

/* ---- Plate per-element parallax ----------------------------
   The frame stays; the inner image translates by --py (0..1 mapped
   from in-viewport position) with an amplitude set per-plate. */
.plate__frame > .photo {
  height: calc(100% + 12%);
  top: -6%;
  transform: translateY(var(--py, 0px));
  /* No CSS transition — JS rAF updates px directly. */
}

/* ---- Caption reveal under each plate ----------------------- */
.plate__cap {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s var(--ease) 0.2s,
              transform 0.9s var(--ease) 0.2s;
}
.plate.cap-shown .plate__cap {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .plate__cap { opacity: 1 !important; transform: none !important; }
}

/* ---- Feature cover parallax (homepage) --------------------- */
.feature__cover { position: relative; }
.feature__cover > .photo {
  height: calc(100% + 16%);
  top: -8%;
  transform: translateY(var(--py, 0px));
}

/* ---- Next portfolio cover parallax ------------------------- */
.next-port__cover > .photo {
  height: calc(100% + 12%);
  top: -6%;
  transform: translateY(var(--py, 0px));
}
.next-port:hover .next-port__title {
  color: var(--rust);
  font-style: italic;
}
.next-port__title {
  transition: color var(--dur-hover-long) var(--ease),
              font-style var(--dur-hover-long) var(--ease);
}

/* ---- Mobile hamburger + full-screen overlay nav ------------ */
.nav__burger {
  display: none;
  position: relative;
  width: 36px; height: 22px;
  background: transparent;
  border: 0; padding: 0;
  cursor: pointer;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.nav__burger span {
  position: absolute; left: 0; right: 0;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur-hover-long) var(--ease),
              opacity var(--dur-hover) var(--ease),
              top var(--dur-hover-long) var(--ease),
              bottom var(--dur-hover-long) var(--ease);
}
.nav__burger span:nth-child(1) { top: 4px; }
.nav__burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav__burger span:nth-child(3) { bottom: 4px; }

.nav--open .nav__burger span:nth-child(1) { top: 50%; transform: rotate(45deg); }
.nav--open .nav__burger span:nth-child(2) { opacity: 0; }
.nav--open .nav__burger span:nth-child(3) { bottom: 50%; transform: rotate(-45deg); top: auto; }

@media (max-width: 900px) {
  .nav__burger { display: block; }
}

.mobile-nav {
  position: fixed; inset: 0;
  z-index: 49;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding: 6rem var(--pad-page-sm) 3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease);
}
.mobile-nav.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav__masthead {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: var(--tr-label-wide);
  text-transform: uppercase;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin-bottom: 2.5rem;
  display: flex; justify-content: space-between;
}
.mobile-nav__h {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.7rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase; color: var(--ink-mute);
  margin: 0 0 1rem;
}
.mobile-nav__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.mobile-nav__list li {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.05;
  letter-spacing: var(--tr-display);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color var(--dur-hover-long) var(--ease);
  /* Stagger via index */
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), color var(--dur-hover-long) var(--ease);
  transition-delay: calc(0.04s * var(--i, 0) + 0.15s);
}
.mobile-nav.is-open .mobile-nav__list li {
  opacity: 1; transform: translateY(0);
}
.mobile-nav__list li:active,
.mobile-nav__list li:hover {
  color: var(--rust);
  font-style: italic;
}
.mobile-nav__list .num {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: var(--tr-label);
  color: var(--ink-mute);
  font-style: normal;
}
.mobile-nav__minor {
  display: flex; gap: 2rem;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.7rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase;
  margin-top: auto; padding-top: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-mute);
}
.mobile-nav__minor a {
  cursor: pointer;
  transition: color var(--dur-hover) var(--ease);
}
.mobile-nav__minor a:hover { color: var(--rust); }
.mobile-nav__email {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.95rem; letter-spacing: 0;
  text-transform: none;
  color: var(--rust);
  margin-top: 1rem;
}

/* ---- Editor's note tweaks for production ------------------- */
.blurb__label {
  /* mono label slightly more refined */
  font-weight: 600;
}

/* ---- Page-section headers --------------------------------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 2rem;
  padding-top: 6rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 3rem;
}
.section-head h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-h2); line-height: 0.95;
  letter-spacing: var(--tr-display);
  margin: 1.25rem 0 0;
  max-width: 30rem;
}
.section-head h2 em { color: var(--rust); font-style: italic; }
.section-head__meta {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: var(--tr-label); text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
}

/* ---- TOC head on homepage --------------------------------- */
.toc-head {
  padding: 4rem 0 1rem;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem;
  align-items: end;
  margin-top: 1rem;
}
.toc-head__label {
  padding-top: 1rem;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.72rem;
  letter-spacing: var(--tr-label-wide); text-transform: uppercase;
  color: var(--ink);
}
.toc-head__title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: 0.95;
  letter-spacing: var(--tr-display);
  margin: 0;
}
.toc-head__title em { color: var(--rust); font-style: italic; }
.toc-head__sub {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.72rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase; color: var(--ink-mute);
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .toc-head { grid-template-columns: 1fr; gap: 1rem; padding: 3rem 0 1rem; }
  .section-head { padding-top: 3rem; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .section-head__meta { text-align: left; }
}

/* ---- Stray Notes empty state ------------------------------ */
.stray-empty {
  padding: 8rem 0 10rem;
  display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem;
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}
.stray-empty__label {
  padding-top: 0.85rem;
  border-top: 2px solid var(--ink);
  font-family: var(--font-mono); font-weight: 600;
  font-size: 0.72rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase;
}
.stray-empty__body {
  font-family: var(--font-serif); font-weight: 300;
  font-size: var(--fs-blurb); line-height: var(--lh-blurb);
  max-width: var(--max-prose);
}
.stray-empty__body em { color: var(--rust); font-style: italic; }
.stray-empty__plates {
  margin-top: 3rem;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 38rem;
}
.stray-empty__placeholder {
  aspect-ratio: 4/5;
  border: 1px solid var(--rule);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: var(--tr-label-wide); text-transform: uppercase;
  color: var(--ink-mute);
}
.stray-empty__placeholder::before {
  content: ''; position: absolute;
  top: 50%; left: 12%; right: 12%;
  height: 1px; background: var(--rule);
}
@media (max-width: 900px) {
  .stray-empty { grid-template-columns: 1fr; padding: 4rem 0; }
  .stray-empty__plates { grid-template-columns: repeat(2, 1fr); }
}

/* ---- About page ------------------------------------------ */
.about {
  padding: 9rem 0 6rem;
}
.about__masthead {
  display: flex; justify-content: space-between; gap: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.7rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase; color: var(--ink-mute);
}
.about__masthead .middle {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.95rem; letter-spacing: 0;
  text-transform: none; color: var(--ink);
}
.about__title {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: var(--tr-hero);
  font-variation-settings: "opsz" 144;
  margin: 0 0 0.75rem;
  max-width: 18ch;
}
.about__title em { color: var(--rust); font-style: italic; }
.about__lede {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  color: var(--ink);
  max-width: 36rem;
  margin: 0 0 4rem;
}
.about__grid {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  margin-bottom: 6rem;
}
.about__pic {
  aspect-ratio: 4/5;
  overflow: hidden;
}
.about__pic > .photo { height: 100%; }
.about__pic > .photo img { filter: contrast(1.03) saturate(0.9); }
.about__caption {
  margin-top: 0.85rem; padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.65rem;
  letter-spacing: var(--tr-label); text-transform: uppercase;
  color: var(--ink-mute);
}
.about__caption em {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.95rem; letter-spacing: 0;
  text-transform: none; color: var(--rust);
}
.about__body {
  font-family: var(--font-serif); font-weight: 300;
  font-size: 1.15rem; line-height: 1.65;
  max-width: 38rem;
  color: var(--ink);
}
.about__body p { margin: 0 0 1.2em; }
.about__body em { color: var(--rust); font-style: italic; }
.about__pull {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: var(--tr-display);
  max-width: 36rem;
  padding: 3rem 0;
  margin: 3rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.about__pull em { color: var(--rust); font-style: italic; }
.about__list {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.about__list:last-of-type { border-bottom: 1px solid var(--rule); }
.about__list dt {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.72rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase; color: var(--ink);
}
.about__list dd {
  font-family: var(--font-serif); font-size: 1.05rem;
  line-height: 1.55; color: var(--ink-soft);
  margin: 0;
}
.about__list dd em { color: var(--rust); font-style: italic; }
@media (max-width: 900px) {
  .about { padding: 6rem 0 3rem; }
  .about__grid { grid-template-columns: 1fr; gap: 2rem; }
  .about__list { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---- Contact page ----------------------------------------- */
.contact {
  padding: 9rem 0 6rem;
}
.contact__head {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem;
  margin-bottom: 4rem;
}
.contact__title {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: var(--tr-hero);
  font-variation-settings: "opsz" 144;
  margin: 0;
}
.contact__title em { color: var(--rust); font-style: italic; }
.contact__lede {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  max-width: 28rem;
  margin: 0;
  align-self: center;
  color: var(--ink-soft);
}
.contact__grid {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
}
.contact__aside h4 {
  font-family: var(--font-mono); font-weight: 600;
  font-size: 0.7rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.contact__aside p {
  font-family: var(--font-serif); font-size: 1rem;
  line-height: 1.55; color: var(--ink-soft);
  max-width: 22rem;
  margin: 0 0 2rem;
}
.contact__aside a.email {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.05rem; color: var(--rust);
}
.contact__form {
  display: flex; flex-direction: column;
  gap: 2rem;
}
.contact__field {
  display: flex; flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}
.contact__field label {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.68rem; letter-spacing: var(--tr-label-wide);
  text-transform: uppercase; color: var(--ink-mute);
  display: flex; justify-content: space-between;
}
.contact__field label .req {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.85rem; letter-spacing: 0;
  text-transform: none; color: var(--rust);
}
.contact__field input,
.contact__field textarea,
.contact__field select {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  padding: 0.4rem 0;
  resize: none;
  width: 100%;
  border-bottom: 1px solid transparent; /* sit flat by default */
  transition: border-color var(--dur-hover) var(--ease);
}
.contact__field input::placeholder,
.contact__field textarea::placeholder {
  color: var(--ink-mute); font-style: italic;
}
.contact__field input:focus,
.contact__field textarea:focus,
.contact__field select:focus {
  outline: none;
  border-bottom-color: var(--rust);
}
.contact__field textarea { min-height: 8rem; }
.contact__radios {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  padding-top: 0.25rem;
}
.contact__radio {
  display: inline-flex; align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif); font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color var(--dur-hover) var(--ease);
}
.contact__radio input { display: none; }
.contact__radio .dot {
  display: inline-block; width: 9px; height: 9px;
  border: 1px solid var(--ink); border-radius: 50%;
  transition: background var(--dur-hover) var(--ease),
              border-color var(--dur-hover) var(--ease);
}
.contact__radio input:checked + .dot {
  background: var(--rust); border-color: var(--rust);
}
.contact__radio input:checked ~ span:last-child {
  font-style: italic; color: var(--rust);
}
.contact__submit {
  display: inline-flex; justify-content: space-between; align-items: baseline;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--ink);
  padding: 1rem 0 0;
  font-family: var(--font-serif); font-weight: 400;
  font-size: 1.4rem; line-height: 1;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: color var(--dur-hover) var(--ease);
}
.contact__submit .arrow {
  display: inline-block; color: var(--rust);
  transition: transform var(--dur-hover) var(--ease);
}
.contact__submit:hover { color: var(--rust); font-style: italic; }
.contact__submit:hover .arrow { transform: translateX(6px); }
.contact__submit[disabled] {
  color: var(--ink-mute); cursor: not-allowed;
  font-style: italic;
}
.contact__sent {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.2rem;
  color: var(--rust);
  padding: 1.5rem 0;
  border-top: 1px solid var(--rust);
  margin-top: 1rem;
}
.contact__sent p {
  font-family: var(--font-serif); font-style: normal;
  font-size: 1rem; max-width: 26rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}
@media (max-width: 900px) {
  .contact { padding: 6rem 0 3rem; }
  .contact__head, .contact__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---- Skip link for keyboard users ------------------------- */
.skip {
  position: absolute; left: 0.5rem; top: 0.5rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  z-index: 60;
  transform: translateY(-200%);
  transition: transform var(--dur-hover) var(--ease);
}
.skip:focus { transform: translateY(0); color: var(--paper); }

/* ---- Hero refinements (production) ----------------------- */
.hero__top { z-index: 2; }
.hero__title { z-index: 2; }
.hero__photo { will-change: transform; }
.cover__photo { will-change: transform; }

/* Production hero masthead — three-up center-italic */
.hero__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}
.hero__top .right { text-align: right; }
@media (max-width: 900px) {
  .hero__top { grid-template-columns: 1fr; text-align: left; }
  .hero__top .right { text-align: left; }
  .hero__top .center { display: none; }
}

/* Hero "scroll" affordance on the right uses italic + dot */
.hero__byline em { color: var(--rust); font-style: italic; }

/* ---- Crossfade route transitions ------------------------- */
.route {
  animation: route-in 0.7s var(--ease) both;
}
@keyframes route-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .route { animation: none !important; }
}

/* ---- Nav refinements when scrolled --------------------- */
.nav__brand .name { letter-spacing: -0.01em; }
.nav__brand { font-size: 1.1rem; }
.nav__brand .dim {
  color: inherit; opacity: 0.7;
  font-style: italic;
}
