/* Momento Portrait Co. — colours and type follow the Momento app (Shared/Theme.swift). */

:root {
  --ink: #060505;          /* almost-black background */
  --panel: #161514;        /* raised panels */
  --cream: #f5ebd6;        /* text and buttons */
  --paper: #ded9cd;        /* muted eggshell, light section */
  --paper-ink: #1a1816;    /* text on the light section */
  --amber: #db8f42;        /* faint light leak only */
  --line: rgba(255, 255, 255, 0.14);
  --muted: rgba(245, 235, 214, 0.62);

  --print: #faf7f0;        /* vintage print border (app: printWhite) */

  /* The app's own fonts: Apple's New York (serif) and SF Pro (sans).
     Apple devices show them exactly; other devices fall back to the closest system fonts. */
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;

  --page: min(1200px, 100% - 3rem);
  --space: clamp(5rem, 11vw, 9rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Moving background (app: AmbientBackground) ---------- */

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ink); }
.glow {
  position: absolute; border-radius: 50%;
  will-change: transform, opacity;
  animation: orbit var(--dur, 30s) ease-in-out infinite, breathe var(--pulse, 9s) ease-in-out infinite;
}
.g1 { width: 120vmax; height: 120vmax; left: -35vmax; top: -30vmax; --dur: 29s; --pulse: 11s;
      background: radial-gradient(circle, rgba(38, 37, 36, 0.95), transparent 62%); }
.g2 { width: 130vmax; height: 130vmax; right: -45vmax; bottom: -50vmax; --dur: 36s; --pulse: 13s; animation-delay: -12s;
      background: radial-gradient(circle, rgba(28, 27, 26, 1), transparent 62%); }
.g3 { width: 80vmax; height: 80vmax; left: 20vw; bottom: -45vmax; --dur: 22s; --pulse: 8s; animation-delay: -5s;
      background: radial-gradient(circle, rgba(36, 35, 34, 0.6), transparent 62%); }
.leak { mix-blend-mode: screen; }
.l1 { width: 85vmax; height: 85vmax; right: -40vmax; top: -45vmax; --dur: 25s; --pulse: 7s; animation-delay: -8s;
      background: radial-gradient(circle, rgba(219, 143, 66, 0.13), transparent 60%); }
.l2 { width: 50vmax; height: 50vmax; left: -22vmax; bottom: -25vmax; --dur: 20s; --pulse: 10s; animation-delay: -3s;
      background: radial-gradient(circle, rgba(219, 143, 66, 0.06), transparent 60%); }
@keyframes orbit {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(14vw, 8vh); }
  50%  { transform: translate(6vw, 18vh); }
  75%  { transform: translate(-9vw, 7vh); }
  100% { transform: translate(0, 0); }
}
@keyframes breathe { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 300;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: 0.1em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); letter-spacing: 0.11em; }
h3 { font-size: 1.15rem; letter-spacing: 0.14em; }

/* The "PORTRAIT CO." face: regular sans, wide tracking, caps. */
.label, .nav a, .button, .step-number, .optional, label, .footer {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.label { color: var(--muted); margin: 0 0 1.2rem; }
.lead { font-size: clamp(1.3rem, 2vw, 1.55rem); color: var(--muted); max-width: 30ch; margin: 1.8rem 0 2.6rem; }

/* ---------- Wordmark (text version of the app logo) ---------- */

.wordmark { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; }
.wordmark-name {
  font-family: var(--serif); font-weight: 300;
  font-size: 1.5rem; letter-spacing: 0.28em; padding-left: 0.28em; line-height: 1;
}
.wordmark-sub {
  font-family: var(--sans); font-size: 0.55rem;
  letter-spacing: 0.3em; padding-left: 0.3em; opacity: 0.75; margin-top: 0.4rem;
}
.wordmark-small .wordmark-name { font-size: 1.1rem; }

/* ---------- Buttons (cream fill + outline share one size) ---------- */

.button {
  display: inline-block;
  padding: 1.05rem 2rem;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.button:hover { background: transparent; color: var(--cream); }
.button-small { padding: 0.7rem 1.3rem; font-size: 0.65rem; }
.button:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 1px solid var(--cream); outline-offset: 4px;
}

/* ---------- Vintage print border on every portrait ---------- */

img.print {
  background: var(--print);
  padding: clamp(7px, 3.2%, 20px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}
.section-light img.print { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 22px 40px -22px rgba(0, 0, 0, 0.45); }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 2.5rem;
  padding: 1.1rem max(1.5rem, (100% - 1200px) / 2);
  background: rgba(6, 5, 5, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; gap: 2.2rem; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav a:hover { color: var(--cream); }

/* ---------- Sections ---------- */

.section { width: var(--page); margin: 0 auto; padding: var(--space) 0; }
.section-head { margin-bottom: clamp(3rem, 6vw, 4.5rem); max-width: 40rem; }

/* Light eggshell band, like the iPad gallery screen */
.section-light {
  width: 100%;
  padding-inline: max(1.5rem, (100% - 1200px) / 2);
  background: var(--paper);
  color: var(--paper-ink);
}
.section-light .label { color: rgba(26, 24, 22, 0.6); }

/* ---------- 1. Opening ---------- */

.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 4rem;
  width: var(--page); margin: 0 auto;
  padding: 8rem 0 5rem;
}
.hero-text, .hero-photo { position: relative; z-index: 1; }
.hero-photo { margin: 0; }
.hero-photo { justify-self: center; }
.hero-photo img { width: auto; max-width: 100%; max-height: 74vh; aspect-ratio: 2 / 3; object-fit: cover; transform: rotate(1.5deg); }

.hero-text h1 .line { display: inline-block; }

/* ---------- 2. Experience ---------- */

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}
.step img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; margin-bottom: 1.6rem; }
.step-number { color: var(--muted); margin: 0 0 0.6rem; }
.step h3 { margin-bottom: 0.8rem; }
.step p:last-child { color: var(--muted); margin: 0; font-size: 1.15rem; }
.optional {
  display: inline-block; vertical-align: middle; margin-left: 0.4rem;
  font-size: 0.55rem; padding: 0.25rem 0.5rem; border: 1px solid var(--line); color: var(--muted);
}
/* What they don't need: three words struck through, the line draws across as it scrolls in. */
.without { margin: 6rem auto 0; text-align: center; }
.without-list {
  display: flex; justify-content: center; gap: clamp(2rem, 7vw, 6rem); flex-wrap: wrap;
  margin: 0 0 1.8rem;
  font-family: var(--serif); font-weight: 300; text-transform: uppercase;
  font-size: clamp(1.8rem, 4.2vw, 3.2rem); letter-spacing: 0.12em;
}
.without-list s { text-decoration: none; position: relative; color: var(--muted); }
.without-list s::after {
  content: ""; position: absolute; left: -6%; right: -6%; top: 52%;
  height: 1.5px; background: var(--cream);
  transform-origin: left;
}
.js .without.reveal .without-list s::after { transform: scaleX(0); transition: transform 0.8s cubic-bezier(.6,0,.2,1); }
.js .without.reveal.visible .without-list span:nth-child(1) s::after { transform: scaleX(1); transition-delay: 0.5s; }
.js .without.reveal.visible .without-list span:nth-child(2) s::after { transform: scaleX(1); transition-delay: 0.8s; }
.js .without.reveal.visible .without-list span:nth-child(3) s::after { transform: scaleX(1); transition-delay: 1.1s; }
.without-line { margin: 0 auto; max-width: 34rem; font-style: italic; font-size: 1.25rem; color: var(--muted); }

/* ---------- 3. Portraits ---------- */

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.gallery-item {
  padding: 0; border: 0; background: none; cursor: zoom-in; overflow: hidden;
}
.gallery-item { overflow: visible; }
.gallery-item img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; transition: transform 0.6s cubic-bezier(.2,.7,.2,1), box-shadow 0.6s; }
.gallery-item:hover img { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 2px 3px rgba(0,0,0,.12), 0 34px 50px -24px rgba(0,0,0,.5); }
.station { margin: 0 0 1.5rem; }
.station img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh;
}
.lightbox::backdrop { background: rgba(6, 5, 5, 0.92); }
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; background: var(--print); padding: clamp(8px, 2vmin, 20px); }
.lightbox-close {
  position: fixed; top: 1.2rem; right: 1.6rem;
  background: none; border: 0; color: var(--cream); font-size: 2.4rem; font-weight: 300; cursor: pointer;
}

/* ---------- 4. What's included ---------- */

.columns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 2.6rem; }
.panel h3 { margin-bottom: 1.4rem; }
.panel ul { margin: 0; padding: 0; list-style: none; }
.panel li { padding: 0.75rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.panel li:first-child { border-top: 0; }
.cta {
  margin-top: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  flex-wrap: wrap;
}
.cta p { margin: 0; font-size: 1.45rem; max-width: 30ch; }

/* ---------- 5. About ---------- */

.about { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 5rem; align-items: center; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.about-photos img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.about-photos img:first-child { --tilt: -2.2deg; }
.about-photos img:last-child { --tilt: 1.8deg; margin-top: 4rem; }
.about-text h2 { margin-bottom: 1.8rem; }
.about-text p:not(.label) { color: var(--muted); }

/* ---------- 6. Questions ---------- */

.faq { max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.5rem 0; font-size: 1.4rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 300; font-size: 1.4rem; transition: transform 0.3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.6rem; color: var(--muted); max-width: 40rem; }

/* ---------- 7. Contact ---------- */

.contact {
  position: relative;
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 5rem; align-items: start;
}
.contact > :not(.ambient) { position: relative; z-index: 1; }
.contact-intro h2 { margin-bottom: 1.4rem; }
.contact-intro > p:not(.label):not(.direct) { color: var(--muted); max-width: 26ch; }
.direct { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 3rem; }
.direct .label { margin-bottom: 0.4rem; }
.direct a { text-decoration: none; border-bottom: 1px solid var(--line); width: fit-content; }
.direct a:hover { border-bottom-color: var(--cream); }

.contact-form { display: flex; flex-direction: column; gap: 1.6rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.field { display: flex; flex-direction: column; gap: 0.6rem; }
label { color: var(--muted); }
input, textarea {
  font: inherit; font-size: 1.15rem; color: var(--cream);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 0;
  padding: 0.85rem 1rem;
  color-scheme: dark;
}
input:focus, textarea:focus { outline: none; border-color: var(--cream); }
textarea { resize: vertical; }
.contact-form .button { align-self: flex-start; }
.trap { position: absolute; left: -9999px; }
.form-status { margin: 0; color: var(--muted); font-size: 1.1rem; min-height: 1.6em; }

/* ---------- Footer ---------- */

.footer {
  width: var(--page); margin: 0 auto; padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; color: var(--muted);
}
.footer .wordmark { margin-right: auto; color: var(--cream); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--cream); }

/* ---------- Animation ---------- */

/* Page load: top bar slides in, headline rises line by line, the hero print develops. */
.js .topbar { animation: drop-in 0.9s cubic-bezier(.2,.7,.2,1) both; }
.js .hero-text .label, .js .hero-text .lead, .js .hero-text .button { animation: rise 1s cubic-bezier(.2,.7,.2,1) both; }
.js .hero-text .label { animation-delay: 0.2s; }
.js .hero-text h1 .line { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) both; }
.js .hero-text h1 .line:nth-child(1) { animation-delay: 0.35s; }
.js .hero-text h1 .line:nth-child(2) { animation-delay: 0.5s; }
.js .hero-text h1 .line:nth-child(3) { animation-delay: 0.65s; }
.js .hero-text .lead { animation-delay: 0.9s; }
.js .hero-text .button { animation-delay: 1.05s; }
.js .hero-photo { animation: settle 1.6s cubic-bezier(.2,.7,.2,1) 0.4s both; }
.js .hero-photo img { animation: develop 2.6s ease-out 0.5s both; }

@keyframes drop-in { from { transform: translateY(-100%); opacity: 0; } }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }
@keyframes settle { from { transform: translateY(40px) rotate(4deg); opacity: 0; } }
/* Like a print developing: starts pale and soft, comes up to full contrast. */
@keyframes develop { from { filter: brightness(1.6) contrast(0.5) blur(2px); } to { filter: none; } }

/* Scroll: each block fades up; items in a group follow one after another (delay set in main.js). */
.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay, 0s);
}
.js .reveal.visible { opacity: 1; transform: none; }

/* Step photos ease out of a slight zoom as they appear. */
.js .step img { transform: scale(1.08); transition: transform 1.8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--delay, 0s); }
.js .step.visible img { transform: none; }
.step { overflow: hidden; }

/* Portrait tiles land like prints laid on a table. */
.js .gallery-item.reveal { transform: translateY(40px) scale(0.94) rotate(var(--from-tilt, 2deg)); }
.js .gallery-item.reveal.visible { transform: none; }
.gallery-item:nth-child(even) { --from-tilt: -2deg; }

/* About prints drop in and come to rest at their tilt. */
.js .about-photos img.reveal { transform: translateY(50px) rotate(calc(var(--tilt) * -2)); }
.about-photos img, .js .about-photos img.reveal.visible { transform: rotate(var(--tilt)); }

/* FAQ answers slide open. */
.faq details[open] p { animation: rise 0.5s ease both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .step img, .js .gallery-item.reveal { opacity: 1; transform: none; }
  .js .about-photos img.reveal { opacity: 1; transform: rotate(var(--tilt)); }
  .js .without.reveal .without-list s::after { transform: scaleX(1); }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 3.5rem; }
  .about, .contact { grid-template-columns: 1fr; gap: 3.5rem; }
  .columns { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .topbar { justify-content: space-between; }
  .hero { grid-template-columns: 1fr; padding-top: 7rem; gap: 3rem; }
  .hero-photo { order: -1; }
  .hero-photo img { max-height: 60vh; }
  .steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .station img { aspect-ratio: 3 / 2; }
  .field-row { grid-template-columns: 1fr; }
  .panel { padding: 1.8rem; }
  .footer { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer .wordmark { align-items: flex-start; }
}
