/* =========================================================
   patrickrathjen.com — site stylesheet
   Concept "Stage Light": dark = concert stage, light = gallery/print.
   Critical tokens, base, nav and hero are inlined in <head> (src/css/critical.css).
   ========================================================= */

/* ---------- Shared building blocks ---------- */
.section { position: relative; padding-block: clamp(48px, 5vw, 88px); }

.label {
  display: flex; align-items: center; gap: .9em;
  margin-bottom: clamp(18px, 2.4vw, 30px);
  font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink);
}
.label::before {
  content: ""; width: 34px; height: 1px; background: currentColor;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.section-head { max-width: 62rem; margin-bottom: clamp(28px, 3.5vw, 56px); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 1.3rem + 4.4vw, 6.2rem);
  font-weight: 680; line-height: .96; letter-spacing: -.045em;
  text-wrap: balance;
}
.section-text {
  margin-top: clamp(20px, 2.4vw, 32px);
  max-width: 44rem;
  font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem); line-height: 1.6;
  color: var(--ink-2); text-wrap: pretty;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none;
  transition: transform .25s var(--ease), background-color .2s, border-color .2s, box-shadow .3s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: var(--btn); color: var(--on-accent);
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* Scroll reveal (JS adds .reveal-ready to <html>, so content never hides without JS) */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease) var(--d, 0ms), transform 1.1s var(--ease) var(--d, 0ms); }
  .reveal-ready .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- Menu overlay (mobile) ---------- */
.menu {
  position: fixed; inset: 0; z-index: -1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(96px + env(safe-area-inset-top)) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--bg);
  pointer-events: auto;
  overflow-y: auto;
}
.menu::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80vmax 60vmax at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
}
.menu-links { position: relative; display: grid; gap: 4px; }
.menu-links a {
  display: flex; align-items: baseline; gap: .5em;
  padding: 6px 0;
  font-family: var(--font-display); font-weight: 680;
  font-size: clamp(2.6rem, 13vw, 5rem); line-height: 1; letter-spacing: -.045em;
  text-decoration: none; color: var(--ink);
}
.menu-num { font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .14em; color: var(--accent-ink); transform: translateY(-1.6em); }
.menu-foot { position: relative; display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: .95rem; color: var(--ink-2); }
.menu-foot a { min-height: 44px; display: inline-flex; align-items: center; }
@media (prefers-reduced-motion: no-preference) {
  .menu:not([hidden]) { animation: menu-in .45s var(--ease) both; }
  .menu:not([hidden]) .menu-links li { animation: fade-up .6s var(--ease) both; animation-delay: calc(80ms + var(--i) * 60ms); }
}
@keyframes menu-in { from { opacity: 0; clip-path: circle(0 at calc(100% - 44px) 34px); } to { opacity: 1; clip-path: circle(150% at calc(100% - 44px) 34px); } }
.menu-open { overflow: hidden; }

/* Header gets a touch more presence once you leave the hero */
.is-scrolled .nav { box-shadow: 0 14px 40px -16px rgb(0 0 0 / .45); }

/* ---------- 00 Intro ---------- */
.intro { overflow: clip; }
.intro::before { /* soft overhead spot */
  content: ""; position: absolute; inset: 0 0 auto; height: 70%; pointer-events: none;
  background: radial-gradient(60% 70% at 20% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
}
.intro-grid {
  position: relative;
  display: grid; gap: clamp(32px, 5vw, 72px) clamp(24px, 4vw, 64px);
  grid-template-columns: 1fr;
}
.intro-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.6rem); letter-spacing: -.01em; color: var(--ink-2);
}
.manifest {
  font-family: var(--font-display); font-weight: 520;
  font-size: clamp(1.6rem, .9rem + 2.9vw, 3.65rem);
  line-height: 1.13; letter-spacing: -.028em;
  text-wrap: pretty;
}
.manifest .w-em { color: var(--accent-ink); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .manifest .w {
      animation: lit linear both;
      animation-timeline: view();
      animation-range: entry 40% cover 42%;
    }
  }
}
@keyframes lit { from { filter: opacity(.16); } to { filter: opacity(1); } }

.portrait { position: relative; }
.portrait-frame {
  position: relative; overflow: hidden; border-radius: 4px;
  background: var(--mat); padding: clamp(8px, 1vw, 14px);
  box-shadow: var(--shadow-print);
  transform: rotate(-1.6deg);
}
.portrait-frame img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: contrast(1.04); border-radius: 2px; }
.portrait figcaption { margin-top: 18px; color: var(--ink-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .portrait-frame { transform: none; padding: 0; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgb(0 0 0); }
  :root:not([data-theme="light"]) .portrait::before { content: ""; position: absolute; inset: -18% -20% auto; height: 80%; background: radial-gradient(closest-side, rgb(255 140 80 / .2), transparent); pointer-events: none; }
}
:root[data-theme="dark"] .portrait-frame { transform: none; padding: 0; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgb(0 0 0); }
:root[data-theme="dark"] .portrait::before { content: ""; position: absolute; inset: -18% -20% auto; height: 80%; background: radial-gradient(closest-side, rgb(255 140 80 / .2), transparent); pointer-events: none; }

.intro-body p { font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); line-height: 1.65; color: var(--ink-2); max-width: 36rem; text-wrap: pretty; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-2); }
.fact {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 16px 26px 0;
  border-bottom: 1px solid var(--line);
}
.fact:nth-child(odd) { border-right: 1px solid var(--line); }
.fact:nth-child(even) { padding-left: 16px; }
.fact-val {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 2rem + 4vw, 6.4rem); line-height: .9; letter-spacing: -.05em;
}
.fact:first-child .fact-val { color: var(--accent-ink); }
.fact-label { font-size: .92rem; line-height: 1.4; color: var(--ink-2); max-width: 22ch; }

@media (min-width: 900px) {
  .intro-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .intro-head { grid-column: 1 / -1; }
  .manifest { grid-column: 1 / 9; }
  .portrait { grid-column: 9 / 13; grid-row: 2 / 4; align-self: start; margin-top: 8px; }
  .intro-body { grid-column: 1 / 7; }
  .facts-wrap { grid-column: 1 / -1; margin-top: clamp(16px, 3vw, 40px); }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fact, .fact:nth-child(even) { padding: 26px 24px 30px; border-right: 1px solid var(--line); border-bottom: 0; }
  .fact:first-child { padding-left: 0; }
  .fact:last-child { border-right: 0; }
}

/* ---------- 01 Photography ---------- */
.photo { background: var(--bg-2); padding-bottom: clamp(48px, 5vw, 88px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .photo { background: radial-gradient(120% 60% at 50% 0%, #11131b 0%, var(--bg) 60%); }
}
:root[data-theme="dark"] .photo { background: radial-gradient(120% 60% at 50% 0%, #11131b 0%, var(--bg) 60%); }

.photo-head {
  display: grid; gap: 40px; align-items: end;
  margin-bottom: clamp(28px, 4vw, 56px);
}
@media (min-width: 900px) { .photo-head { grid-template-columns: minmax(0, 1fr) auto; } }
.photo-head .section-title { max-width: 13ch; }
.photo-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
@media (min-width: 900px) { .photo-brand { align-items: flex-end; } }
.sr-logo {
  display: block; width: clamp(112px, 11vw, 168px); aspect-ratio: 1;
  background: var(--ink);
  -webkit-mask: url(../img/logo/studio-rathjen.svg) center / contain no-repeat;
  mask: url(../img/logo/studio-rathjen.svg) center / contain no-repeat;
}
.insta-link {
  display: inline-flex; align-items: center; gap: .55em; min-height: 44px;
  padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.insta-link:hover { border-color: var(--ink); }

/* Shot (image button) used in setlist + grid */
.shot {
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--ratio);
  overflow: hidden; border-radius: 3px;
  background: #15161a var(--lqip) center / cover no-repeat;
  cursor: zoom-in;
}
.shot picture, .shot img { width: 100%; height: 100%; }
.shot img { object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; }
@media (hover: hover) and (pointer: fine) {
  .shot:hover img { transform: scale(1.035); }
}
.shot:focus-visible { outline-offset: 4px; }

/* Light mode: photos as matted prints */
.grid-item .shot, .set-item .shot { box-shadow: var(--shadow-print); }
:root:not([data-theme="dark"]) .grid-item .shot,
:root:not([data-theme="dark"]) .set-item .shot { outline: clamp(5px, .6vw, 9px) solid var(--mat); outline-offset: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grid-item .shot, :root:not([data-theme="light"]) .set-item .shot { outline: 0; } }
.grid-item .shot:focus-visible, .set-item .shot:focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 4px !important; }

/* Setlist — default: vertical editorial stack (mobile, touch, reduced motion) */
.setlist { position: relative; }
.setlist-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.setlist-head .label { grid-column: 1 / -1; }
.setlist-title {
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.6rem); line-height: 1; letter-spacing: -.035em;
}
.setlist-hint { display: none; align-items: center; gap: .6em; color: var(--ink-3); }
.setlist-hint .icon { width: 16px; height: 16px; }
.setlist-track {
  display: grid; gap: clamp(40px, 7vw, 72px);
  width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto;
}
.set-item { display: grid; gap: 14px; }
@media (min-width: 700px) {
  .set-item--portrait { width: min(62%, 560px); }
  .set-item:nth-child(even) { justify-self: end; }
  .set-item--landscape { width: 86%; }
}
.set-cap { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; }
.set-num { grid-row: span 2; color: var(--accent-ink); }
.set-title { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); letter-spacing: -.02em; line-height: 1.15; }
.set-meta { color: var(--ink-3); font-size: .7rem; }
.setlist-progress { display: none; }

/* Setlist — pinned horizontal mode (JS adds .is-pinned on wide, fine-pointer screens) */
.setlist.is-pinned { height: var(--pin-h, 400vh); }
.setlist.is-pinned .setlist-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 64px;
}
.setlist.is-pinned .setlist-head { margin-bottom: clamp(20px, 3vh, 36px); }
.setlist.is-pinned .setlist-hint { display: inline-flex; }
.setlist.is-pinned .setlist-track {
  display: flex; align-items: flex-start; gap: clamp(28px, 3vw, 64px);
  width: max-content; margin: 0; padding-inline: var(--gutter) 12vw;
  will-change: transform;
}
.setlist.is-pinned .set-item { width: auto !important; justify-self: auto; }
.setlist.is-pinned .shot { height: min(60vh, 60svh, 900px); width: auto; }
.setlist.is-pinned .set-cap { max-width: 40ch; }
.setlist.is-pinned .setlist-progress {
  display: block; position: relative; height: 2px; margin: clamp(20px, 3vh, 32px) var(--gutter) 0;
  background: var(--line);
}
.setlist-progress span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* Archive grid */
.archive { margin-top: clamp(48px, 5vw, 88px); }
.archive-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.archive-title { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.6rem); line-height: 1; letter-spacing: -.035em; display: flex; align-items: flex-start; gap: .3em; }
.archive-count { font-size: .8rem; color: var(--accent-ink); letter-spacing: .08em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: .92rem; font-weight: 500; color: var(--ink-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-n { font-family: var(--font-mono); font-size: .7rem; opacity: .75; }

.masonry {
  --cols: 2; --gap: clamp(18px, 2vw, 32px);
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap); align-items: start;
}
@media (min-width: 1024px) { .masonry { --cols: 3; } }
@media (min-width: 1800px) { .masonry { --cols: 4; } }
/* JS-enhanced masonry: row spans derived from each photo's known aspect ratio (no multi-column layout – WebKit mis-balances it) */
.masonry.is-masonry { grid-auto-rows: 4px; row-gap: 0; grid-auto-flow: row dense; }
.masonry.is-masonry .grid-item { padding-bottom: var(--gap); grid-row-end: span var(--span, 60); }
.grid-item { min-width: 0; }
.grid-item[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .grid-item.is-entering { animation: fade-up .6s var(--ease) both; }
}
.shot-cap {
  position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: 2px;
  padding: 40px 16px 14px; text-align: left;
  background: linear-gradient(to top, rgb(0 0 0 / .78), transparent);
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2;
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .45s var(--ease);
}
.shot-cap .mono { font-size: .64rem; color: rgb(255 255 255 / .82); }
@media (hover: hover) and (pointer: fine) {
  .shot:hover .shot-cap, .shot:focus-visible .shot-cap { opacity: 1; transform: none; }
}
.rights { margin-top: 32px; color: var(--ink-3); font-size: .68rem; }

/* Showreel */
.reel-wrap {
  display: grid; gap: clamp(24px, 3vw, 48px); align-items: end;
  margin-top: clamp(48px, 5vw, 88px);
}
@media (min-width: 1024px) { .reel-wrap { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); } }
.reel {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: clamp(12px, 1.4vw, 20px);
  background: #000;
  box-shadow: 0 40px 100px -50px rgb(0 0 0 / .9), 0 0 0 1px var(--line);
}
.reel-play { position: absolute; inset: 0; display: block; width: 100%; cursor: pointer; }
.reel-play img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), filter .6s; filter: saturate(.9); }
.reel-play:hover img { transform: scale(1.03); filter: none; }
.reel-btn {
  position: absolute; left: 50%; top: 50%;
  width: clamp(72px, 8vw, 112px); aspect-ratio: 1; margin: calc(clamp(72px, 8vw, 112px) / -2) 0 0 calc(clamp(72px, 8vw, 112px) / -2);
  display: grid; place-items: center; border-radius: 50%;
  background: #ff6a2b; color: #140803;
  box-shadow: 0 0 0 0 rgb(255 106 43 / .55), 0 20px 50px -10px rgb(255 106 43 / .7);
  transition: transform .4s var(--ease);
}
.reel-btn .icon { width: 36%; height: 36%; transform: translateX(6%); }
.reel-play:hover .reel-btn { transform: scale(1.08); }
@media (prefers-reduced-motion: no-preference) {
  .reel-btn { animation: pulse 2.6s var(--ease-in-out) infinite; }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(255 106 43 / .5), 0 20px 50px -10px rgb(255 106 43 / .7); } 70%, 100% { box-shadow: 0 0 0 26px rgb(255 106 43 / 0), 0 20px 50px -10px rgb(255 106 43 / .7); } }
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.reel-copy p { color: var(--ink-2); margin-top: 12px; max-width: 30rem; }
.reel-title { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.6rem); line-height: 1.05; letter-spacing: -.03em; }
.reel-copy .reel-music { margin-top: 18px; color: var(--ink-3); font-size: .68rem; }

/* Booking CTA */
.photo-cta {
  display: grid; gap: 28px; align-items: center;
  margin-top: clamp(40px, 4.5vw, 72px);
  padding: clamp(28px, 4vw, 56px);
  border-radius: clamp(18px, 2vw, 28px);
  background: var(--surface); border: 1px solid var(--line);
}
@media (min-width: 900px) { .photo-cta { grid-template-columns: minmax(0, 1fr) auto; } }
.cta-title { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
.photo-cta p { margin-top: 10px; color: var(--ink-2); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgb(5 6 9 / .96); color: #f7f3ec;
  overscroll-behavior: contain;
}
.lightbox::backdrop { background: rgb(5 6 9 / .8); }
.lb-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 12px 96px; }
@media (min-width: 900px) { .lb-inner { padding: 72px 96px 104px; } }
.lb-figure { width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y pinch-zoom; }
.lb-stage picture { display: contents; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); width: auto; height: auto; object-fit: contain; border-radius: 2px; box-shadow: 0 30px 80px -30px #000; }
@media (prefers-reduced-motion: no-preference) {
  .lb-stage img { animation: lb-in .45s var(--ease) both; }
  .lightbox[open] { animation: fade-in .3s ease both; }
}
@keyframes lb-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lb-cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 16px; text-align: center; }
.lb-title { font-family: var(--font-display); font-weight: 650; font-size: 1.2rem; letter-spacing: -.01em; }
.lb-meta, .lb-count { font-size: .68rem; color: rgb(247 243 236 / .76); }
.lb-btn {
  position: absolute; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .22); color: #fff;
  transition: background-color .2s;
}
.lb-btn:hover { background: rgb(255 255 255 / .2); }
.lb-btn .icon { width: 22px; height: 22px; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.lb-prev, .lb-next { bottom: max(18px, env(safe-area-inset-bottom)); }
.lb-prev { left: calc(50% - 64px); }
.lb-next { right: calc(50% - 64px); }
@media (min-width: 900px) {
  .lb-prev, .lb-next { top: 50%; bottom: auto; margin-top: -26px; }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  .lb-close { top: 20px; right: 24px; }
}
.lightbox :focus-visible { outline-color: #ff8a55; }

/* ---------- 02 Apps ---------- */
.apps { overflow: clip; }
.app {
  --a: #888; --b: #aaa; --tint: 6%;
  --brand-ink: var(--ink);
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: clamp(32px, 4vw, 56px);
  padding: clamp(24px, 4.4vw, 72px);
  border-radius: clamp(22px, 2.4vw, 36px);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--a) var(--tint), var(--surface));
}
.app-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 85% 30%, color-mix(in srgb, var(--a) 30%, transparent), transparent 70%),
    radial-gradient(50% 60% at 70% 100%, color-mix(in srgb, var(--b) 24%, transparent), transparent 70%);
  opacity: .55;
}
.app--healthlumio { --a: #ff3b5c; --b: #ff9a4a; --brand-ink: #c0163c; }
.app--gridium { --a: #7433f2; --b: #3b1fc4; --brand-ink: #4b22d8; }
.app--balkonizer { --a: #fea614; --b: #fe7a14; --brand-ink: #8a4b00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app { --tint: 9%; }
  :root:not([data-theme="light"]) .app-glow { opacity: 1; }
  :root:not([data-theme="light"]) .app--healthlumio { --brand-ink: #ff7f8f; }
  :root:not([data-theme="light"]) .app--gridium { --brand-ink: #fff275; }
  :root:not([data-theme="light"]) .app--balkonizer { --brand-ink: #feca4c; }
}
:root[data-theme="dark"] .app { --tint: 9%; }
:root[data-theme="dark"] .app-glow { opacity: 1; }
:root[data-theme="dark"] .app--healthlumio { --brand-ink: #ff7f8f; }
:root[data-theme="dark"] .app--gridium { --brand-ink: #fff275; }
:root[data-theme="dark"] .app--balkonizer { --brand-ink: #feca4c; }

.app-id { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); }
.app-icon {
  width: clamp(64px, 6vw, 88px); flex: none;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / .28));
}
.app-icon img {
  width: 100%; aspect-ratio: 1;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C86 0 100 14 100 50S86 100 50 100 0 86 0 50 14 0 50 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C86 0 100 14 100 50S86 100 50 100 0 86 0 50 14 0 50 0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.app-icon--balkonizer { overflow: hidden; }
.app-icon--balkonizer img { transform: scale(1.085); }
.app-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; color: var(--ink-2); }
.app-kicker .mono { font-size: .68rem; }
.badge-new {
  display: inline-flex; align-items: center; gap: .45em;
  padding: 4px 10px 4px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  background: linear-gradient(90deg, #e0274a, #d9581c); color: #fff;
  box-shadow: 0 6px 18px -6px rgb(255 59 92 / .7);
}
.badge-new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
@media (prefers-reduced-motion: no-preference) { .badge-new::before { animation: blink 1.6s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: .25; } }
.app-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.6rem); line-height: 1; letter-spacing: -.045em; }
.app-tagline {
  margin-top: clamp(20px, 2.4vw, 32px);
  font-family: var(--font-display); font-weight: 620;
  font-size: clamp(1.3rem, 1.1rem + .8vw, 1.85rem); line-height: 1.15; letter-spacing: -.025em;
  color: var(--brand-ink);
}
.app-short { margin-top: 12px; color: var(--ink-2); max-width: 38rem; text-wrap: pretty; }
.app-hl { display: grid; gap: 8px 28px; margin-top: 22px; font-size: .95rem; }
.app-hl li { position: relative; padding-left: 20px; line-height: 1.45; }
.app-hl li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, var(--a), var(--b)); }
.app-platforms { margin-top: 22px; font-size: .92rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.app-platforms .mono { font-size: .64rem; color: var(--ink-3); }
.app-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.store-badge { display: inline-block; border-radius: 9px; transition: transform .25s var(--ease); }
.store-badge img { height: 48px; width: auto; }
.store-badge:hover { transform: translateY(-2px); }
.app-web {
  display: inline-flex; align-items: center; gap: .45em; min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: border-color .2s;
}
.app-web .icon { width: 16px; height: 16px; }
.app-web:hover { border-color: var(--ink); }

/* Feature card layout */
@media (min-width: 640px) { .app--feature .app-hl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .app--feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
}

/* Device frames (pure CSS) */
.phone {
  container-type: inline-size;
  position: relative;
  padding: 3.3%;
  border-radius: 16.5% / 7.7%;
  background: linear-gradient(150deg, #4a4d55 0%, #1a1b1f 18%, #0c0d10 50%, #26282d 85%, #44474e 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / .14),
    inset 0 0 0 4px #050506,
    0 2px 2px rgb(0 0 0 / .2),
    0 40px 70px -28px rgb(0 0 0 / .65);
}
.phone img { width: 100%; height: auto; border-radius: 13.6% / 6.3%; background: #000; }
.phone::after { /* Dynamic Island */
  content: ""; position: absolute; left: 50%; top: 6.4cqw;
  width: 25cqw; height: 7.4cqw; transform: translateX(-50%);
  border-radius: 999px; background: #000;
}
.phone::before { /* side button */
  content: ""; position: absolute; right: -1.2%; top: 26%; width: 1.4%; height: 11%;
  border-radius: 0 3px 3px 0; background: linear-gradient(90deg, #2a2c31, #4a4d55);
}

.watch { position: relative; }
.watch-body {
  position: relative; padding: 8%;
  border-radius: 31% / 26%;
  background: linear-gradient(150deg, #55585f, #1b1c20 30%, #0a0a0c 60%, #34363b);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16), inset 0 0 0 4px #050506, 0 30px 50px -22px rgb(0 0 0 / .7);
}
.watch-body img { width: 100%; height: auto; border-radius: 24% / 20%; }
.watch-body::after { /* crown */
  content: ""; position: absolute; right: -4.5%; top: 24%; width: 6%; height: 16%;
  border-radius: 3px; background: linear-gradient(90deg, #3c3e44, #77797f 60%, #3c3e44);
}

.app-visual { position: relative; display: grid; place-items: center; transform-style: preserve-3d; }
.app-visual[data-tilt] { transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease); }
.app-visual--fan { min-height: clamp(420px, 70vw, 640px); }
.app-visual--fan .phone { position: absolute; width: 42%; max-width: 290px; }
.app-visual--fan .phone--front { z-index: 3; width: 46%; max-width: 300px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.app-visual--fan .phone--left { z-index: 1; left: 3%; top: 50%; transform: translateY(-46%) rotate(-8deg); filter: brightness(.86); }
.app-visual--fan .phone--right { z-index: 2; right: 3%; top: 50%; transform: translateY(-44%) rotate(7deg); filter: brightness(.86); }
.app-visual--fan .watch { position: absolute; z-index: 4; width: 25%; max-width: 168px; right: 6%; bottom: 2%; transform: rotate(4deg); }

/* Pair cards */
.app-pair { display: grid; gap: clamp(20px, 2.4vw, 32px); margin-top: clamp(20px, 2.4vw, 32px); }
@media (min-width: 1024px) { .app-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-pair .app { grid-template-rows: auto 1fr; padding-bottom: 0; }
.app-pair .app-visual { align-self: end; height: clamp(340px, 46vw, 440px); overflow: hidden; place-items: start center; margin-inline: calc(-1 * clamp(24px, 4.4vw, 72px)); padding-top: 8px; }
.app-pair .phone--solo { width: min(62%, 270px); }

/* ---------- 03 Book ---------- */
.book { overflow: clip; background: var(--bg-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .book { background: var(--bg); } }
:root[data-theme="dark"] .book { background: var(--bg); }
.book-grid { display: grid; gap: clamp(32px, 4.5vw, 72px); align-items: center; }
@media (min-width: 960px) { .book-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.book-stage {
  position: relative; display: grid; place-items: center;
  padding-block: clamp(24px, 4vw, 60px);
  perspective: 1800px;
}
.book-lamp {
  position: absolute; inset: -20% -30%; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgb(255 190 120 / .55), rgb(255 150 80 / .12) 55%, transparent 75%);
  filter: blur(10px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .book-lamp { background: radial-gradient(closest-side, rgb(255 170 90 / .32), rgb(255 120 50 / .08) 55%, transparent 75%); } }
:root[data-theme="dark"] .book-lamp { background: radial-gradient(closest-side, rgb(255 170 90 / .32), rgb(255 120 50 / .08) 55%, transparent 75%); }
.book3d {
  --w: min(64vw, 340px);
  --d: calc(var(--w) * .07);
  position: relative; z-index: 1;
  width: var(--w); aspect-ratio: 846 / 1200;
  transform-style: preserve-3d;
  transform: rotateY(30deg) rotateX(4deg) rotateZ(-1deg);
  transition: transform 1.2s var(--ease);
}
.book-stage[data-tilt] .book3d { transform: rotateY(calc(30deg + var(--ry, 0deg))) rotateX(calc(4deg + var(--rx, 0deg))) rotateZ(-1deg); }
.book-stage:hover .book3d { transform: rotateY(14deg) rotateX(2deg); }
.book3d > div { position: absolute; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.book3d-front { inset: 0; transform: translateZ(calc(var(--d) / 2)); border-radius: 2px 5px 5px 2px; overflow: hidden; background: #fdf3e3; }
.book3d-front img { width: 100%; height: 100%; object-fit: cover; }
.book3d-front::after { /* hinge crease + lighting */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .16) 0%, rgb(255 255 255 / .35) 1.6%, rgb(0 0 0 / .08) 3.2%, transparent 7%),
    linear-gradient(115deg, rgb(255 255 255 / .18), transparent 40%, rgb(0 0 0 / .06));
}
.book3d-spine {
  top: 0; left: calc(var(--d) / -2); width: var(--d); height: 100%;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #e9dcc6, #f7ecda 40%, #e3d3ba);
  display: grid; place-items: center; overflow: hidden;
}
.book3d-spine span {
  writing-mode: vertical-rl; white-space: nowrap;
  font-family: var(--font-display); font-weight: 650; font-size: calc(var(--d) * .42); letter-spacing: .02em; color: #a0522d;
}
.book3d-pages {
  top: 1%; height: 98%; width: calc(var(--d) - 2px); left: calc(var(--w) - var(--d) / 2 - 3px);
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f4efe6 0 1px, #ddd5c6 1px 2px);
}
.book3d-back { inset: 0; transform: translateZ(calc(var(--d) / -2)) rotateY(180deg); background: #efe3cf; border-radius: 5px 2px 2px 5px; }
.book-shadow {
  position: absolute; z-index: 0; left: 50%; bottom: clamp(4px, 1.6vw, 24px);
  width: calc(min(64vw, 340px) * 1.05); height: 36px; transform: translateX(-46%);
  border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / .45), transparent);
  filter: blur(8px);
}
.book-headline { font-size: clamp(2rem, 1.2rem + 3.2vw, 4.6rem); max-width: 18ch; }
.book-name { margin-top: clamp(24px, 3vw, 36px); font-family: var(--font-display); font-weight: 650; font-size: clamp(1.25rem, 1.05rem + .7vw, 1.7rem); line-height: 1.2; letter-spacing: -.02em; }
.book-sub { color: var(--accent-ink); }
.book-claim { margin-top: 6px; color: var(--ink-3); font-size: .95rem; }
.book-blurb { margin-top: 20px; color: var(--ink-2); max-width: 40rem; font-size: clamp(1.02rem, 1rem + .2vw, 1.15rem); text-wrap: pretty; }
.book-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.book-facts li { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .86rem; font-weight: 500; }
.book-note { margin-top: 18px; font-size: .92rem; color: var(--ink-3); }
.book-actions { margin-top: 30px; }
.book-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 22px; font-size: .95rem; }
.book-buy .mono { font-size: .64rem; color: var(--ink-3); }
.book-buy a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.book-buy a:hover { color: var(--accent-ink); }
.book-meta { margin-top: 18px; color: var(--ink-3); font-size: .64rem; line-height: 1.9; letter-spacing: .12em; }

/* ---------- 04 Contact ---------- */
.contact { overflow: clip; padding-bottom: clamp(48px, 5vw, 88px); }
.contact-beam {
  position: absolute; inset: 0; pointer-events: none;
  background:
    conic-gradient(from 180deg at 72% -10%, transparent 0deg, color-mix(in srgb, var(--accent) 22%, transparent) 14deg, transparent 30deg),
    radial-gradient(50% 40% at 72% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: .5;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .contact-beam { opacity: 1; } }
:root[data-theme="dark"] .contact-beam { opacity: 1; }
.contact .wrap { position: relative; }
.contact-title {
  font-family: var(--font-display); font-weight: 720;
  font-size: clamp(3rem, 1.2rem + 8.6vw, 12rem); line-height: .88; letter-spacing: -.055em;
  text-wrap: balance; max-width: 13ch;
}
.contact-title em { font-style: normal; color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .contact-title em { text-shadow: 0 0 40px rgb(255 106 43 / .45); } }
:root[data-theme="dark"] .contact-title em { text-shadow: 0 0 40px rgb(255 106 43 / .45); }
.contact-grid { display: grid; gap: 40px; margin-top: clamp(48px, 6vw, 88px); }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 80px; } }
.contact-text { font-size: clamp(1.1rem, 1rem + .45vw, 1.4rem); line-height: 1.55; color: var(--ink-2); max-width: 30rem; text-wrap: pretty; }
.contact-list { display: grid; border-top: 1px solid var(--line-2); }
.contact-row { display: grid; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 600px) { .contact-row { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; } }
.contact-k { color: var(--ink-3); font-size: .68rem; }
.contact-mail {
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.3rem, 1rem + 1.4vw, 2.2rem); letter-spacing: -.03em; line-height: 1.15;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .18em;
  overflow-wrap: anywhere;
  transition: color .2s;
}
.contact-mail:hover { color: var(--accent-ink); }
.contact-link { display: inline-flex; align-items: center; gap: .4em; min-height: 40px; font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.contact-link .icon { width: 15px; height: 15px; color: var(--ink-3); transition: transform .2s var(--ease), color .2s; }
.contact-link:hover .icon { transform: translate(2px, -2px); color: var(--accent-ink); }
.contact-sites { display: flex; flex-wrap: wrap; gap: 0 22px; }
.contact-place { margin-top: clamp(40px, 5vw, 64px); color: var(--ink-3); font-size: .68rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 max(36px, env(safe-area-inset-bottom)); font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: auto 1fr auto auto; gap: 40px; } }
.footer-sign { display: flex; flex-direction: column; gap: 4px; }
.footer-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.03em; }
.footer-sign .mono { font-size: .64rem; color: var(--ink-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.seg { display: inline-flex; gap: 2px; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); width: max-content; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: .85rem; font-weight: 500; color: var(--ink-2); transition: background-color .2s, color .2s; }
.seg-opt input:checked + span { background: var(--ink); color: var(--bg); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer-top { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.footer-top:hover { color: var(--ink); }
.footer-top .icon { width: 16px; height: 16px; }

/* ---------- Legal pages ---------- */
.page-legal main { padding-top: clamp(110px, 14vw, 160px); padding-bottom: clamp(72px, 9vw, 120px); }
.legal { max-width: 780px; }
.legal-back { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; margin-bottom: 28px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.legal-back:hover { color: var(--ink); }
.legal-note { margin-bottom: 32px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .95rem; }
.legal-body h1 { hyphens: auto; overflow-wrap: break-word; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 1rem + 4.4vw, 4.6rem); line-height: .98; letter-spacing: -.045em; margin-bottom: clamp(28px, 4vw, 48px); }
.legal-body h2 { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.15rem, 1.05rem + .4vw, 1.4rem); letter-spacing: -.015em; margin: 2.2em 0 .6em; }
.legal-body p, .legal-body li { color: var(--ink-2); max-width: 68ch; }
.legal-body p + p { margin-top: .8em; }
.legal-body ul { padding-left: 1.2em; margin: .6em 0; display: grid; gap: .35em; }
.legal-body a { color: var(--ink); }
.legal-body code { font-family: var(--font-mono); font-size: .85em; padding: .1em .35em; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }
.legal-updated { margin-top: 48px; color: var(--ink-3); font-size: .68rem; }

/* ---------- Theme switch: View Transition circle reveal ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.vt-theme::view-transition-new(root) { animation: vt-reveal .7s var(--ease-in-out) both; }
@keyframes vt-reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); } to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0)); } }

/* ---------- Reduced motion: switch off every non-essential movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .app-visual[data-tilt], .book-stage[data-tilt] .book3d { transform: none; }
  .book3d { transform: rotateY(24deg) rotateX(3deg); }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .ticker, .hero-media, .hero-actions, .setlist, .filters, .reel-wrap, .lightbox, .seg, body::after, .masonry, .portrait { display: none !important; }
  .hero-stage { min-height: 0; color: #000; background: none; }
  .hero-shade { display: none; }
}
