/* ==========================================================================
   Leonhard Sass Taalmaa — static site
   Design language: giant condensed display type, warm paper ground,
   ink-green text, terracotta accent. No animations, no transitions.
   ========================================================================== */

:root {
  --paper: #e8e6de;        /* warm bone ground */
  --ink: #141d19;          /* dark ink-green text */
  --ink-soft: #3c4a44;
  --accent: #c05b2e;       /* terracotta */
  --line: rgba(20, 29, 25, 0.3);
  --radius-lg: 96px;
  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ---- Custom circular cursor (hover-capable devices only) ---- */
@media (hover: hover) {
  html, body, a, button, .credit, .hero__media, .wordmark__hit {
    cursor: none;
  }

  .cursor {
    position: fixed;
    left: 0; top: 0;
    width: 14px; height: 14px;
    background: var(--ink);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 300;
    opacity: 0;
    transition: width 0.2s ease, height 0.2s ease,
                background 0.2s ease, opacity 0.2s ease;
  }

  .cursor.is-visible { opacity: 1; }

  /* grows just a touch over anything interactive */
  .cursor.is-active {
    width: 22px; height: 22px;
    background: var(--accent);
  }
}

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

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  background: var(--paper);
  color: var(--ink);
  /* JS drives transform directly, coupled 1:1 to scroll delta */
  will-change: transform;
}

.site-header__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* nav links distribute across the full header width */
.site-header__nav {
  flex: 1;
  display: flex; justify-content: space-between;
  margin-left: clamp(40px, 8vw, 140px);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.site-header__nav a:hover { color: var(--accent); }

/* dot marks the link of the section currently in view */
.site-header__brand,
.site-header__nav a {
  display: flex; align-items: center; gap: 9px;
}

.site-header__brand::before,
.site-header__nav a::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

.site-header__brand.is-active::before,
.site-header__nav a.is-active::before {
  opacity: 1;
}

.site-header__lang {
  display: flex; align-items: center; gap: 14px;
  margin-left: clamp(20px, 3vw, 48px);
}

.site-header__lang button {
  background: none; border: 0; cursor: pointer;
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  opacity: 0.5;
}

.site-header__lang button:hover { opacity: 1; }

.site-header__lang button.is-active {
  opacity: 1;
  color: var(--accent);
}

.site-header__burger {
  display: none;
  background: none; border: 0; cursor: pointer;
  color: inherit; /* buttons don't inherit color; needed for blend-mode visibility */
  width: 40px; height: 40px;
  flex-direction: column; align-items: center; justify-content: center; gap: 7px;
}

.site-header__burger span {
  display: block; width: 26px; height: 2px;
  background: currentColor;
}

.site-header__burger.is-open span:first-child { transform: translateY(4.5px) rotate(45deg); }
.site-header__burger.is-open span:last-child  { transform: translateY(-4.5px) rotate(-45deg); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 7vh;
}

.menu-overlay.is-open { display: flex; }

.menu-overlay__lang { display: flex; gap: 26px; }

.menu-overlay__lang button {
  background: none; border: 0; cursor: pointer;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  opacity: 0.5;
}

.menu-overlay__lang button.is-active {
  opacity: 1;
  color: var(--accent);
}

.menu-overlay nav {
  display: flex; flex-direction: column; gap: 4vh; text-align: center;
}

.menu-overlay a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4rem);
  color: var(--paper);
  text-transform: uppercase;
  transform: scaleY(1.15);
}

.menu-overlay a:hover { color: var(--accent); }

/* ==========================================================================
   Hero — static: giant name with portrait card on top
   ========================================================================== */

.hero {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  /* top padding clears the fixed title so the photo starts below the name;
     no bottom padding or min-height — the photo connects straight into the
     next section */
  padding: calc(var(--header-h) + 23vw) 16px 0;
  /* let hover reach the fixed title behind the hero's transparent area */
  pointer-events: none;
}

.hero__title, .hero__media, .hero__tag { pointer-events: auto; }

/* The giant name is fixed behind the page; scrolling content covers it.
   z-index -1 keeps it above the body background but below section backgrounds. */
.hero__title {
  position: fixed;
  /* the scaleY(1.5) stretch plus Anton's ink overflow (ascent exceeds the
     0.86 line-height) bleed ~7vw above the line box — offset so the letter
     tops clear the navbar */
  top: calc(var(--header-h) + 7vw);
  left: 0; right: 0;
  z-index: -1;
  display: flex; flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.86;
  user-select: none;
}

.hero__line {
  display: block;
  /* sized so LEONHARD spans the full viewport width */
  font-size: 25.5vw;
  letter-spacing: 0.01em;
  transform: scaleY(1.5);
}

.hero__media {
  position: relative; z-index: 2;
  width: clamp(280px, 42vw, 640px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* the photo hangs a little over the next section's top edge */
  margin-bottom: calc(-1 * clamp(40px, 5vw, 90px));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* hover-scale only arms after the first real mouse move, so a cursor
   already resting on the image during load doesn't make it pop */
@media (hover: hover) {
  body.mouse-moved .hero__media:hover { transform: scale(1.02); }
}

.hero__media img {
  width: 100%;
  /* near-square crop; keep the top of the frame so the head stays visible */
  aspect-ratio: 0.95;
  object-fit: cover;
  object-position: top;
  filter: grayscale(1) contrast(1.05);
}

.hero__tag {
  position: relative; z-index: 2;
  margin-top: 22px;
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.2em;
  text-align: center;
}

/* ---- Load-in: hero content slides up and fades in ---- */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18vh); }
  to   { opacity: 1; transform: none; }
}

/* variant preserving the display type's scaleY */
@keyframes rise-in-line {
  from { opacity: 0; transform: translateY(18vh) scaleY(1.5); }
  to   { opacity: 1; transform: scaleY(1.5); }
}

/* fill-mode backwards (not both): a finished "both" animation keeps its
   to-keyframe applied, which would block the hover transform on the media.
   Name and photo travel together — same distance, speed, and timing. */
.hero__line  { animation: rise-in-line 1s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero__media { animation: rise-in 1s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

@media (prefers-reduced-motion: reduce) {
  .hero__line, .hero__media { animation: none; }
}

/* ==========================================================================
   Shared section styles
   ========================================================================== */

.section {
  padding: clamp(60px, 10vh, 130px) clamp(16px, 4vw, 56px);
  /* solid ground so sections hide the fixed hero name while scrolling */
  background: var(--paper);
}

.section > * {
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
}

/* taller lead-in on the first section: STAGE stays below the fold until
   the visitor scrolls */
#stage { padding-top: clamp(140px, 26vh, 360px); }

.section__heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: clamp(28px, 5vh, 64px);
}

/* ==========================================================================
   Credits lists (Stage, Film & TV)
   ========================================================================== */

.credits__list { list-style: none; }

.credit {
  display: flex; align-items: baseline; gap: 18px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--line);
  /* rows fade in and rise line by line; --i is set per row from JS */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

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

@media (prefers-reduced-motion: reduce) {
  .credit { opacity: 1; transform: none; transition: none; }
}

/* Whole row inverts on hover: a duplicate, inverted copy of the row
   (.credit__fill, built in JS) is clipped by the sweeping bar, so the
   recolored text is revealed exactly where the bar is — both directions. */
.credit {
  position: relative;
  isolation: isolate;
}

.credit__fill {
  position: absolute; inset: 0;
  display: flex; align-items: baseline; gap: 18px;
  padding: 20px 8px;
  background: var(--ink);
  clip-path: inset(0 100% 0 0);
  /* un-hover: bar retreats slowly */
  transition: clip-path 0.9s ease;
  pointer-events: none;
}

/* hover effects only on devices with a real pointer — on touch, taps
   would make them stick */
@media (hover: hover) {
  .credit:hover .credit__fill {
    clip-path: inset(0 0 0 0);
    /* hover: bar sweeps in fast */
    transition: clip-path 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

.credit__fill .credit__title { color: var(--accent); }
.credit__fill .credit__meta { color: var(--paper); }
.credit__fill .credit__bullet { background: var(--accent); }

/* Floating image that follows the cursor over credit rows */
.hover-card {
  position: fixed;
  left: 0; top: 0;
  z-index: 60;
  width: clamp(180px, 20vw, 300px);
  border-radius: 32px;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

.hover-card.is-active { display: block; }

.hover-card img {
  width: 100%;
  height: auto; /* posters keep their natural aspect ratio */
  max-height: 62vh;
  object-fit: contain;
}

.credit:first-child { border-top: 1px solid var(--line); }

.credit__bullet {
  flex: none;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink);
  align-self: center;
}

.credit__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.2vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
}

.credit__meta {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-align: right;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 2vw, 28px);
}

.gallery__item {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.gallery__item--wide { grid-column: span 2; }

.gallery__item--wide img { aspect-ratio: 2 / 1; }

/* portrait-format photos keep their upright ratio instead of a landscape crop */
.gallery__item--portrait {
  max-width: min(480px, 100%);
  justify-self: center;
}

.gallery__item--portrait img { aspect-ratio: 3 / 4; }

/* ==========================================================================
   About — giant wordmark + columns
   ========================================================================== */

.about { text-align: center; }

.about__wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  /* sized so TAALMAA spans the full viewport width */
  font-size: 27.5vw;
  line-height: 0.95;
  letter-spacing: 0.01em;
  transform: scaleY(1.25);
  /* clear air before the wordmark arrives */
  margin-top: clamp(80px, 18vh, 240px);
  margin-bottom: clamp(40px, 8vh, 90px);
  white-space: nowrap;
  /* break out of the section's centered content column */
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* hovering the wordmark overlays SASS in orange on top of TAALMAA — instant.
   Only the TAALMAA glyphs themselves are the hover target, not the full-width
   strip; the overlay ignores the pointer so it can't steal the hover.
   The explicit background matters: the reveal transform makes this a stacking
   context, and the darken blend below needs a dark backdrop inside it —
   without it the gaps between letters are transparent and SASS stays orange */
.about__wordmark {
  position: relative;
  background: var(--paper);
}

.about__wordmark .wordmark__alt {
  display: none;
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  color: var(--accent);
  pointer-events: none;
  /* slight outward stroke swallows the sub-pixel fringe where SASS edges
     coincide with the bone glyph edges underneath */
  -webkit-text-stroke: 3px var(--accent);
}

/* hover hitbox: an invisible zone matching SASS's own footprint,
   positioned/sized from JS */
.wordmark__hit {
  position: absolute;
  top: 0; height: 100%;
}

@media (hover: hover) {
  .wordmark__hit:hover + .wordmark__alt { display: block; }
}

/* no hover on touch devices — SASS is simply always on */
@media (hover: none) {
  .about__wordmark .wordmark__alt { display: block; }
}

/* scroll reveal: slide up + fade in */
.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* variants preserving the wordmark's scaleY */
.about__wordmark.reveal-up { transform: translateY(60px) scaleY(1.25); }
.about__wordmark.reveal-up.is-visible { transform: scaleY(1.25); }

@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; }
  .about__wordmark.reveal-up { transform: scaleY(1.25); }
}

.about__columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 48px);
  text-align: left;
  max-width: 1100px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.about__columns em {
  color: var(--accent);
  font-style: italic;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact { text-align: center; }

.contact__lead {
  font-size: 0.85rem;
  margin-bottom: 22px;
}

.contact__details {
  display: flex; flex-wrap: wrap; gap: 10px 34px;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.contact__details a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.contact__details a:hover { color: var(--accent); border-color: var(--accent); }

.contact__cv {
  display: inline-block;
  margin-top: clamp(28px, 5vh, 48px);
  padding: 16px 40px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.contact__cv:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px clamp(16px, 4vw, 56px);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

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

.site-footer__credit {
  font-size: 0.65rem;
  opacity: 0.6;
  justify-self: center;
}

.site-footer > a[href="#top"] { justify-self: end; }

.site-footer__credit a { border-bottom: 1px solid currentColor; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  :root { --radius-lg: 24px; }

  .site-header__nav { display: none; }
  .site-header__burger { display: flex; }

  /* navbar: brand left, language switcher pushed right beside the burger;
     no reserved space for the scroll-spy dot */
  .site-header__brand { gap: 0; }
  .site-header__brand::before { display: none; }
  /* language switcher lives inside the burger menu on mobile */
  .site-header__lang { display: none; }

  /* type fills the narrow viewport */
  .section__heading { font-size: clamp(3rem, 14vw, 7rem); }
  .credit__title { font-size: clamp(1.5rem, 6.5vw, 2.4rem); }

  .credit { flex-wrap: wrap; }
  .credit__meta { margin-left: 27px; width: 100%; text-align: left; }

  .hero__media { width: min(86vw, 480px); }


  /* tighter vertical rhythm on mobile */
  .section { padding-top: 48px; padding-bottom: 48px; }
  #stage { padding-top: 72px; }
  .about__wordmark { margin-top: 16px; margin-bottom: 32px; }

  .about__columns { grid-template-columns: 1fr; }

  .gallery__grid { grid-template-columns: 1fr; }
  .gallery__item--wide { grid-column: span 1; }
  .gallery__item--wide img { aspect-ratio: 4 / 3; }
}
