/* Site header (the Industries menu, Showcase and Who we are), the lightbox and the case stories. Every page loads this after its own styles. */
/* Logo: the 3-1-4 tiles (three, one, four squares; the one in periwinkle) beside the name on two lines, "Studios" lighter underneath */
.tof-nav__brand { gap: 10px; }
.tof-nav__mark { display: block; flex: none; width: 22px; height: 30px; background: none; border-radius: 0; color: var(--cobalt); }
.tof-nav__name { display: grid; line-height: .95; }
.tof-nav__name b { font-weight: 700; letter-spacing: -0.035em; }
.tof-nav__name i { font-style: normal; font-weight: 400; font-size: .78em; letter-spacing: .01em; }
.tof-nav__links a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
.tof-menu { position: relative; }
.tof-menu > summary { display: inline-flex; align-items: center; gap: 8px; padding-block: 6px; list-style: none; cursor: pointer; color: var(--ink); font: 500 16px/1 var(--font-sans); letter-spacing: .04em; }
.tof-menu > summary::-webkit-details-marker { display: none; }
.tof-menu > summary::after { content: ""; width: 6px; height: 6px; margin-top: -4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.tof-menu[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.tof-menu > summary:hover, .tof-menu[open] > summary { color: var(--accent); }
.tof-menu.is-current > summary { box-shadow: inset 0 -2px 0 var(--accent); }
.tof-menu__panel { position: absolute; top: calc(100% + 22px); left: -12px; z-index: 30; display: grid; min-width: 300px; padding: 8px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(9, 12, 26, .12); }
.tof-nav__links .tof-menu__panel a, .tof-menu__panel span { display: block; padding: 12px; color: var(--ink); font: 500 16px/1.3 var(--font-sans); letter-spacing: 0; text-decoration: none; box-shadow: none; }
.tof-nav__links .tof-menu__panel a:hover, .tof-nav__links .tof-menu__panel a[aria-current] { background: var(--surface-alt); color: var(--accent); box-shadow: none; }
.tof-menu__panel span { color: var(--ink-muted); }
.tof-menu__panel small { display: block; margin-top: 4px; font: 500 11px/14px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
/* The language switch (site.js), at the right end of the links */
.tof-nav__links { flex: 1; }
.tof-lang { display: flex; align-self: center; margin-left: auto; }
.tof-nav__links .tof-lang a { padding: 6px 10px; color: var(--ink-muted); }
.tof-nav__links .tof-lang a[aria-current] { color: var(--ink); box-shadow: none; font-weight: 600; }
.tof-nav__links .tof-lang a:hover { color: var(--accent); }
.tof-lang a + a { border-left: 1px solid var(--line); }
:lang(de) :is(p, li, figcaption, .tof-pain) { hyphens: auto; hyphenate-limit-chars: 14 6 6; } /* only German's very long words break */

/* Lightbox (site.js): pictures and loops in frames open large */
:is(.tof-frame, .tof-demo__loop) :is(img, video):not(a *, button *) { cursor: zoom-in; }
.tof-lb { box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 60px 24px 24px; border: 0; background: transparent; cursor: zoom-out; }
.tof-lb[open] { display: grid; place-items: center; }
.tof-lb::backdrop { background: rgba(9, 12, 26, .92); }
.tof-lb figure { display: grid; justify-items: center; gap: 14px; width: 100%; margin: 0; }
.tof-lb img, .tof-lb video { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; }
.tof-lb figcaption { max-width: 64ch; color: rgba(255, 255, 255, .82); font: 500 15px/1.45 var(--font-sans); text-align: center; }
.tof-lb figcaption b { margin-right: 4px; color: #fff; font-weight: 600; }
.tof-lb__close { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; font: 300 36px/1 var(--font-sans); cursor: pointer; }
html:has(.tof-lb[open]) { overflow: hidden; }

/* Case stories (stories.js) in the segment pages' case pop-ups: a labelled main picture, then one row per beat, its "when" on the left and its pictures under its text */
.tof-modal__head .tof-tag { height: auto; min-height: 26px; padding-block: 4px; line-height: 18px; } /* a long case name wraps */
.cm-fig { margin: 0; }
.cm-fig .tof-frame { aspect-ratio: 3 / 4; }
.cm-fig .tof-frame > [data-media] { position: absolute; inset: 0; }
.cm-fig figcaption { margin-top: var(--space-2); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.cm-fig figcaption b { margin-right: 2px; color: var(--ink); font-weight: 600; }
.cm-main { max-width: 880px; margin-bottom: var(--space-8); }
.cm-main .tof-frame { aspect-ratio: 4 / 3; }
.cm-main figcaption { font-size: 15px; }
.cm-story { display: grid; max-width: 880px; margin: 0; padding: 0; list-style: none; }
.cm-story li { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: var(--space-6); padding: var(--space-6) 0 var(--space-8); border-top: 1px solid var(--line); }
.cm-story li > span { color: var(--ink-muted); font: 500 14px/28px var(--font-sans); }
.cm-story h4 { margin: 0 0 var(--space-2); color: var(--ink); font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.cm-story p { margin: 0; max-width: 66ch; color: var(--ink-body); font-size: 17px; line-height: 26px; }
.cm-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }

/* The menu button (site.js), shown on phones only: three lines that turn into a cross */
.tof-nav__burger { display: none; place-items: center; flex: none; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.tof-nav__burger i, .tof-nav__burger i::before, .tof-nav__burger i::after { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .2s ease; }
.tof-nav__burger i { position: relative; }
.tof-nav__burger i::before, .tof-nav__burger i::after { content: ""; position: absolute; left: 0; }
.tof-nav__burger i::before { top: -7px; }
.tof-nav__burger i::after { top: 7px; }
.tof-nav__burger[aria-expanded="true"] i { background: transparent; }
.tof-nav__burger[aria-expanded="true"] i::before { transform: translateY(7px) rotate(45deg); }
.tof-nav__burger[aria-expanded="true"] i::after { transform: translateY(-7px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .tof-nav__burger i::before, .tof-nav__burger i::after { transition: none; } }
.tof-nav__cta { display: none; }

/* Tablets: the header with the language switch still fits on one line */
@media (min-width: 761px) and (max-width: 960px) {
  header.top .tof-nav, .tof-nav__links { gap: 16px; }
  .tof-nav__links { margin-left: 8px; }
  .tof-nav__links a, .tof-menu > summary { letter-spacing: 0; white-space: nowrap; }
  .tof-nav__brand, header.top .tof-btn { flex: none; white-space: nowrap; }
  header.top .tof-btn__badge { display: none; }
  .tof-nav__links .tof-lang a { padding-inline: 6px; }
}
@media (max-width: 350px) { :lang(de) .tof-nav__name { display: none; } }

/* Phones: one header row with the logo, the call button and the menu button; the links open in a panel under it */
@media (max-width: 760px) {
  header.top .tof-nav { position: relative; height: 64px; gap: 12px; }
  .tof-nav__brand { gap: 8px; font-size: 17px; white-space: nowrap; }
  header.top .tof-btn { margin-left: auto; font-size: 15px; white-space: nowrap; }
  .tof-nav__burger { display: grid; }
  .tof-nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40; flex-direction: column; gap: 0; margin: 0;
    padding: 4px max(16px, env(safe-area-inset-left, 0px)) 24px; max-height: calc(100dvh - 64px); overflow-y: auto; box-sizing: border-box;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(9, 12, 26, .12); }
  .tof-nav.is-open .tof-nav__links { display: flex; }
  .tof-nav__links > a, .tof-menu > summary { display: flex; justify-content: space-between; padding-block: 16px; border-bottom: 1px solid var(--line); font-size: 20px; letter-spacing: 0; }
  .tof-nav__links a[aria-current], .tof-menu.is-current > summary { box-shadow: none; color: var(--accent); }
  .tof-menu__panel { position: static; min-width: 0; padding: 4px 0 12px; background: none; box-shadow: none; }
  .tof-nav__links .tof-menu__panel a, .tof-menu__panel span { padding: 10px 0 10px 16px; font-size: 17px; }
  /* German's longer button fits without its arrow */
  :lang(de) header.top .tof-nav { gap: 8px; }
  :lang(de) .tof-nav__brand { font-size: 15px; }
  :lang(de) header.top .tof-btn { font-size: 14px; }
  :lang(de) header.top .tof-btn__badge { display: none; }
  :lang(de) .tof-steps-inline { flex-wrap: wrap; }
  .tof-lang { align-self: start; margin: var(--space-4) 0 0 -16px; }
  .tof-nav__links .tof-lang a { padding: 12px 16px; font-size: 17px; }
  /* The panel ends on a large call button, cobalt like the form's Send */
  .tof-nav .tof-nav__links > .tof-nav__cta { display: flex; justify-content: space-between; align-items: center; height: 64px; margin-top: var(--space-6); padding: 0 8px 0 28px;
    border: 0; border-radius: var(--radius-pill); background: var(--cobalt); color: var(--on-cobalt); font: 600 20px/1 var(--font-sans); letter-spacing: 0; text-decoration: none; box-shadow: none; }
  .tof-nav__cta-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--night); color: var(--on-night); }
  .tof-nav__cta-badge svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* Edge to edge, so a landscape picture still grows */
  .tof-lb { padding-inline: 0; }
  .tof-lb figcaption { padding-inline: 16px; }
  .cm-main { margin-bottom: var(--space-6); }
  .cm-story li { grid-template-columns: 1fr; gap: var(--space-1); padding: var(--space-4) 0 var(--space-6); }
  .cm-story h4 { font-size: 19px; line-height: 25px; }
  .cm-story p { font-size: 16px; line-height: 24px; }
  .cm-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
}

/* Footer links */
footer a { display: inline-block; margin: 0 var(--space-4) 6px 0; color: var(--ink); text-decoration: none; white-space: nowrap; }
footer a:hover { color: var(--accent); }
