/* Dark theme in romio's style, with dark reds instead of pinks. */
/* Muted like romio's dark love wall: a near-black with a little wine in it. */
:root {
  --background: #171113;
  --rose: #c46a6f;          /* muted red for the italic name */
  --foreground: #efe4e3;
  --muted: #b3a1a0;
  --border: #3a2224;
  --card: #221516;
  --accent: #8b0000;        /* her favourite: dark red */
  --accent-light: #c0393b;
}

* { box-sizing: border-box; }
html { background: var(--background); color-scheme: dark; scroll-behavior: smooth; }
/* No body background: it would paint over the page-wide glow. */
body { margin: 0; color: var(--foreground); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
/* Headings: Georgia. Bio and "See her work": Montserrat. */
:root { --serif: Georgia, serif; --sans: Montserrat, system-ui, sans-serif; }
h1 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.05; }

/* ---------- Soft glow balls (romio's aurora, in dark reds) ---------- */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: paint; }
.glow span { position: absolute; border-radius: 50%; filter: blur(clamp(55px, 8vw, 115px)); animation: drift 26s ease-in-out infinite alternate; }
.glow-wine  { width: clamp(300px, 48vw, 760px); height: clamp(360px, 60vw, 850px); top: -12%; right: -14%; background: #6e2a31; opacity: .32; }
.glow-red   { width: clamp(260px, 42vw, 620px); height: clamp(290px, 44vw, 650px); bottom: -18%; left: -16%; background: #7c2b30; opacity: .26; animation-delay: -12s; animation-duration: 32s; animation-direction: alternate-reverse; }
.glow-blush { width: clamp(260px, 38vw, 600px); height: clamp(300px, 40vw, 640px); top: 40%; right: 38%; background: #8c4b51; opacity: .2; animation-delay: -7s; animation-duration: 22s; }
@keyframes drift {
  0%   { transform: translate3d(-5%, -5%, 0) rotate(-12deg) scale(1); }
  50%  { transform: translate3d(12%, 8%, 0) rotate(12deg) scale(1.12); }
  100% { transform: translate3d(-9%, 18%, 0) rotate(-8deg) scale(.96); }
}

/* ---------- Art wall ---------- */
.wall { --p: 0; --card-w: 44vw; --deep-w: 34vw; position: relative; height: 260vh; }
.wall-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
/* Top and bottom edges fade out, so pieces never start or end at a line. */
.wall-cards {
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10vh, #000 calc(100% - 22vh), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10vh, #000 calc(100% - 22vh), transparent);
}
.wall-card {
  position: absolute; top: 0;
  left: calc(var(--x) * (100% - var(--card-w)));
  width: var(--card-w);
  padding: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: var(--card);
  box-shadow: 0 22px 48px rgb(0 0 0 / 50%);
  cursor: zoom-in;
  transform: translate3d(0, calc((var(--y0) - var(--p) * var(--speed)) * 1vh), 0) rotate(var(--rot));
  will-change: transform;
}
.wall-card img { display: block; width: 100%; height: auto; transition: filter .3s; }
.wall-card:hover img { filter: brightness(1.12); }
.wall-card:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
/* Deep pieces: smaller, faded and soft-focused, for depth. */
.wall-card.is-deep { left: calc(var(--x) * (100% - var(--deep-w))); width: var(--deep-w); opacity: .45; filter: blur(2px); box-shadow: none; }

/* Phone grid (script.js): square cards so the rows line up. */
.wall.layout-grid .wall-card img { aspect-ratio: 1 / 1; object-fit: cover; }
.wall.layout-grid .wall-card { border-radius: 10px; }

/* ---------- Hero: who she is (first screen) ---------- */
/* Editorial: her name very large on the left, her photo tilted on the right with one of her
   pieces overlapping it. Phones: photo on top, then the name and bio, all left-aligned. */
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column-reverse; justify-content: center;
  gap: 40px; padding: 48px 24px 96px;
}

/* Faint pieces of her work behind everything: blurred, tilted, fading into the background. */
.hero-ghosts { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
/* Each fades in, then floats very slowly: a few pixels and a hint of turn, each on its own rhythm.
   The float uses `translate`/`rotate`, so it adds to each piece's fixed tilt in `transform`. */
.ghost { position: absolute; width: clamp(120px, 20vw, 300px); border-radius: 14px; opacity: 0; filter: blur(3px) saturate(.7);
  animation: ghost-in 1.6s ease-out .6s forwards, float 8.5s ease-in-out 0s infinite alternate; }
.ghost-1 { top: 6%;  left: 4%;  transform: rotate(-8deg); }
.ghost-2 { top: 10%; right: 3%; transform: rotate(7deg); animation-delay: .8s, -4s; animation-duration: 1.6s, 10s; }
.ghost-3 { bottom: 4%; left: 12%; transform: rotate(5deg); width: clamp(100px, 15vw, 230px); animation-delay: 1s, -8s; animation-duration: 1.6s, 7s; }
@keyframes ghost-in { to { opacity: .16; } }
@keyframes float {
  from { translate: 0 0; rotate: 0deg; }
  to   { translate: 10px -18px; rotate: 2deg; }
}

/* Entrance: the name lines slide in, the photo and piece rise, then the bio. */
.hero-first { animation: in-left .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-last  { animation: in-left .9s cubic-bezier(.2,.7,.2,1) .12s both; }
.hero-photo { animation: in-up 1s cubic-bezier(.2,.7,.2,1) .15s both; }
.hero-piece { animation: in-up 1s cubic-bezier(.2,.7,.2,1) .35s both; }
.hero-bio   { animation: in-up .9s ease-out .5s both; }
.hero-arrow { animation: fade-in .8s ease-out 1s both; }
@keyframes in-left  { from { opacity: 0; transform: translateX(-60px); } }
@keyframes in-up    { from { opacity: 0; translate: 0 24px; } }
@keyframes fade-in  { from { opacity: 0; } }

.hero-name { font-size: clamp(44px, 14vw, 150px); line-height: .92; letter-spacing: -.03em; }
.hero-name span, .hero-name em { display: block; }
.hero-last { color: var(--rose); }
.hero-quote { margin: 24px 0 0; max-width: 480px; }
.hero-bio { margin: 0; max-width: 480px; font-style: italic; color: #d9cbc9; font-family: var(--sans); font-size: 16px; line-height: 1.75; }

/* Photo tilted one way, the piece tilted the other, overlapping its lower corner. */
.hero-visual { position: relative; align-self: center; width: min(78vw, 360px); aspect-ratio: 1 / 1; }
.hero-photo, .hero-piece {
  position: absolute; object-fit: cover; border-radius: 6px;
  box-shadow: 0 30px 70px rgb(0 0 0 / 55%);
}
/* 22% keeps her face centred and crops the photo's date stamp (bottom right) out. */

.hero-photo { left: 0; top: 0; width: 72%; aspect-ratio: 4 / 5; object-position: 22% 50%; transform: rotate(-4deg); }
/* The Buddha photo shows the wall around the painting; as a background, sized and positioned, it shows
   just the black square (works in every browser, unlike object-view-box, which Safari ignores). */
.hero-piece { right: 0; bottom: 0; width: 50%; aspect-ratio: 511 / 451; transform: rotate(6deg); outline: 1px solid rgb(196 106 111 / 35%);
  background: #000 url("images/buddha.jpg") 58% 56.6% / 141% 133% no-repeat; }

.hero-arrow {
  position: absolute; left: 0; right: 0; bottom: 20px; margin: 0 auto; width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--sans); font-weight: 500; font-size: 14px; letter-spacing: .02em;
  color: var(--rose); text-decoration: none;  /* same red as "Bahramvand." */
}
.hero-arrow svg { display: block; color: var(--rose); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- Footer ---------- */
/* Transparent: it sits on the same page-wide glow as the wall, so there is no edge between them. */
.footer { padding: 40px 20px 48px; text-align: center; color: var(--muted); font-size: 14px; }
.footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 28px; }
.footer a { color: var(--foreground); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.footer a:hover { color: var(--accent-light); }
.footer p { margin: 20px 0 0; font-size: 13px; opacity: .7; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgb(12 6 7 / 94%); cursor: zoom-out; animation: fade .2s ease-out; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { display: block; max-width: min(92vw, 1100px); max-height: 82vh; border-radius: 8px; box-shadow: 0 20px 80px #000; cursor: default; }
.lightbox figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .wall { --card-w: 290px; --deep-w: 230px; height: 280vh; }
  /* Desktop: text left, photo and piece right, side by side. */
  .hero { flex-direction: row; align-items: center; justify-content: space-between; gap: 4vw; padding: 64px clamp(40px, 7vw, 140px) 96px; }
  .hero-name { font-size: clamp(64px, 8vw, 170px); }
  .hero-text { flex: 1 1 auto; min-width: 0; }
  .hero-bio { font-size: clamp(17px, 1.2vw, 21px); }
  .hero-visual { width: clamp(320px, 30vw, 580px); flex-shrink: 0; }
}
@media (max-width: 899px) {
  .glow span { filter: blur(50px); animation: none; }

  /* Phones: the first screen is exactly one screen tall. The text keeps its size and the photo
     pair takes whatever height is left (square, never taller than wide), so nothing spills below. */
  /* Room for the notch/status bar on top and for the home bar and Safari's floating toolbar at the
     bottom (env() values need viewport-fit=cover in index.html). The photo pair is capped at about a
     third of the screen height, so the text sits nearer the middle instead of being pushed down. */
  .hero { height: 100vh; height: 100svh; min-height: 540px; justify-content: center; gap: 22px;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(104px + env(safe-area-inset-bottom)); }
  .hero-visual { flex: none; width: min(66vw, 300px, 32svh); }
  .hero-arrow { bottom: calc(44px + env(safe-area-inset-bottom)); }
  .hero-name { font-size: clamp(40px, 13vw, 72px); }
  .hero-quote { margin-top: 16px; }
  .hero-bio { font-size: 14px; line-height: 1.6; }


}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glow span, .hero-arrow svg, .hero-first, .hero-last, .hero-photo, .hero-piece, .hero-bio, .hero-arrow { animation: none; }
  .ghost { animation: none; opacity: .16; }
}
