/* Micro-interactions after framer.com (Andrew, 2026-11-23). Small, fast and
   functional: menus that answer hover, buttons that answer a press, cards that
   lift, and content that settles in once as it scrolls into view. Everything
   motion-related is off under prefers-reduced-motion. */
:root { --mi-ease: cubic-bezier(.2, .8, .2, 1); --mi-fast: 140ms; --mi-med: 220ms; }

/* Header: links brighten on hover (the chevron already flips on open). */
.site-nav .nav-links > a, .site-nav .nav-dropdown > summary { transition: color var(--mi-fast) ease, opacity var(--mi-fast) ease; }
.site-nav .nav-links > a:hover, .site-nav .nav-dropdown > summary:hover, .site-nav .nav-dropdown[open] > summary { color: #fff; }

/* Menu panel: fades in and settles from just above. */
@keyframes mi-drop { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.site-nav .nav-dropdown[open] > .nav-dropdown-menu { animation: mi-drop var(--mi-med) var(--mi-ease); transform-origin: top center; }
.site-nav .nav-dropdown-menu a { transition: color var(--mi-fast) ease, background-color var(--mi-fast) ease; }

/* Buttons: a touch brighter on hover, a short press when clicked. */
.button, .nav-cta, .hp-link, .be-goal-action { transition: color var(--mi-fast) ease, background-color var(--mi-fast) ease, border-color var(--mi-fast) ease, filter var(--mi-fast) ease, transform var(--mi-fast) var(--mi-ease); }
.button:hover, .nav-cta:hover { filter: brightness(1.07); }
.button:active, .nav-cta:active { transform: scale(.97); transition-duration: 70ms; }

/* Inline text links: the underline comes in on hover. */
main p a:not([class]), main li a:not([class]) { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; transition: text-decoration-color var(--mi-fast) ease, color var(--mi-fast) ease; }
main p a:not([class]):hover, main li a:not([class]):hover { text-decoration-color: currentColor; }

/* Cards: lift, the picture inside moves in slightly, and a press settles. */
.be-goal-link, .hw-tile { transition: box-shadow var(--mi-med) var(--mi-ease), transform var(--mi-med) var(--mi-ease); }
.be-goal-link:hover { transform: translateY(-2px); }
body .be-goal-link:active, body.home-page .hw-tile:active { transform: translateY(0) scale(.99); transition-duration: 90ms; }
.be-goal-image, .hv-frame { overflow: hidden; }
.be-goal-image img, .hv-frame img { transition: transform 600ms var(--mi-ease); }
.be-goal-link:hover .be-goal-image img, .hw-tile:hover .hv-frame img { transform: scale(1.03); }
.hw-tile .hw-go svg { transition: transform var(--mi-med) var(--mi-ease); }
.hw-tile:hover .hw-go svg { transform: translateX(2px); }

/* Scroll-in: set up only by micro-interactions.js, so without it nothing is hidden. */
html.mi-ready .mi-reveal { opacity: 0; transform: translateY(16px); filter: blur(4px); transition: opacity 520ms var(--mi-ease), transform 620ms var(--mi-ease), filter 520ms var(--mi-ease); transition-delay: var(--mi-delay, 0ms); }
html.mi-ready .mi-reveal.mi-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .site-nav .nav-dropdown[open] > .nav-dropdown-menu { animation: none; }
  .button:active, .nav-cta:active, .be-goal-link:hover, body .be-goal-link:active, body.home-page .hw-tile:active { transform: none; }
  .be-goal-link:hover .be-goal-image img, .hw-tile:hover .hv-frame img, .hw-tile:hover .hw-go svg { transform: none; }
  html.mi-ready .mi-reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* Page rhythm, same reference as the homepage (Andrew, 2026-11-23): sections
   sit on one page background instead of tinted boxes in mint, off-white and
   tan, and their content lines up with the page grid. Product UI (the white
   demo workspace) and the dark closing band keep their own surface. */
body.ps-site [data-buyer-entry] .be-buyer-section.be-outcomes, body.ps-site [data-buyer-entry] .be-how-to-use.be-how-to-use, body.ps-site [data-buyer-entry] .be-buyer-section.be-implementation,
body .be-buyer-section.be-outcomes, body .be-how-to-use, body .be-buyer-section.be-implementation {
  background: transparent; border-radius: 0; padding-left: 0; padding-right: 0;
}
body .section.industry-cta-section.studio-section { background: transparent; }

/* Type and surfaces after pentagram.com and linear.app (Andrew, 2026-11-23),
   inside the Fortune AI VI (Noto Sans, navy, cream): lighter and tighter
   headings, hierarchy carried by colour rather than weight, and cards drawn
   with a hairline instead of a drop shadow. Sizes stay with each template;
   weight, tracking and leading are set here for every page, so these use
   !important over the templates' own heading weights. */
:is(h1, h2) { font-weight: 560 !important; letter-spacing: -.022em !important; line-height: 1.1 !important; }
:is(h3, h4) { font-weight: 600 !important; letter-spacing: -.012em !important; line-height: 1.3 !important; }
footer :is(h2, h3, h4) { letter-spacing: 0 !important; }
/* Japanese: no negative tracking, a little more leading. */
:lang(ja) :is(h1, h2, h3, h4) { letter-spacing: 0 !important; line-height: 1.4 !important; word-break: auto-phrase; }
.ip-phrase { display: inline-block !important; max-width: 100%; }
:is(h1, h2, h3, h4) { font-feature-settings: "kern" 1; text-rendering: optimizeLegibility; }

/* Type scale: headings a step larger so the headline carries the section,
   set through the site's own scale variables (reading and layout systems),
   so every template follows. Body sizes stay. */
/* Text scale after the Fortune AI control-plane deck rules (Andrew,
   2026-11-24): every size is a whole pixel, stepped by screen width instead
   of sliding with the viewport (which produced 17.28px, 43.2px and so on),
   and each text role keeps one line spacing across the site. */
html body.studio-site[data-reading-template], :root:root {
  --reading-h1: 36px; --reading-h2: 28px; --reading-h3: 18px; --reading-body: 16px; --reading-lead: 17px;
  --layout-page-title: 36px; --layout-section-title: 28px;
}
@media (min-width: 768px) {
  html body.studio-site[data-reading-template], :root:root { --reading-h1: 48px; --reading-h2: 36px; --reading-h3: 20px; --reading-lead: 18px; --layout-page-title: 48px; --layout-section-title: 36px; }
}
@media (min-width: 1024px) {
  html body.studio-site[data-reading-template], :root:root { --reading-body: 17px; }
}
@media (min-width: 1280px) {
  html body.studio-site[data-reading-template], :root:root { --reading-h1: 60px; --reading-h2: 44px; --reading-h3: 22px; --reading-lead: 20px; --layout-page-title: 60px; --layout-section-title: 44px; }
}

/* Line spacing: body copy 1.6 (Japanese 1.8), captions and notes 1.5
   (Japanese 1.7). Never tighter to make text fit: cut or split instead.
   Product UI mock-ups keep their own spacing. */
main :is(p, li, dd, blockquote, td):not(:is(.hw-tile, .hv-frame, .ic-screen, .op-story-frame, .industry-chat, [data-chat], [class^="ov-"], .hc-systems, .be-goal-ui, table.ui) *) { line-height: 1.6 !important; }
main :is(figcaption, small, .note, .caption, .source-note):not(:is(.hw-tile, .hv-frame, .ic-screen, .op-story-frame, .industry-chat, [data-chat]) *) { line-height: 1.5 !important; }
:lang(ja) main :is(p, li, dd, blockquote, td):not(:is(.hw-tile, .hv-frame, .ic-screen, .op-story-frame, .industry-chat, [data-chat], [class^="ov-"], .hc-systems, .be-goal-ui, table.ui) *) { line-height: 1.8 !important; }
:lang(ja) main :is(figcaption, small, .note, .caption, .source-note):not(:is(.hw-tile, .hv-frame, .ic-screen, .op-story-frame, .industry-chat, [data-chat]) *) { line-height: 1.7 !important; }
/* Long list items wrap under their own text, not under the bullet. */
main :is(.article-body, .guide-reading, .studio-prose) :is(ul, ol) { padding-left: 1.25em; }
main :is(.article-body, .guide-reading, .studio-prose) li { padding-left: .15em; }

/* Surfaces: hairline border, smaller radius, no drop shadow; hover darkens the
   line instead of lifting a shadow. */
body.home-page :is(.hw-tile, .hw-customer, .hc-systems > li) { border: 1px solid rgba(15, 41, 73, .1); border-radius: 12px; box-shadow: none; }
body.home-page :is(.hw-tile, .hw-customer):hover { border-color: rgba(15, 41, 73, .24); box-shadow: 0 8px 24px -18px rgba(15, 41, 73, .35); }
body.home-page :is(.hw-view, .hv-alert) { border-radius: 8px; }
body.home-page .hw-tile:hover { transform: none; }

/* Other pages, same standard (Andrew, 2026-11-23).
   1. Section labels that repeat the heading under them ("The team" over
      "The people behind Fortune AI") are hidden. Labels over an item heading
      (h3: a role, an office, a guide type) stay, since they add information. */
:is(p.eyebrow, p.ps-eyebrow, p.dc-label, p.start-kicker):has(+ :is(h1, h2)),
p.eyebrow:has(+ .studio-intro-grid),
p.eyebrow:has(+ div > :is(h1, h2):first-child) { display: none !important; }
/* 2. No all-caps labels: the text is written in sentence case and shows as written. */
body :not(.site-nav *) { text-transform: none !important; }
:is(.blog-meta, .blog-topic-nav, .about-recognition-v2, .faq-industry-group) *, .guide-nav-label, .industry-proof-scene-label, .vertical-featured-insight strong { letter-spacing: 0 !important; }
/* 3. One page background: the blog's tan bands match the rest of the site. */
body :is(.blog-feature-section, .blog-archive-section, .start-cinema).section-cream, body .start-cinema { background: transparent !important; }
/* 4. Page and section headers: heading, then the intro under it, left aligned
      (the same layout as the homepage), instead of title left / intro far right. */
body :is(.studio-intro-grid, .about-hero-v2-grid, .about-team-v2 header) { display: block !important; }
body :is(.studio-lead-group, .about-hero-v2-copy) { max-width: 40rem; margin-top: 16px !important; margin-left: 0 !important; padding-top: 0 !important; }
body .about-team-v2 header > p { max-width: 40rem; margin-top: 12px; }

/* Stage tabs: labels start at the same top line whether they wrap to one
   line or two, so "01" no longer sits lower than "02" and "03" on phones. */
.ic-chapters button:not(.ic-auto) { justify-content: flex-start !important; }

/* The SkyDeck mark is pale gold; once greyed out for the trust strip it all
   but disappeared. Darken it so it reads at the same weight as the others. */
.home-page .home-trust-strip .home-trust-logos a img[src*="berkeley-skydeck"] { filter: grayscale(1) brightness(.5) contrast(1.5); }
.home-page .home-trust-strip .home-trust-logos a:is(:hover, :focus-visible) img[src*="berkeley-skydeck"] { filter: none; }

/* ------------------------------------------------------------------------
   Scroll motion after apple.com (Andrew, 2026-11-24). One orchestrated
   opening on the homepage, then motion that follows the scroll position
   rather than firing once: large pictures and films grow into place,
   section headings rise and sharpen as they arrive, and the hero recedes
   as you leave it. Easing is long and soft, nothing bounces or blurs.
   Scroll-linked parts use CSS scroll timelines (Chrome, Edge, Safari 26);
   other browsers simply show the page still. All of it is off under
   prefers-reduced-motion.
   ------------------------------------------------------------------------ */
:root { --ap-ease: cubic-bezier(.28, .11, .32, 1); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Opening: the picture settles from slightly closer, then the headline,
     its second sentence and the actions arrive in that order. */
  @keyframes ap-settle { from { transform: scale(1.08); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes ap-rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
  .home-interface-hero .home-interface-backdrop { animation: ap-settle 1.8s var(--ap-ease) both; }
  @keyframes ap-fade { from { opacity: 0; } to { opacity: 1; } }
  .home-interface-hero .home-interface-copy .eyebrow,
  .home-interface-hero h1,
  .home-interface-hero .story-hero-actions,
  .industry-detail-hero .studio-title-group, .industry-detail-hero .studio-lead-group,
  .about-hero-v2 h1, .about-hero-v2-copy { animation: ap-rise 1s var(--ap-ease) both; }
  .industry-detail-hero .studio-hero-visual { animation: ap-settle 1.6s var(--ap-ease) both; overflow: hidden; }
  .home-interface-hero h1 { animation-delay: .15s; }
  .home-interface-hero .hh-muted { animation: ap-fade 1.2s var(--ap-ease) .55s both; }
  .home-interface-hero .story-hero-actions { animation-delay: .7s; }
  .industry-detail-hero .studio-lead-group, .about-hero-v2-copy { animation-delay: .25s; }

  @supports (animation-timeline: view()) {
    /* Leaving the hero: the copy drifts up and fades, the picture lags behind. */
    @keyframes ap-recede { to { transform: translateY(-6vh); opacity: 0; } }
    @keyframes ap-lag { to { transform: translateY(10vh) scale(1.04); } }
    .home-interface-hero .home-interface-copy { animation: ap-recede linear both; animation-timeline: view(); animation-range: exit 0% exit 60%; }
    .home-interface-hero .home-interface-backdrop { animation: ap-settle 1.8s var(--ap-ease) both, ap-lag linear both; animation-timeline: auto, view(); animation-range: normal, exit 0% exit 100%; }

    /* Large pictures and films grow into place as they enter. */
    @keyframes ap-grow { from { transform: scale(.9); border-radius: 32px; opacity: .6; } to { transform: none; opacity: 1; } }
    :is(.op-story-frame, .industry-demo-player, .buyer-demo-player, .about-hero-film, .about-skydeck-v2-photo, .safe-swim-media, .industry-proof-scene, .be-outcomes figure, .ip-proof figure) {
      animation: ap-grow linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; overflow: hidden;
    }

    /* Section headings rise and sharpen with the scroll. */
    @keyframes ap-heading { from { transform: translateY(36px); opacity: 0; } to { transform: none; opacity: 1; } }
    main section h2:not(.site-nav *, details *, dialog *) { animation: ap-heading linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }

    /* The heading's intro follows a beat later. */
    main section :is(h2 + p, .hw-heading > p):not(.site-nav *, details *, dialog *) { animation: ap-heading linear both; animation-timeline: view(); animation-range: entry 20% entry 100%; }
  }

  /* Cards still arrive once (micro-interactions.js), now without the blur
     and on the same long ease. */
  html.mi-ready .mi-reveal { filter: none !important; transform: translateY(32px); transition: opacity .9s var(--ap-ease), transform 1.1s var(--ap-ease); transition-delay: var(--mi-delay, 0ms); }
}

/* The header firms up once the page has scrolled. */
.site-nav { transition: background-color .4s var(--ap-ease), min-height .4s var(--ap-ease), padding .4s var(--ap-ease); }
html.ap-scrolled .site-nav { background: rgba(6, 29, 48, .94); }
