/* ============================================================
   Explorations — weekly experiments
   Builds on styles.css tokens (paper, ink, wash, Syne/Outfit/Instrument Serif).
   One long scroll: intro → index → five cases with identical structure.
   ============================================================ */

.ex-page {
  --ex-gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ex-max: 1240px;
  --ex-media-bg: #ece5dc;
}

.ex-page main > * {
  width: min(100%, calc(var(--ex-max) + var(--ex-gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--ex-gutter);
}

.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- intro ---------- */

.ex-intro {
  padding-top: calc(var(--head-h) + clamp(2.5rem, 7vw, 5.5rem));
  padding-bottom: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

.ex-intro h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.ex-intro h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--wash-deep);
  letter-spacing: 0;
}

.ex-intro-copy {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  max-width: 64rem;
}

.ex-note {
  display: grid;
  gap: 0.55rem;
  max-width: 70ch;
}

.ex-note-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--wash-deep);
}

.ex-note p:not(.ex-note-label) {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.ex-lede {
  margin: 0;
  max-width: 50ch;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
}

.ex-fiction-tag {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border: 1px solid rgba(46, 77, 94, 0.35);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wash-deep);
  white-space: nowrap;
  line-height: 1.5;
}

/* ---------- case (identical structure for every project) ---------- */

.ex-case {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--head-h);
}

.ex-case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.ex-case-head > div { min-width: 0; }

.ex-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

.ex-case h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.05;
  max-width: 22ch;
  text-wrap: balance;
}

.ex-client {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.ex-case-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.72fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  padding-top: 0.5rem;
}

.ex-case-body h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 0.7rem;
}

.ex-case-body p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
}

.ex-facts {
  display: grid;
  gap: 0;
  margin: 0;
  align-content: start;
  border-top: 1px solid var(--line);
}

.ex-facts div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.ex-facts dt { font-size: 0.82rem; color: var(--mute); }
.ex-facts dd { margin: 0; font-size: 0.92rem; color: var(--ink); }

/* ---------- media: film ---------- */

.ex-film,
.ex-still {
  position: relative;
  margin: 0;
  border-radius: 1.1rem;
  overflow: hidden;
  background: var(--ex-media-bg);
}

.ex-film video,
.ex-still img {
  display: block;
  width: 100%;
  height: auto;
}

.ex-film video { aspect-ratio: 16 / 9; }

.ex-sound {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1.25rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem 0.6rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 40, 48, 0.86);
  color: var(--cream);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 420;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.ex-sound:hover { background: var(--ink); transform: translateY(-1px); }
.ex-sound svg { width: 0.95rem; height: 0.95rem; }
.ex-sound-time { opacity: 0.6; font-variant-numeric: tabular-nums; }
.ex-film.is-playing .ex-sound { display: none; }

.ex-film video::cue {
  font-family: var(--sans);
  font-size: 0.95rem;
  background: rgba(24, 40, 48, 0.78);
  color: #fdfaf3;
}

/* ---------- media: slides ---------- */

.ex-slides { display: grid; gap: 0.9rem; }

.ex-slides-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: 1.1rem;
}

.ex-slides-track::-webkit-scrollbar { display: none; }

.ex-slides-track img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  scroll-snap-align: start;
  border-radius: 1.1rem;
  background: var(--ex-media-bg);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ex-slides-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ex-slides-count {
  font-size: 0.85rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
}

.ex-slides-nav { display: flex; gap: 0.5rem; }

.ex-slides-nav button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(24, 40, 48, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.ex-slides-nav button:hover:not(:disabled) { background: var(--ink); color: var(--cream); }
.ex-slides-nav button:disabled { opacity: 0.35; cursor: default; }
.ex-slides-bar .link-line { margin-left: auto; font-size: 0.9rem; }

/* ---------- media: website ---------- */

.ex-site {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.ex-browser {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #0a111e;
  text-decoration: none;
  box-shadow: 0 30px 60px -36px rgba(10, 17, 30, 0.55);
}

.ex-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.9rem;
  background: #e9e4dc;
}

.ex-browser-dots { display: flex; gap: 0.35rem; }
.ex-browser-dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: rgba(24, 40, 48, 0.2); display: block; }

.ex-browser-url {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 0.4rem;
  background: var(--cream);
  font-size: 0.75rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-browser-view {
  position: relative;
  flex: 1;
  min-height: 20rem;
  overflow: hidden;
}

.ex-browser-view img {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: auto;
  transform: translateY(0);
  transition: transform 9s cubic-bezier(0.45, 0, 0.25, 1);
}

.ex-browser:hover .ex-browser-view img,
.ex-browser:focus-visible .ex-browser-view img {
  transform: translateY(var(--browser-shift, 0px));
}

.ex-site-side { display: grid; gap: 1rem; align-content: start; }
.ex-still-light { background: #edf1f5; }

.ex-site-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.ex-site-cta span { font-size: 0.88rem; color: var(--ink-2); }

/* ---------- footer ---------- */

.ex-footer .ex-footer-note {
  margin: 0;
  max-width: 62ch;
  font-size: 0.8rem;
  color: var(--ink-2);
  text-align: right;
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .ex-intro-copy { grid-template-columns: 1fr; }
  .ex-case-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ex-facts { grid-column: 1 / -1; }
  .ex-site { grid-template-columns: 1fr; }
  .ex-browser-view { min-height: 0; aspect-ratio: 16 / 11; flex: none; }
  .ex-site-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .ex-case-body { grid-template-columns: 1fr; gap: 1.6rem; }
  .ex-case-head { align-items: flex-start; flex-direction: column; }
  .ex-site-side { grid-template-columns: 1fr; }
  .ex-sound { font-size: 0.8rem; padding: 0.5rem 0.85rem 0.5rem 0.7rem; }
  .ex-slides-bar .link-line { margin-left: 0; }
  .ex-footer .ex-footer-note { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .ex-browser-view img { transition: none; }
}

/* Touch screens have no hover: let the website preview scroll by swiping. */
@media (hover: none) {
  .ex-browser-view { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .ex-browser-view img { position: static; transform: none !important; transition: none; }
}

/* Centred intro, matching the home page hero. Left-aligned again on phones. */
.ex-intro { justify-items: center; text-align: center; }
.ex-intro-copy { justify-items: center; margin-inline: auto; }
.ex-lede { margin-inline: auto; }
.ex-note { justify-items: center; margin-inline: auto; }

@media (max-width: 720px) {
  .ex-intro, .ex-intro-copy, .ex-note { justify-items: start; text-align: left; }
  .ex-intro-copy, .ex-lede, .ex-note { margin-inline: 0; }
}

/* Keep the small note narrower than the intro above it. */
.ex-note { max-width: 34rem; }
