/* ==========================================================================
   Rachel Tauwnaar — Music Creative
   ========================================================================== */

@font-face {
  font-family: "Druk Wide";
  src: url("../fonts/druk-wide-bold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin-var.woff2") format("woff2-variations"),
       url("../fonts/montserrat-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --bg-soft: #111;
  --fg: #f8f8f8;
  --fg-muted: rgba(248, 248, 248, 0.62);
  --line: rgba(248, 248, 248, 0.16);

  --font-display: "Druk Wide", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1180px;
  --nav-h: 64px;
  /* Type scale: three sizes only */
  --fs-l: clamp(22px, 3vw, 34px);      /* section and project headings */
  --fs-text: 15px;                     /* everything else */

  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --dur: 700ms;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, video, iframe { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color 400ms ease, backdrop-filter 400ms ease;
}

.nav.is-solid {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 400ms ease;
}

/* On the home page the logo only fades in once the hero title has scrolled away. */
.nav--home:not(.is-solid) .nav__logo { opacity: 0; pointer-events: none; }

.nav__links {
  display: flex;
  gap: clamp(18px, 4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 0.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 450ms var(--ease-out);
}

.nav__links a:hover::after,
.nav__links a[aria-current="true"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0a0a0a;
}

.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Opening screen: 1-to-1 with the Readymag design, which scales with the
   screen width (1024px wide on desktop, 320px wide on phones). */
.hero {
  --u: calc(100vw / 1024);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
  pointer-events: none;
}

.hero__content {
  position: absolute;
  z-index: 1;
  left: calc(-19 * var(--u)); /* Readymag centres this block at x=502 of 1024 */
  right: 0;
  top: calc(50% - 56 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
  text-align: center;
  animation: hero-in 1.2s var(--ease-out) both;
}

.hero__title {
  font-size: calc(35 * var(--u));
  line-height: calc(39 * var(--u));
  letter-spacing: 0;
}

.hero__subtitle {
  font-size: calc(12 * var(--u));
  line-height: calc(14 * var(--u));
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .hero {
    --u: calc(100vw / 320);
  }

  .hero__content {
    left: 0;
    top: calc(345 * var(--u));
    gap: calc(11 * var(--u));
  }

  .hero__title {
    font-size: calc(33 * var(--u));
    line-height: calc(40 * var(--u));
  }

  /* As in Readymag: the tighter spacing only applies to "RACHEL TAU" */
  .hero__tight {
    letter-spacing: calc(-2 * var(--u));
  }
}

.hero__scroll {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 28px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  display: grid;
  place-items: center;
  animation: hero-in 1.2s 0.5s var(--ease-out) both;
}

.hero__scroll span {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--fg));
  animation: scroll-cue 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes scroll-cue {
  0%   { transform: scaleY(0); opacity: 0; }
  30%  { opacity: 1; }
  60%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

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

.section {
  padding-block: clamp(80px, 12vw, 160px);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section__title {
  font-size: var(--fs-l);
}

/* ---------- Work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card { position: relative; }

.card__link { display: block; }

.card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-soft);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 1.1s var(--ease-out), filter 600ms ease;
}

.card__play {
  position: absolute;
  inset: auto auto 16px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: var(--fs-text);
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 500ms var(--ease-out);
}

.card__play svg { width: 10px; height: 10px; }

.card__text { padding-top: 14px; }

.card__client,
.card__title {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-text);
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__title { color: var(--fg-muted); transition: color 400ms ease; }

@media (hover: hover) {
  .card__link:hover .card__media img { transform: scale(1.045); }
  .card__link:hover .card__play { opacity: 1; transform: none; }
  .card__link:hover .card__title { color: var(--fg); }
}
.card__link:focus-visible .card__play { opacity: 1; transform: none; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.about__portrait {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-soft);
}

.about__portrait img { width: 100%; height: 100%; object-fit: cover; }

.about__name {
  font-size: var(--fs-l);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.about__intro p {
  margin: 0 0 1.1em;
  max-width: 36em;
  font-size: var(--fs-text);
  color: rgba(248, 248, 248, 0.86);
}

.about__intro p:first-child {
  font-size: var(--fs-text);
  color: var(--fg);
}

.lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}

.lists h3 {
  font-size: var(--fs-l);
  margin-bottom: 16px;
}

.lists ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-text);
  line-height: 2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.lists li.more { color: var(--fg); margin-top: 6px; }

/* ---------- Contact ---------- */

.contact {
  text-align: center;
  border-top: 1px solid var(--line);
}

.contact__title {
  font-size: var(--fs-l);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.contact__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__list a {
  display: inline-block;
  padding: 1px 2px;
  font-size: var(--fs-text);
  font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 500ms var(--ease-out), color 300ms ease;
}

.contact__list a:hover { background-size: 100% 1px; }

.contact__list .contact__primary a {
  font-size: var(--fs-text);
  font-weight: 600;
}

/* The e-mail address sits on the centre line like the rows below it;
   the copy button hangs just to its right */
.contact__primary { position: relative; }

.copy {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 0 0 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font: 500 var(--fs-text)/1 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 250ms ease, border-color 250ms ease;
}
.copy:hover { color: var(--fg); border-color: var(--fg-muted); }

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

.footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: var(--fs-text);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.footer a:hover { color: var(--fg); }

/* ---------- Project page ---------- */

.project {
  padding-top: calc(var(--nav-h) + clamp(24px, 5vw, 56px));
  padding-bottom: clamp(64px, 10vw, 120px);
}

.project__head { margin-bottom: clamp(20px, 3vw, 32px); }

.project__client {
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.project__title { font-size: var(--fs-l); }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}

.player__poster,
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player__poster { object-fit: cover; transition: transform 1.2s var(--ease-out), opacity 500ms ease; }

.player__button {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0.05) 50%);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  z-index: 2;
}

.player__icon {
  display: grid;
  place-items: center;
  width: clamp(64px, 8vw, 88px);
  height: clamp(64px, 8vw, 88px);
  border-radius: 50%;
  background: rgba(248, 248, 248, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(248, 248, 248, 0.4);
  transition: transform 500ms var(--ease-out), background-color 300ms ease;
}

.player__icon svg { width: 26%; height: 26%; margin-left: 6%; }

.player__label {
  position: absolute;
  left: 20px;
  bottom: 16px;
  font-size: var(--fs-text);
  letter-spacing: 0.03em;
  color: rgba(248, 248, 248, 0.85);
}

.player__button:hover .player__icon,
.player__button:focus-visible .player__icon { transform: scale(1.08); background: rgba(248, 248, 248, 0.24); }
.player:hover .player__poster { transform: scale(1.02); }

.player.is-playing .player__button,
.player.is-playing .player__poster { opacity: 0; pointer-events: none; }

/* Credits: as in the Readymag version, compact "Label: Value" lines that
   scale with the screen width (1024px wide on desktop, 320px on phones). */
.credits {
  --u: calc(100vw / 1024);
  margin: calc(24 * var(--u)) 0 0;
  padding: 0;
  font-family: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: calc(9 * var(--u));
  line-height: calc(12 * var(--u));
  font-weight: 400;
  color: var(--fg);
}

.credits div { display: block; }

.credits dt,
.credits dd {
  display: inline;
  margin: 0;
}

.credits dt::after { content: ": "; }

@media (max-width: 640px) {
  .credits {
    --u: calc(100vw / 320);
    margin-top: calc(6 * var(--u));
  }
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 40px);
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--line);
}

.pager a { display: block; }

.pager__dir {
  display: block;
  margin-bottom: 12px;
  font-size: var(--fs-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 300ms ease;
}

.pager__next { text-align: right; }

.pager .card__media { aspect-ratio: 16 / 9; margin-bottom: 12px; }

.pager a:hover .pager__dir { color: var(--fg); }
@media (hover: hover) {
  .pager a:hover .card__media img { transform: scale(1.045); }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(40px, 6vw, 64px);
  font-size: var(--fs-text);
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 300ms ease, gap 400ms var(--ease-out);
}
.back-link:hover { color: var(--fg); gap: 12px; }

.kbd-hint {
  margin-top: 12px;
  font-size: var(--fs-text);
  color: rgba(248, 248, 248, 0.4);
}
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- 404 ---------- */

.notfound {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--gutter);
}
.notfound p { color: var(--fg-muted); }
.notfound a { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Page transitions (Chrome, Edge, Safari 18.2+) ---------- */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 450ms;
  animation-timing-function: var(--ease-out);
}

::view-transition-group(*) {
  animation-duration: 550ms;
  animation-timing-function: var(--ease-out);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait { max-width: 420px; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .nav__inner { gap: 12px; }
  .nav__links { gap: 16px; }
  .nav__links a { letter-spacing: 0.02em; }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .card__play { opacity: 1; transform: none; }
  .pager .card__media { display: none; }
  /* Previous/next labels and titles at the Readymag phone size (9px on a 320px artboard) */
  .pager { --u: calc(100vw / 320); }
  .pager__dir {
    margin-bottom: calc(8 * var(--u));
    font-size: calc(9 * var(--u));
    line-height: calc(12 * var(--u));
  }
  .pager .card__client,
  .pager .card__title {
    font-size: calc(9 * var(--u));
    line-height: calc(12 * var(--u));
  }
}

@media (max-width: 460px) {
  .nav__logo .nav__logo-full { display: none; }
}
@media (min-width: 461px) {
  .nav__logo .nav__logo-short { display: none; }
}
@media (max-width: 480px) {
  .lists { grid-template-columns: minmax(0, 1fr); }
  .copy { margin-left: 6px; padding: 4px 6px; }
}
@media (max-width: 379px) {
  .nav__logo { display: none; }
  .nav__inner { justify-content: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
