/*
  NOTTE — Diego Hurtado, alternate design 3

  Thesis: the portfolio as a European art-house film (Fellini and Antonioni
  title cards, Sorrentino's Rome at night, Almodóvar's saturated colour).
  Four acts, each opened by a carmine title card that irises open, and a
  closing-titles request form that ends on "Fine".

  Palette (warm darkness, never neutral black):
    --ground  #130d0b  umber-black, every surface
    --mat     #1c1411  one step up: mats behind prints, image placeholders
    --cream   #efe3cf  primary type
    --taupe   #a8998a  secondary type (~6.9:1 on ground)
    --quiet   #8f8173  tertiary type, the text floor (~4.9:1)
    --line    #3d2f28  hairlines only, never text
    --rosso   #a8221b  carmine: act title cards and the request path (cream on it ~5.9:1)
    --ochre   #c8902f  ornaments only: frame numbers, rules, focus

  Type:
    Italiana: roman display for act titles, set large and alone.
    Cormorant Garamond: italic for the name, secondary lines and "The End"; roman for running text.
    Cormorant SC (500/600): small caps for every label, nav item and caption.

  Motion: warm fade up from black, iris (circle clip) on act cards, a slow
  fade-from-dark plus Ken Burns settle on stills. Nothing animates under
  prefers-reduced-motion.
*/

:root {
  --ground: #130d0b;
  --mat: #1c1411;
  --cream: #efe3cf;
  --taupe: #a8998a;
  --quiet: #8f8173;
  --line: #3d2f28;
  --rosso: #a8221b;
  --rosso-deep: #861a14;
  --ochre: #c8902f;
  --ember: #e58c74;

  --display: "Italiana", "Didot", serif;
  --serif: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --caps: "Cormorant SC", "Cormorant Garamond", "Garamond", serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --bar: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--rosso); color: var(--cream); }
:focus-visible { outline: 1px solid var(--ochre); outline-offset: 4px; }

.skip {
  position: fixed; left: var(--gutter); top: 0.75rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--cream); color: var(--ground);
  font-family: var(--caps); letter-spacing: 0.12em; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.label, .bar__acts a, .bar__menu, .bar__request {
  font-family: var(--caps);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

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

.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  transition: background-color 0.8s var(--ease), border-color 0.8s var(--ease);
  border-bottom: 1px solid transparent;
}
.bar.is-solid { background: rgba(19, 13, 11, 0.94); border-bottom-color: var(--line); }
.bar__name {
  justify-self: start;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.45rem; text-decoration: none; letter-spacing: 0.01em;
}
.bar__acts { display: flex; gap: clamp(1.25rem, 2.6vw, 2.5rem); }
.bar__acts a {
  font-size: 1.05rem; color: var(--taupe); text-decoration: none;
  transition: color 0.4s var(--ease);
}
.bar__acts a .num { color: var(--ochre); margin-right: 0.45em; font-family: var(--display); letter-spacing: 0.04em; text-transform: none; }
.bar__acts a:hover, .bar__acts a[aria-current="true"] { color: var(--cream); }
.bar__end { justify-self: end; display: flex; align-items: center; gap: 1.25rem; }
.bar__menu { display: none; background: none; border: 0; padding: 0.5rem 0; font-size: 1.05rem; color: var(--taupe); cursor: pointer; }
.bar__request {
  display: inline-block; padding: 0.55rem 1.1rem 0.6rem;
  background: var(--rosso); color: var(--cream);
  font-size: 1.05rem; text-decoration: none;
  transition: background-color 0.4s var(--ease);
}
.bar__request:hover { background: var(--rosso-deep); }

/* ---------- opening ---------- */

.open {
  position: relative; min-height: 100svh;
  display: grid; place-items: end center;
  padding: var(--bar) var(--gutter) clamp(4.5rem, 12svh, 8rem);
  overflow: hidden; isolation: isolate;
}
.open__iris {
  position: absolute; inset: 0; z-index: -2;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 44%, #000 42%, transparent 100%);
          mask-image: radial-gradient(ellipse 62% 70% at 50% 44%, #000 42%, transparent 100%);
}
.open__iris img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 2.4s var(--ease);
  filter: sepia(0.18) saturate(1.05) brightness(0.82);
}
.open__iris img.is-on { opacity: 1; animation: kenburns 11s linear both; }
@keyframes kenburns { from { transform: scale(1.1); } to { transform: scale(1); } }
.open::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(19, 13, 11, 0.96) 0%, rgba(19, 13, 11, 0.78) 30%, rgba(19, 13, 11, 0.35) 52%, transparent 72%);
}
.open__titles { text-align: center; max-width: 100%; }
.open__over, .open__under {
  margin: 0; font-family: var(--caps); font-weight: 500; text-transform: lowercase;
  letter-spacing: 0.26em; font-size: clamp(0.95rem, 1.4vw, 1.15rem); color: var(--taupe);
}
.open__over { color: var(--cream); opacity: 0.85; text-shadow: 0 1px 12px rgba(19, 13, 11, 0.6); }
.open__under span[aria-hidden] { color: var(--ochre); margin: 0 0.35em; }
.open__name {
  margin: 0.15em 0 0.12em;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(3.4rem, 12.5vw, 11.5rem); line-height: 0.9; letter-spacing: -0.02em;
  text-wrap: balance;
}
.open__cue {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); margin: 0;
  font-family: var(--caps); text-transform: lowercase; letter-spacing: 0.3em; font-size: 0.95rem; color: var(--quiet);
}
.open__fade { position: absolute; inset: 0; z-index: 5; background: var(--ground); pointer-events: none; opacity: 0; }

/* ---------- acts ---------- */

.act { padding-bottom: clamp(5rem, 12vw, 10rem); }

.card {
  min-height: 100svh; display: grid; place-items: center;
  padding: calc(var(--bar) + 2rem) var(--gutter) 3rem;
}
.card__plate {
  width: min(100%, 64rem); min-height: min(72svh, 44rem);
  background: var(--rosso); color: var(--cream);
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center; text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 4rem);
  position: relative;
}
.card__plate::before {
  content: ""; position: absolute; inset: clamp(0.6rem, 1.2vw, 1rem);
  border: 1px solid rgba(239, 227, 207, 0.35); pointer-events: none;
}
.card__act {
  margin: 0; font-family: var(--caps); font-weight: 600; text-transform: lowercase;
  letter-spacing: 0.32em; font-size: clamp(0.95rem, 1.5vw, 1.15rem);
}
.card__mid { align-self: center; padding: 2rem 0; }
.card__title {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 10.5vw, 9.5rem); line-height: 0.95; letter-spacing: 0.01em;
  text-wrap: balance;
}
.card__line {
  margin: 0; max-width: 40ch; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.5;
  text-wrap: balance;
}

.reel {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 2vw, 2rem);
  row-gap: clamp(5rem, 13vw, 11rem);
  padding: clamp(3rem, 8vw, 6rem) 0 0;
}
.still { margin: 0; min-width: 0; }
.still--full { grid-column: 1 / -1; }
.still--wide { grid-column: 2 / 12; }
.still--left { grid-column: 2 / 9; }
.still--right { grid-column: 5 / 12; }
.pair { grid-column: 2 / 12; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 3rem); align-items: start; }
.pair .still:nth-child(2) { margin-top: 18%; }

.still__open {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.still--left .still__open, .still--right .still__open {
  background: var(--mat); padding: clamp(1rem, 3.5vw, 3.25rem);
}
.still__frame { position: relative; overflow: hidden; background: var(--mat); }
.still__frame img { width: 100%; height: auto; transition: transform 1.6s var(--ease); }
.still--full .still__frame img { max-height: 100svh; object-fit: cover; }
.still__open:hover .still__frame img { transform: scale(1.02); }
.still__shade { position: absolute; inset: 0; background: var(--ground); opacity: 0; pointer-events: none; }

.still figcaption {
  display: flex; gap: 1rem; align-items: baseline; margin-top: 0.9rem;
  font-family: var(--caps); font-weight: 500; text-transform: lowercase; letter-spacing: 0.16em;
  font-size: 0.98rem; color: var(--quiet);
}
.still--full figcaption { padding: 0 var(--gutter); }
.still__no { color: var(--ochre); font-family: var(--display); letter-spacing: 0.08em; text-transform: none; }
.still__cap { color: var(--taupe); }

/* ---------- coda / request ---------- */

.coda { padding: clamp(6rem, 14vw, 12rem) var(--gutter) 2.5rem; border-top: 1px solid var(--line); }
.coda__kicker {
  margin: 0 auto 3.5rem; text-align: center; font-family: var(--caps); text-transform: lowercase;
  letter-spacing: 0.32em; font-size: 1.05rem; color: var(--ochre);
}
.coda__credits { margin: 0 auto; max-width: 48rem; }
.coda__credits div { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; padding: 0.45rem 0; }
.coda__credits dt {
  text-align: right; font-family: var(--caps); font-weight: 500; text-transform: lowercase;
  letter-spacing: 0.18em; color: var(--taupe); font-size: 1.02rem; padding-top: 0.2rem;
}
.coda__credits dd { margin: 0; font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.35; }
.coda__open { font-style: italic; color: var(--cream); }
.coda__open::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; background: var(--rosso); margin-right: 0.6em; vertical-align: 0.1em; }

.request { max-width: 62rem; margin: clamp(7rem, 15vw, 12rem) auto 0; }
.request__title {
  margin: 0; text-align: center; font-family: var(--display); font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 6.5rem); line-height: 1;
}
.request__lede {
  margin: 1.25rem auto 4rem; max-width: 40ch; text-align: center;
  font-style: italic; font-size: clamp(1.2rem, 1.8vw, 1.4rem); color: var(--taupe); text-wrap: balance;
}
.request__form { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 3rem; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field--wide, .request__send { grid-column: 1 / -1; }
.field label {
  font-family: var(--caps); font-weight: 500; text-transform: lowercase; letter-spacing: 0.18em;
  font-size: 1rem; color: var(--taupe); margin-bottom: 0.35rem;
}
.field__opt { color: var(--quiet); font-style: italic; font-family: var(--serif); text-transform: none; letter-spacing: 0; margin-left: 0.4em; }
.field input, .field select, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  color: var(--cream); font-family: var(--serif); font-size: 1.4rem; padding: 0.3rem 0 0.55rem;
  transition: border-color 0.4s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 7rem; line-height: 1.45; }
.field select {
  cursor: pointer; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8998a' stroke-width='1.3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.1rem center; background-size: 1.1rem;
}
.field select option { background: var(--mat); color: var(--cream); }
.field ::placeholder { color: var(--quiet); font-style: italic; }
.field input:hover, .field select:hover, .field textarea:hover { border-bottom-color: var(--quiet); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ochre); }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: var(--ember); }
.field__error { margin: 0.5rem 0 0; color: var(--ember); font-size: 1.05rem; font-style: italic; }
.request__send { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; margin-top: 0.5rem; }
.btn-request {
  background: var(--rosso); color: var(--cream); border: 1px solid var(--rosso); border-radius: 0; cursor: pointer;
  padding: 1.05rem 2.6rem 1.15rem;
  font-family: var(--caps); font-weight: 600; text-transform: lowercase; letter-spacing: 0.2em; font-size: 1.12rem;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.btn-request:hover { background: transparent; color: var(--cream); }
.btn-request:active { transform: translateY(1px); }
.request__note { margin: 0; max-width: 44ch; color: var(--taupe); font-size: 1.05rem; flex: 1 1 18rem; }
.request__note a { color: var(--cream); text-decoration-color: var(--ochre); text-underline-offset: 0.2em; }
.request__note.is-sent { color: var(--cream); font-style: italic; border-left: 2px solid var(--ochre); padding-left: 1rem; }

.end { margin-top: clamp(8rem, 18vw, 14rem); text-align: center; }
.end__fine {
  margin: 0 0 3rem; font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(4.5rem, 14vw, 11rem); line-height: 1; color: var(--cream);
}
.end__small { margin: 0.4rem 0; font-family: var(--caps); text-transform: lowercase; letter-spacing: 0.18em; font-size: 0.95rem; color: var(--quiet); }

/* ---------- viewer ---------- */

.viewer {
  overflow: hidden;
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--ground); color: var(--cream);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.viewer[open] { display: grid; }
.viewer::backdrop { background: var(--ground); }
.viewer__frame { min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.5rem) 0; }
.viewer__img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; min-height: 0; object-fit: contain; }
.viewer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.5rem) 1.25rem;
}
.viewer__caption {
  margin: 0; font-family: var(--caps); text-transform: lowercase; letter-spacing: 0.16em; font-size: 1rem; color: var(--taupe);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer__count { color: var(--ochre); font-family: var(--display); letter-spacing: 0.08em; margin-right: 0.8em; text-transform: none; }
.viewer__controls { display: flex; gap: 0.5rem; flex: none; }
.viewer__btn {
  width: 3rem; height: 3rem; display: grid; place-items: center; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 0; transition: border-color 0.3s var(--ease);
}
.viewer__btn:hover { border-color: var(--cream); }
.viewer__btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--cream); stroke-width: 1.4; }

/* ---------- atmosphere ---------- */

.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 29; pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 50%, transparent 60%, rgba(10, 5, 3, 0.45) 100%);
}
.noscript { padding: 6rem var(--gutter); text-align: center; color: var(--taupe); }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  :root { --bar: 4rem; }
  .bar { grid-template-columns: 1fr auto; }
  .bar__name { font-size: 1.3rem; }
  .bar__menu { display: block; }
  .bar__acts {
    position: fixed; inset: 0; z-index: -1; background: var(--ground);
    flex-direction: column; justify-content: center; align-items: center; gap: 1.6rem;
    visibility: hidden; opacity: 0; transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
  }
  .bar__acts.is-open { visibility: visible; opacity: 1; transition: opacity 0.5s var(--ease); }
  .bar__acts a { font-family: var(--display); text-transform: none; letter-spacing: 0.01em; font-size: 2.6rem; color: var(--cream); text-align: center; }
  .bar__acts a .num { display: block; font-size: 1rem; letter-spacing: 0.3em; margin: 0 0 0.2rem; }
  .bar__long { display: none; }
  .bar__request { padding: 0.45rem 0.9rem 0.5rem; }

  .open__under { font-size: 0.85rem; letter-spacing: 0.14em; }
  .open__under span[aria-hidden] { margin: 0 0.15em; }
  .open__iris {
    -webkit-mask-image: radial-gradient(ellipse 95% 62% at 50% 40%, #000 40%, transparent 100%);
            mask-image: radial-gradient(ellipse 95% 62% at 50% 40%, #000 40%, transparent 100%);
  }

  .reel { padding-left: var(--gutter); padding-right: var(--gutter); row-gap: 4.5rem; }
  .still--full { margin: 0 calc(-1 * var(--gutter)); }
  .still--wide, .still--left, .still--right, .pair { grid-column: 1 / -1; }
  .still--left .still__open, .still--right .still__open { padding: 0.9rem; }
  .pair { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .pair .still:nth-child(2) { margin-top: 30%; }
  .still figcaption { font-size: 0.9rem; letter-spacing: 0.1em; gap: 0.6rem; flex-wrap: wrap; }

  .card__plate { min-height: 70svh; }

  .coda__credits div { grid-template-columns: 1fr; gap: 0.1rem; text-align: center; padding: 0.7rem 0; }
  .coda__credits dt { text-align: center; }
  .request__form { grid-template-columns: 1fr; gap: 2rem; }
  .btn-request { width: 100%; }
  .viewer__caption { font-size: 0.9rem; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .grain { display: none; }
}
