/* ─── Fonts ─────────────────────────────────────────────── */

@font-face {
  font-family: 'Soehne';
  src: url('fonts/soehne-kraftig.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Soehne';
  src: url('fonts/soehne-buch.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ─── Reset & Base ─────────────────────────────────────── */

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

h1, h2, h3, h4, h5, h6,
strong, b {
  font-weight: 500;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0.16em;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'calt', 'liga';
  font-kerning: normal;
  overflow-wrap: break-word;
  hanging-punctuation: first last;
}

:root {
  --bg: oklch(0.975 0.002 80);
  --fg: oklch(0.025 0.002 80);
  --type-hero: min(clamp(2.5rem, 7vw, 9rem), max(4rem, 14svh));
  --type-sub: clamp(1.3125rem, calc(var(--type-hero) * 0.36), 3.25rem);
  --type-caption: clamp(1rem, calc(var(--type-hero) * 0.27), 2.43rem);
  --transition-reveal: 0.6s ease;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Soehne', system-ui, sans-serif;
  font-weight: 500;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ─── Sections ─────────────────────────────────────────── */

.section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10vw;
  position: relative;
}

.section-text {
  font-size: var(--type-hero);
  line-height: 1;
  text-wrap: balance;
  text-align: center;
}

.section-text a {
  text-decoration: none;
  color: inherit;
  text-underline-offset: 0.12em;
}

.section-text a:hover,
.section-text a:focus-visible {
  text-decoration: underline;
}


/* ─── Intro ────────────────────────────────────────────── */

#apple .section-text {
  text-wrap: pretty;
}

#intro {
  flex-direction: column;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.423em;                /* Söhne descender depth */
  font-size: var(--type-hero);
}

/* ─── Play Button ──────────────────────────────────────── */

#play-btn {
  --btn-size: max(36px, 0.718em); /* Söhne cap-height, 36px floor for mobile legibility */
  display: none;
  position: relative;
  width: var(--btn-size);
  height: var(--btn-size);
  font-size: var(--type-hero);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  padding: 0;
  touch-action: manipulation;
}

/* Tab treats the button as an activation (see main.js focus handler),
   so never show a focus ring — the blur-then-click flow relies on the
   ring never painting. */
#play-btn:focus,
#play-btn:focus-visible {
  outline: none;
}

#play-btn::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

.js #play-btn {
  display: block;
  opacity: 0;
  transition: opacity var(--transition-reveal) 200ms;
}

.js #play-btn.visible {
  opacity: 1;
}

#play-btn svg {
  width: 100%;
  height: 100%;
}

#arrow-group {
  transform-origin: 25px 25px;
}

#arrow-stem {
  transform-origin: 25px 25.55px;
}

/* ─── Keynote Scrub ────────────────────────────────────── */

.scrub-wrap {
  height: 1200vh;
  position: relative;
}

.scrub-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scrub-sticky canvas {
  display: block;
  opacity: 0;
}

.scrub-fallback {
  display: block;
  width: min(90vw, 640px);
  height: auto;
}

/* ─── Placards ─────────────────────────────────────────── */

.scrub-placard {
  position: absolute;
  bottom: clamp(1.5rem, 8vh, 4rem);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #fff;
  font-weight: 400;
  font-size: var(--type-caption);
  line-height: 1.3333;
  opacity: 1;
}

.js .scrub-placard {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.js .scrub-placard.visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .js .scrub-placard {
    transition: none;
  }
}

.scrub-placard strong,
.scrub-placard span {
  display: block;
}

.scrub-placard strong:empty,
.scrub-placard span:empty {
  display: none;
}

.placard-credit {
  font-weight: 400;
}

/* ─── Emoji ────────────────────────────────────────────── */

.emoji-wrap {
  height: 1400vh;
  position: relative;
}

.emoji-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.emoji-face,
.about-face,
.contact-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10vw;
  opacity: 0;
  pointer-events: none;
}

.emoji-face.active,
.about-face.active,
.contact-face.active {
  opacity: 1;
  pointer-events: auto;
}

/* Shared reveal primitive. Everything with .face-hidden starts at
   opacity 0 synchronously on fresh load; the bottom-of-script reveal
   pass arms .face-revealing on the scroll-correct target and removes
   .face-hidden with a double-rAF so the CSS transition fires. Non-target
   emoji faces get .face-hidden removed silently — their children's inline
   opacity keeps them visually empty until the spring system takes over.
   200ms delay matches the site-wide reveal timing. */
.emoji-face.face-hidden,
.about-face.face-hidden,
.contact-face.face-hidden,
.scrub-sticky.face-hidden {
  opacity: 0;
}

.emoji-face.face-revealing,
.about-face.face-revealing,
.contact-face.face-revealing,
.scrub-sticky.face-revealing {
  transition: opacity var(--transition-reveal) 200ms;
}

.emoji-face {
  gap: 6vh;
}

.emoji-row {
  display: flex;
  gap: 4vw;
}

.emoji-slot {
  position: relative;
  width: clamp(100px, 16vw, 240px);
  height: clamp(100px, 16vw, 240px);
}

.emoji-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ─── Scroll Cue ───────────────────────────────────────── */

#scroll-cue {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(1.5rem, 3.5vh, 2.5rem));
  transform: translate(-50%, 0);
  /* Sized to Söhne's x-height (0.525em) — subordinate to the play button
     (which is cap-height 0.718em). x-height is a clean typographic metric
     and lands at 73% of the play button, reading as related-but-smaller.
     Stroke-width stays 9/50 in viewBox, so it scales proportionally with
     the chevron. font-size inherits --type-hero so it tracks the type. */
  font-size: var(--type-hero);
  width: max(28px, 0.525em);
  color: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
  z-index: 100;
  overflow: visible;
  will-change: transform, opacity;
}

#scroll-cue svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.js #scroll-cue.visible {
  opacity: 1;
  transition: opacity 450ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  #scroll-cue,
  .js #scroll-cue.visible {
    transition: opacity 0.01ms linear;
  }
}

html:not(.js) #scroll-cue { display: none; }

/* ─── Reveal ───────────────────────────────────────────── */

.reveal {
  opacity: 1;
}

.js .reveal {
  opacity: 0;
  transition: opacity var(--transition-reveal) 200ms;
}

.js .reveal.visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  :root { --transition-reveal: 0.01ms ease; }

  .emoji-slot img {
    filter: none !important;
  }
}

/* ─── About ───────────────────────────────────────────── */

.about-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8em;
}

.about-block {
  font-size: var(--type-sub);
  font-weight: 400;
  line-height: 1.25;
}

.about-line {
  display: block;
}

.about-block a {
  text-decoration: none;
  color: inherit;
  text-underline-offset: 0.12em;
}

.about-block a:hover,
.about-block a:focus-visible {
  text-decoration: underline;
}

.contact-cta {
  font-size: var(--type-sub);
  font-weight: 500;
  line-height: 1.3333;
  text-align: center;
  margin-bottom: 0.5em;
}

.contact-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.3em;
  font-size: var(--type-sub);
  font-weight: 400;
  line-height: 1.3333;
}

.contact-social a {
  color: inherit;
  text-decoration: none;
}

.contact-social a:hover,
.contact-social a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.contact-link {
  font-size: var(--type-sub);
  font-weight: 400;
  line-height: 1.3333;
  color: inherit;
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}


/* ─── No-JS Fallback ──────────────────────────────────── */

html:not(.js) .emoji-face,
html:not(.js) .about-face,
html:not(.js) .contact-face {
  position: static;
  opacity: 1;
  pointer-events: auto;
}
html:not(.js) .emoji-sticky {
  position: static;
  height: auto;
  flex-direction: column;
  gap: 4em;
  padding: 4em 10vw;
}
html:not(.js) .emoji-wrap { height: auto; }
html:not(.js) .scrub-wrap { height: auto; }
html:not(.js) .scrub-sticky { position: static; height: auto; }
html:not(.js) .scrub-sticky canvas { display: none; }


