/* ==========================================================================
   SONARAE: shared site chrome for the cinematic page (welcome.html)
   1 tokens   2 sticky header   3 buttons   4 pointer, reduced motion, forced colors

   This is the same header, tokens and button component that global.css gives the other pages,
   copied on purpose: global.css also restyles body, main, headings and form parts, which would
   collide with the cinematic's own style.css. Keep sections 1 to 3 in step with global.css
   sections 2, 6 and 7. The header is fixed here (global.css makes it sticky) so it stays on
   screen while the pinned fall plays.
   ========================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --border-color: #000000;
  --accent-yellow-light: #ffd400;   /* highlighter: a fill that always carries black type */
  --accent-yellow-dark: #a67c00;    /* rule: active nav, focus */
  --focus-color: var(--accent-yellow-dark);

  --font-display: 'Gloock', 'Times New Roman', Times, serif;
  --font-ui: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 64px;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --header-h: 64px;
  --tap: 44px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.2s;
  color-scheme: light;                /* the browser's own scrollbar and controls follow the sheet, as on every other page */
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-color: #000000;
  --text-color: #ffffff;
  --border-color: #ffffff;
  --accent-yellow-dark: #d9a400;
}

/* ---------- 2. sticky header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  font-synthesis: none;
}
.site-header--overlay {                /* welcome.html: pinned to the viewport above the whole fall */
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9000;
}
.site-header ul { margin: 0; padding: 0; list-style: none; }
.site-header a { color: inherit; }
.site-header :focus-visible { outline: 3px solid var(--focus-color); outline-offset: 4px; }
html.nav-open, html.nav-open body { overflow: hidden; }

.site-header__inner {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  max-width: var(--max);
  height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-color);
}
/* the logo mark sits to the left of the wordmark; its own colours read on both the white and the black sheet */
.brand__mark { display: block; flex: none; width: auto; height: 30px; }

.site-nav { display: flex; }
.site-nav__list { display: flex; align-items: stretch; gap: clamp(20px, 2.6vw, 40px); }
.site-nav__list li { display: flex; }
.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-color);
}
.site-nav a::after {                   /* 2px underline that overlaps the header rule */
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--text-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.site-nav a[aria-current="page"]::after { background: var(--accent-yellow-dark); transform: scaleX(1); }

.header-tools { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle, .menu-toggle {
  height: var(--tap);
  padding: 0;
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.theme-toggle { display: grid; place-items: center; width: var(--tap); }
.theme-toggle svg {
  display: block;
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: opacity 0.3s var(--ease-out), transform 0.45s var(--ease-out);
}
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-70deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(70deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }

.menu-toggle {
  display: none;
  padding-inline: 14px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 899px) {
  .js .menu-toggle { display: inline-flex; align-items: center; }
  .js .site-nav {
    position: fixed;
    inset: calc(var(--header-h) + 1px) 0 0 0;
    z-index: 99;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-5) var(--gutter) var(--space-8);
    background: var(--bg-color);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .js .site-header[data-nav-open] .site-nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease;
  }
  .js .site-nav__list { flex-direction: column; gap: 0; }
  .js .site-nav__list li { display: block; }
  .js .site-nav a {
    display: block;
    padding: 20px 0 18px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.75rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
  }
  .js .site-nav a::after { display: none; }
  .js .site-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent-yellow-dark); padding-bottom: 17px; }

  /* without JavaScript the links stay visible and simply wrap under the brand */
  html:not(.js) .site-header__inner { height: auto; flex-wrap: wrap; padding-block: var(--space-2); row-gap: 0; }
  html:not(.js) .site-nav { order: 3; width: 100%; }
  html:not(.js) .site-nav__list { flex-wrap: wrap; column-gap: var(--space-5); }
  html:not(.js) .site-nav a { min-height: 44px; white-space: nowrap; }
}
html:not(.js) .theme-toggle { display: none; }   /* switching themes needs JavaScript: a button that cannot work is not shown */
@media (max-width: 380px) {
  .site-header__inner { gap: var(--space-3); }
  .header-tools { gap: var(--space-2); }
  .brand { gap: 8px; font-size: 1.25rem; letter-spacing: 0.12em; }
  .brand__mark { height: 26px; }
}

/* ---------- 3. buttons ---------- */
.btn {
  --btn-bg: var(--bg-color);
  --btn-fg: var(--text-color);
  --btn-border: var(--border-color);
  --btn-hover-bg: var(--text-color);
  --btn-hover-fg: var(--bg-color);
  /* the wipe (::before) does the visible work; the real background swaps when it lands, so the state never depends on it */
  --btn-in: color 0.25s var(--ease-out) 0.09s, background-color 0s linear 0.45s, transform 0.12s ease;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: 0 var(--space-6);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s var(--ease-out) 0.09s, transform 0.12s ease;
}
.btn::before {                         /* the hover fill wipes in from the left and leaves to the right */
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: var(--btn-hover-bg);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.btn:focus-visible { color: var(--btn-hover-fg); background-color: var(--btn-hover-bg); transition: var(--btn-in); }
.btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:active { transform: translateY(1px); }
.btn__icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  transition: transform 0.3s var(--ease-out);
}
.btn:focus-visible .btn__icon { transform: translateX(3px); }

.btn--primary { --btn-bg: var(--accent-yellow-light); --btn-fg: #000000; --btn-border: #000000; }
.btn--ink { --btn-bg: #000000; --btn-fg: #ffffff; --btn-border: var(--text-color); --btn-hover-bg: #ffffff; --btn-hover-fg: #000000; }   /* the second action: a black block that reads on paper, on ink and over the film */

/* ---------- 4. pointer, reduced motion, forced colors ---------- */
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
  .theme-toggle:hover, .menu-toggle:hover { background: var(--text-color); color: var(--bg-color); }
  .btn:hover { color: var(--btn-hover-fg); background-color: var(--btn-hover-bg); transition: var(--btn-in); }
  .btn:hover::before { transform: scaleX(1); transform-origin: left; }
  .btn:hover .btn__icon { transform: translateX(3px); }
}
@media (hover: none) {
  .btn:active { color: var(--btn-hover-fg); background-color: var(--btn-hover-bg); transition: var(--btn-in); }
  .btn:active::before { transform: scaleX(1); transform-origin: left; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::before, .btn__icon, .site-nav a::after, .theme-toggle svg { transition-duration: 0.01ms; }
}
@media (forced-colors: active) {
  .site-nav a::after { background: CanvasText; }
}
