/* MusicTab prototype, world B "MUSIC / TAB": tokens, type, tabs, markers, strings, the night room, header, phone menu.
   Home layout lives in css/home.css. Direction: design/direction-B.md. */

/* The statement face: static wdth 62 / wght 900 instance, overlaps removed, so a stroked outline has no inner seams. */
@font-face {
  font-family: 'Archivo Statement';
  src: url('../assets/fonts/archivo-62-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo Statement Fallback';
  src: local('Arial Narrow'), local('ArialNarrow'), local('Arial');
  font-weight: 900;
  size-adjust: 112%;
  ascent-override: 87.8%;
  descent-override: 21%;
  line-gap-override: 0%;
}

@property --wdth {
  syntax: '<number>';
  inherits: true;
  initial-value: 100;
}

:root {
  --night: #0C0A0B;
  --night-ink: #F4EFEA;
  --night-muted: #A8A19B;
  --vermilion: #EC5C34;
  --on-vermilion: #0C0A0B;
  --violet: #AC73FF;
  --sheet: #F3F1F7;
  --sheet-ink: #17121F;
  --violet-deep: #5A2BC2;
  --mix: linear-gradient(90deg in oklch shorter hue, var(--violet), var(--vermilion));

  --rise-music: 520ms;
  --ease-swell: cubic-bezier(.16, .84, .24, 1);
  --rise-biz: 320ms;
  --ease-tick: cubic-bezier(.2, .7, .2, 1);
  --fall: 240ms;
  --ease-fall: cubic-bezier(.5, 0, .75, 0);
  --xfade: 700ms;
  --micro: 120ms;
  --page-music: 640ms;
  --ease-page-music: cubic-bezier(.7, 0, .2, 1);
  --page-biz: 480ms;
  --ease-page-biz: cubic-bezier(.4, 0, .2, 1);

  --amax-music: 9;
  --amax-business: 3;
  --margin: 20px;
  /* One frame line for all text and chrome on every page; use only on a full-width box (100% = that box).
     The frame IS the margin: text, headings and media share one left edge at every width, and a page reads as one grid. Only running
     text is narrowed (max-width: var(--measure)), never the page. Past --page the gutters grow together and the content width holds,
     so a very wide screen gets air around the same composition instead of longer lines. */
  --page: 1920px;
  --frame: max(var(--margin), calc((100% - var(--page)) / 2));
  --measure: 48ch; /* running text's line: 48ch is about 69 characters in Archivo, whose 0 is wide (1ch ≈ 1.44 characters) */
  --hdr: 56px;
  --level: .5;
  --font: 'Archivo', 'Archivo Statement Fallback', 'Arial Narrow', Arial, sans-serif;
  --font-statement: 'Archivo Statement', 'Archivo Statement Fallback', 'Arial Narrow', sans-serif;
}
@media (min-width: 640px) {
  :root {
    --margin: 32px;
  }
}
@media (min-width: 1024px) {
  :root {
    --margin: 72px;
    --hdr: 72px;
    --amax-music: 12;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--night);
  color: var(--night-ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings:
    'wdth' 100,
    'wght' 400;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
img,
video {
  display: block;
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--night-ink);
  outline-offset: 3px;
}
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure {
  display: none !important;
}

/* ───────── Type roles ───────── */
.t-label {
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variation-settings:
    'wdth' 112,
    'wght' 600;
}
.t-music-title {
  /* titles of the music practice; js/kinetic.js moves --wdth. 1.28 is the least line pitch at which the tallest stack of Vietnamese marks (1.057em above the baseline) clears the deepest dot on the line above (.183em below): 1.24em plus a gap. */
  --wdth: 62;
  font-variation-settings:
    'wdth' var(--wdth),
    'wght' 900;
  text-transform: uppercase;
  line-height: 1.28;
  letter-spacing: -0.01em;
  word-spacing: 0.1em;
}
.t-biz-title {
  font-variation-settings:
    'wdth' 82,
    'wght' 700;
  line-height: 1.18;
} /* mixed case: marks reach .92em above the baseline, descenders .21em below, so lines touch under 1.13 */

/* ───────── Markers: music = solid vermilion square, business = violet outlined square ───────── */
.mk {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
}
.mk--music {
  background: var(--vermilion);
}
.mk--biz {
  box-shadow: inset 0 0 0 1.5px var(--violet);
}

/* ───────── Tabs: a rectangle whose right end leans 14° (the slant of the logo's T and A) ─────────
   --hh is the height, --s the slant run, --k the contour stroke. The shape sits on ::before so text stays unclipped. */
.tab {
  --hh: 44px;
  --s: calc(var(--hh) * .25);
  --k: 1.5px;
  --tab-bg: var(--vermilion);
  --tab-fg: var(--on-vermilion);
  --tab-line: var(--violet);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--hh);
  padding: 0 calc(var(--s) + 14px) 0 20px;
  white-space: nowrap;
  color: var(--tab-fg);
  font-size: 14px;
  line-height: 1;
  font-variation-settings:
    'wdth' 100,
    'wght' 650;
}
.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--tab-bg);
  clip-path: polygon(0 0, calc(100% - var(--s)) 0, 100% 100%, 0 100%);
}
.tab--ink {
  --tab-bg: var(--night-ink);
  --tab-fg: var(--night);
}
.tab--line {
  --tab-fg: var(--night-ink);
}
.tab--act {
  --tab-bg: var(--violet-deep);
  --tab-fg: var(--sheet);
} /* the business action: one filled tab on the day sheet, wherever the page's one action sits */
.tab--line::before {
  background: var(--tab-line);
  clip-path: polygon(
    evenodd,
    0 0,
    calc(100% - var(--s)) 0,
    100% 100%,
    0 100%,
    0 0,
    var(--k) var(--k),
    calc(100% - var(--s) - var(--k) * 0.78) var(--k),
    calc(100% - var(--k) * 1.28) calc(100% - var(--k)),
    var(--k) calc(100% - var(--k)),
    var(--k) var(--k)
  );
}
.tab:focus-visible {
  outline: none;
}
.tab:focus-visible::after {
  --s: calc((var(--hh) + 10px) * .25);
  --k: 2px;
  content: '';
  position: absolute;
  inset: -5px;
  z-index: -2;
  background: var(--night-ink);
  clip-path: polygon(
    evenodd,
    0 0,
    calc(100% - var(--s)) 0,
    100% 100%,
    0 100%,
    0 0,
    var(--k) var(--k),
    calc(100% - var(--s) - var(--k) * 0.78) var(--k),
    calc(100% - var(--k) * 1.28) calc(100% - var(--k)),
    var(--k) calc(100% - var(--k)),
    var(--k) var(--k)
  );
}
@media (hover: hover) {
  .tab--ink:hover {
    --tab-bg: #fff;
  }
  .tab:not(.tab--ink):not(.tab--line):not(.tab--night):not(.tab--act):hover {
    --tab-bg: #F26C45;
  }
  .tab--act:hover {
    --tab-bg: var(--sheet-ink);
  }
}
.tab:active {
  translate: 0 1px;
}

/* ───────── Media controls: play, the strip and frame plays, and the theatre's close share the tab recipe and one look in every state:
   a filled tab in the branch colour, its glyph in the contrast ink. The control never changes with the film. "Playing" shows in the footage
   (the loop rises, its crest string plucks, a strip's title lights); hover answers on the control itself. Size is --hh (44px by default).
   Night: vermilion. The day sheet and the business pages: violet-deep. ───────── */
.play,
.theatre-close {
  --s: calc(var(--hh, 44px) * .25);
  --media: var(--vermilion);
  --media-hover: #F26C45;
  --media-on: var(--on-vermilion);
  position: relative;
  isolation: isolate;
  color: var(--media-on);
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: transform var(--micro) var(--ease-tick);
}
.play {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--hh, 44px);
  height: var(--hh, 44px);
}
.play svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  fill: currentColor;
}
.play::before,
.theatre-close::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--media);
  clip-path: polygon(0 0, calc(100% - var(--s)) 0, 100% 100%, 0 100%);
}
.play:active,
.theatre-close:active {
  transform: translateY(1px);
}
:is(html[data-branch='business'], .hero[data-branch='business'], .sheet) :is(.play, .theatre-close) {
  --media: var(--violet-deep);
  --media-hover: var(--sheet-ink);
  --media-on: var(--sheet);
}
@media (hover: hover) and (pointer: fine) {
  .play:hover::before,
  .theatre-close:hover::before {
    background: var(--media-hover);
  }
}

/* ───────── Strings: the crest engine's line (js/strings.js). Zero height; its svg is centred on the line. ───────── */
.string {
  --amax: var(--amax-music);
  position: relative;
  display: block;
  height: 0;
  pointer-events: none;
}
.string[data-branch='business'] {
  --amax: var(--amax-business);
}
.string__svg {
  position: absolute;
  left: 0;
  top: calc((var(--amax) + 1) * -1px);
  width: 100%;
  height: calc(var(--amax) * 2px + 2px);
  overflow: visible;
  pointer-events: none;
}
.string__svg path {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke: var(--crest, var(--vermilion));
  stroke-width: 2px;
}
.string[data-branch='business'] {
  --crest: var(--violet);
}
.string__svg.is-flash path {
  stroke-width: 4px;
}
/* A vertical string (data-orient="v"): its host is as long as the string and has no width; the svg is drawn along its length, then turned upright about its centre line. */
.string[data-orient='v'] {
  height: var(--len);
  width: 0;
}
.string[data-orient='v'] .string__svg {
  top: 0;
  left: 0;
  width: var(--len);
  transform-origin: 0 0;
  transform: translateX(calc(var(--amax) * 1px + 1px)) rotate(90deg);
}

/* The night room: the page's own ground, one tint in its hue, the film glow where a page has one (home, Táo), one fixed light of its own, and the vignette. Fixed, behind everything. */
.room {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--night);
  pointer-events: none;
}
.room__tint {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  transition: opacity var(--xfade) linear;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, var(--c, #7f2119) 0%, transparent 75%);
}
.room__light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 40% 50% at var(--key-at, 80% 34%),
      color-mix(in srgb, var(--key, transparent) 46%, transparent) 0%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 34% 42% at var(--counter-at, 12% 86%),
      color-mix(in srgb, var(--counter, transparent) 20%, transparent) 0%,
      transparent 72%
    );
}
/* The tint steps aside while the film's glow is lit, so two hues never mix into mud. */
.room.has-glow:not(.keeps-ground) .room__tint {
  opacity: 0;
}
.room__glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--xfade) linear;
}
.room__glow.is-on {
  opacity: 0.5;
}
.room__film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
/* Grading: the film's colour at full chroma and a luminance ceiling, so the glow reads as light from the film and not as a brown wash. */
.room__glow canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.room:not(.is-graded) .room__glow canvas {
  filter: saturate(1.6) contrast(1.15) brightness(0.8);
}
.room__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(12, 10, 11, 0.85));
}

/* ───────── Header ───────── */
.hdr {
  position: fixed;
  /* Above the open film (60) and its dim (50): the header and its sound switch stay usable over a film. */
  z-index: 70;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hdr);
  color: var(--night-ink);
  transition: transform var(--rise-biz) var(--ease-tick);
}
/* The ground is the branch's own night or sheet, opaque, and appears at once: nothing shows through the header. */
.hdr::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--night);
  opacity: 0;
}
.hdr.is-band::before {
  opacity: 1;
}
.hdr.is-snap {
  transition: none;
}
.hdr.is-hidden {
  transform: translateY(-100%);
}
/* An open film keeps the header in view, so its sound switch stays usable over the film (js/films.js). */
html:has(.theatre-player) .hdr.is-hidden {
  transform: none;
}
/* The day ground: home while its business sheet lies under the header (.is-sheet, js/system.js), and contact. The business branch keeps the night chrome: its opening
   screens are night, and one chrome that never changes with the ground below it reads as the same site as the music pages. */
html:not([data-branch='business']) .hdr.is-sheet {
  --night: var(--sheet);
  --night-ink: var(--sheet-ink);
  --night-muted: #5f5873;
}
:is(html[data-page='contact'] .hdr, html:not([data-branch='business']) .hdr.is-sheet)::before {
  box-shadow: inset 0 -1px 0 rgba(90, 43, 194, 0.28);
}
.hdr__in {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--frame);
  gap: 4px;
}
.hdr__logo {
  display: block;
  flex: none;
  margin-right: auto;
  padding: 8px 0;
}
.hdr__logo img {
  height: 22px;
  width: auto;
}
.hdr__nav,
.lang.hdr__lang,
.lang-toggle.hdr__lang {
  display: none;
}
.hdr__menu {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 0 0 12px;
}

.snd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--night-ink);
}
.snd[data-state='off'] {
  color: var(--night-muted);
}
.snd__icon {
  width: 24px;
  height: 24px;
  flex: none;
}
.snd__cone {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.snd__waves,
.snd__mute {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.snd[data-state='on'] .snd__waves {
  stroke: var(--vermilion);
}
.snd[data-state='on'] .snd__mute,
.snd[data-state='off'] .snd__waves {
  display: none;
}
/* Pages still on the old switch markup keep their label span hidden; it goes when they adopt the icon-only markup. */
.snd__t {
  display: none;
}

.hdr__contact {
  --hh: 40px;
  margin-left: 4px;
}

.nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  font-size: 14px;
  color: var(--night-muted);
  font-variation-settings:
    'wdth' 100,
    'wght' 600;
}
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  background: var(--vermilion);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--rise-biz) var(--ease-tick);
}
.nav[data-branch='business']::after {
  background: var(--violet);
}
.nav[aria-current='page'] {
  color: var(--night-ink);
}
.nav[aria-current='page']::after {
  transform: scaleX(1);
}
@media (hover: hover) {
  .nav:hover {
    color: var(--night-ink);
  }
  .nav:hover::after {
    transform: scaleX(1);
  }
}

.lang {
  display: inline-flex;
  align-items: center;
  height: 44px;
  font-size: 13px;
  color: var(--night-muted);
}
.lang [data-lang] {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  height: 44px;
  letter-spacing: 0.06em;
  font-variation-settings:
    'wdth' 100,
    'wght' 600;
}
.lang [data-lang][aria-pressed='true'],
.lang [data-lang][aria-current='true'] {
  color: var(--night-ink);
}
.lang i {
  font-style: normal;
  opacity: 0.5;
}
/* The one language item: the code of the other language. A click switches the language (js/system.js); without script it is a link to that page. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--night-ink);
  text-decoration: none;
  font-variation-settings:
    'wdth' 100,
    'wght' 600;
}
@media (hover: hover) and (pointer: fine) {
  .lang-toggle:hover {
    color: var(--vermilion);
  }
}

@media (min-width: 1024px) {
  .hdr__in {
    gap: 8px;
  }
  .hdr__logo img {
    height: 28px;
  }
  .hdr__nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-right: 12px;
  }
  .lang.hdr__lang,
  .lang-toggle.hdr__lang {
    display: inline-flex;
  }
  .hdr__menu {
    display: none;
  }
}

/* ───────── Phone menu: the night, the two branches as the two forms ───────── */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: var(--hdr) var(--margin) 32px;
  background: var(--night);
  overflow-y: auto;
}
.menu.is-open {
  display: flex;
}
.menu__nav {
  display: grid;
  gap: 12px;
}
.menu__link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 20px;
  font-size: 36px;
  line-height: 0.98;
}
.menu__link .mk {
  width: 12px;
  height: 12px;
}
.menu__link--music {
  line-height: 1.28;
  background: var(--vermilion);
  color: var(--on-vermilion);
  text-transform: uppercase;
  font-variation-settings:
    'wdth' 62,
    'wght' 900;
}
.menu__link--music .mk {
  background: var(--on-vermilion);
}
.menu__link--biz {
  box-shadow: inset 0 0 0 1.5px var(--violet);
  color: var(--night-ink);
  line-height: 1.1;
  font-variation-settings:
    'wdth' 82,
    'wght' 700;
}
/* The current branch: its label underlined, 2 px in the branch colour (design/pages-B.md §2.2). */
.menu__link[aria-current='page'] span {
  text-decoration: underline 2px var(--violet-deep);
  text-underline-offset: 6px;
}
.menu__link--music[aria-current='page'] span {
  text-decoration-color: var(--on-vermilion);
}
.menu__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}
.menu__foot .lang [data-lang] {
  height: 44px;
  padding: 0 12px 0 0;
  font-size: 15px;
}
.menu__foot .snd {
  margin-left: auto;
}
.menu__foot .lang-toggle {
  font-size: 15px;
  padding: 0 12px 0 0;
}
html.menu-open {
  overflow: hidden;
}
html.menu-open .hdr :is(.snd, .hdr__contact) {
  visibility: hidden;
} /* the menu's own foot carries both; only the close control stays above it */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
