/* ==========================================================================
   Brightwell — shared styles
   Desktop reference: 1440px wide (Figma artboards). The page keeps growing past 1440
   the way brookfield.com does: wider container (cap 1760px at 1920+), more section space,
   taller media. Type and spacing are fluid from 375px and stop growing at 1920px.
   See RESPONSIVE.md for the full rules.
   Breakpoints: 640 (phone) · 768 · 900 (splits stack) · 960 (hamburger) · 1024 (12-col grid)
                · 1280 (4-up rows) · 1440 (Figma match) · 1920 (container cap)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --navy: #102239;
  --navy-2: #192F4C;          /* legal bar */
  --cream: #F7F5EC;
  --white: #FFFFFF;
  --accent: #4774FE;          /* links, primary buttons */
  --accent-light: #92ADFF;    /* labels on navy */
  --slate: #4A5A70;           /* secondary band background, muted text */
  --slate-light: #A6B1C1;     /* legal text */
  --line: #DDD9C9;            /* dividers on light surfaces */
  --line-soft: #ECE9DB;       /* column rules */
  --line-on-dark: rgba(255, 255, 255, 0.25);
  --dot: #B3AD99;

  /* Type */
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid from 375 to 1920: lands on the Figma size at 1440, then grows a little more to 1920. */
  --fs-display: clamp(2.5rem, 1.9842rem + 2.2006vw, 4.625rem);   /* 40 → 64 @1440 → 74 */
  --fs-h1: clamp(2.125rem, 1.7913rem + 1.4239vw, 3.5rem);        /* 34 → 48 @1440 → 56 */
  --fs-h2: clamp(1.875rem, 1.6019rem + 1.1650vw, 3rem);          /* 30 → 42 @1440 → 48 */
  --fs-h3: clamp(1.625rem, 1.4126rem + 0.9061vw, 2.5rem);        /* 26 → 36 @1440 → 40 */
  --fs-h4: clamp(1.5rem, 1.3483rem + 0.6472vw, 2.125rem);        /* 24 → 32 @1440 → 34 */
  --fs-h5: clamp(1.375rem, 1.2536rem + 0.5178vw, 1.875rem);      /* 22 → 28 @1440 → 30 */
  --fs-h6: clamp(1.25rem, 1.1438rem + 0.4531vw, 1.6875rem);      /* 20 → 26 @1440 → 27 */
  --fs-lead: clamp(1.125rem, 1.0036rem + 0.5178vw, 1.625rem);    /* 18 → 24 @1440 → 26 */
  --fs-xl: clamp(1.125rem, 1.0795rem + 0.1942vw, 1.3125rem);     /* 18 → 20 @1440 → 21 */
  --fs-lg: 1.125rem;                                        /* 18 */
  --fs-md: 1rem;                                            /* 16 */
  --fs-sm: 0.875rem;                                        /* 14 */

  --lh-tight: 1.12;
  --lh-snug: 1.24;
  --lh-ui: 1.48;
  --lh-body: 1.62;

  /* Layout (Brookfield-style: the page grows past 1440, the text measure doesn't) */
  --content: 1760px;                                   /* container cap, reached at 1920 */
  --content-narrow: 1120px;                            /* long-form: legal, articles */
  --gutter: clamp(20px, 9.3px + 2.848vw, 80px);        /* 20 @375 · 50 @1440 · 64 @1920 · 80 @2480 */
  --grid-gap: clamp(16px, 12.1px + 1.036vw, 32px);     /* 12-col gap: 24 @1024 · 27 @1440 · 32 @1920 */
  --measure: 66ch;                                     /* max line length for running text */
  /* Section rhythm grows with width but is also capped by screen HEIGHT, so a wide-but-short laptop
     (e.g. 1728×960) doesn't get towering sections: min(width-based value, % of viewport height). */
  --section-pt: min(clamp(64px, 48.5px + 4.142vw, 128px), max(64px, 9.5svh));  /* 64 → 108 @1440 → 128 */
  --section-pb: min(clamp(72px, 50.6px + 5.696vw, 160px), max(72px, 11svh));   /* 72 → 133 @1440 → 160 */
  --space-block: min(clamp(40px, 22.5px + 4.660vw, 112px), max(40px, 8.5svh)); /* heading block → content */
  --space-stack: clamp(24px, 18.2px + 1.553vw, 48px);  /* between stacked items */
  --header-h: 104px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.on-dark :focus-visible, .site-header :focus-visible { outline-color: var(--accent-light); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--white); color: var(--navy); padding: 12px 18px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }
.section { padding-block: var(--section-pt) var(--section-pb); }
.section--tight { padding-block: clamp(48px, 4.2vw, 60px); }

.bg-navy { background: var(--navy); }
.bg-slate { background: var(--slate); }
.bg-cream { background: var(--cream); }
.bg-white { background: var(--white); }
.on-dark { color: var(--white); }

/* 12-column grid (≥1024). Figma widths on the 1344 artboard map to spans:
   1344→12 · 889→8 · 774→7 · 660→6 · 546→5 · 432→4 · 318→3. Columns grow with the container,
   so wide screens get wider blocks instead of a bigger hole in the middle. */
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: 24px; }

/* Two-column split used throughout: heading/text left (6 cols), copy right (4 cols from col 9).
   Override per section with --a-span, --b-start, --b-span. */
.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: 24px;
  align-items: start;
}
.split > :first-child { grid-column: 1 / span var(--a-span, 6); }
.split > :nth-child(2) { grid-column: var(--b-start, 9) / span var(--b-span, 4); }
.split > :nth-child(n+3) { grid-column: 1 / -1; }
.split--center { align-items: center; }
.split--end { align-items: end; }

/* Equal column grids */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1279px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > * { grid-column: 1 / -1 !important; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Readable line length for running text, at any screen width */
.measure { max-width: var(--measure); }
@media (min-width: 768px) and (max-width: 1023px) { .text-lg, .text-md, .lead { max-width: var(--measure); } }

/* Stacks */
.stack > * + * { margin-top: var(--stack, 18px); }

/* ---------- Typography ---------- */
.display, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font-serif); font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
.display { font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: -0.03em; }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.035em; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: -0.01em; }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.h4 { font-size: var(--fs-h4); line-height: var(--lh-tight); letter-spacing: -0.01em; }
.h5 { font-size: var(--fs-h5); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.h6 { font-size: var(--fs-h6); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.display em, .h1 em, .h2 em, .h3 em, .h4 em, .h5 em, .h6 em { font-style: italic; }

/* Sans headings (card titles etc.) */
.title-lg { font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.375rem, 1.236rem + 0.5714vw, 1.75rem); line-height: var(--lh-tight); letter-spacing: -0.01em; } /* 28 */
.title-md { font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.25rem, 1.157rem + 0.381vw, 1.5rem); line-height: var(--lh-tight); letter-spacing: -0.01em; }   /* 24 */
.title { font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.188rem, 1.141rem + 0.1905vw, 1.312rem); line-height: var(--lh-tight); }                      /* 21 */
.title-light { font-family: var(--font-sans); font-weight: 400; font-size: clamp(1.5rem, 1.361rem + 0.5714vw, 1.875rem); line-height: var(--lh-snug); letter-spacing: -0.01em; } /* 30 */

.eyebrow { font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-md); line-height: var(--lh-ui); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-snug); }
.text-xl { font-size: var(--fs-xl); line-height: var(--lh-ui); }
.text-lg { font-size: var(--fs-lg); line-height: var(--lh-body); }
.text-md { font-size: var(--fs-md); line-height: var(--lh-body); }
.text-sm { font-size: var(--fs-sm); line-height: var(--lh-body); }
.text-lg p + p, .text-md p + p, .text-xl p + p, .text-sm p + p { margin-top: 1.62em; } /* Figma uses a full blank line between paragraphs */
.text-muted { color: var(--slate); }
strong, b { font-weight: 700; }

/* Section heading block: eyebrow + heading (+ optional copy) */
.section-head { display: grid; gap: 18px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 18px 24px;
  font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 400; line-height: var(--lh-tight); letter-spacing: -0.01em;
  border: 1px solid currentColor; background: transparent; color: var(--navy);
  text-align: center; transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.on-dark .btn, .btn--light, .hero-panel__panel .btn { color: var(--white); }
.on-dark .btn:hover, .btn--light:hover, .hero-panel__panel .btn:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--white); }
.btn--primary:hover { background: #2F5CE6; border-color: #2F5CE6; color: var(--white); }
.on-dark .btn--primary { color: var(--white); }
.on-dark .btn--primary:hover { background: #2F5CE6; border-color: #2F5CE6; color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 18px; }

/* Underlined text link with arrow ("Explore Solar →") */
.link-arrow {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 24px;
  min-width: 180px; padding-bottom: 6px; border-bottom: 1px solid currentColor;
  font-size: var(--fs-md); line-height: 1; letter-spacing: -0.01em;
  position: relative;
}
.link-arrow::before { content: ""; position: absolute; inset: -16px 0 -6px; } /* ≥44px tap area without changing layout */
.link-arrow svg { width: 12px; height: 12px; flex: none; transition: transform .2s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

.link-accent { color: var(--accent); font-weight: 600; }
.link-accent:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-underline { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Media ---------- */
.media { position: relative; overflow: hidden; background: #d9d6cc; }
.media > img { width: 100%; height: 100%; object-fit: cover; }
.ratio { aspect-ratio: var(--ratio, 16 / 9); }

/* Image card with white panel inset at the bottom-left */
.image-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: var(--card-h, 463px); padding: 120px 90px 18px 18px; overflow: hidden; isolation: isolate;
}
.image-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.image-card__panel { background: var(--white); color: var(--navy); padding: 24px; }
@media (max-width: 640px) {
  .image-card { padding: 160px 12px 12px; min-height: 0; }
}

/* Video thumbnail with play button */
.video-thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; overflow: hidden; cursor: pointer; }
.video-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb::after { content: ""; position: absolute; inset: 0; background: var(--video-overlay, transparent); }
.play-btn {
  position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: clamp(56px, 5.6vw, 80px); aspect-ratio: 1; background: var(--white); color: var(--navy);
  transition: transform .2s ease;
}
.play-btn svg { width: 44%; height: 44%; margin-left: 8%; }
.video-thumb:hover .play-btn { transform: translate(-50%, -50%) scale(1.06); }

/* Device-frame screenshot (product/portal imagery) */
.screen { border: 16px solid #000; border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); background: #000; overflow: hidden; }
.screen img { width: 100%; height: auto; }
@media (max-width: 640px) { .screen { border-width: 8px; } }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  color: var(--cream);
}
.header-light .site-header { color: var(--navy); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto;
  padding-top: 27px;
}
.site-header__brand { display: flex; align-items: center; gap: clamp(36px, 7vw, 102px); }
.logo { display: block; width: 183px; color: inherit; }
.logo svg { width: 100%; height: auto; }
.site-nav ul, .site-actions { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-actions a { font-weight: 500; font-size: var(--fs-md); line-height: var(--lh-ui); }
.site-nav a { position: relative; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.btn-header {
  display: inline-flex; align-items: center; min-height: 44px; padding: 12px 18px;
  border: 1px solid currentColor; line-height: var(--lh-tight) !important; letter-spacing: -0.01em;
  transition: background-color .2s ease, color .2s ease;
}
.site-header .btn-header { color: var(--white); }
.header-light .site-header .btn-header { color: var(--navy); }
.site-header .btn-header:hover { background: var(--white); color: var(--navy); }
.header-light .site-header .btn-header:hover { background: var(--navy); color: var(--white); }

.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; color: inherit;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform .2s ease, background-color .2s ease;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; }

@media (max-width: 960px) {
  :root { --header-h: 88px; }
  .site-nav, .site-actions { display: none; }
  .nav-toggle { display: inline-flex; }
  .logo { width: 150px; }
  .site-header__inner { padding-top: 22px; }
  .mobile-menu {
    position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
    padding: calc(var(--header-h) + 24px) var(--gutter) 32px; background: var(--navy); color: var(--white);
    overflow-y: auto; visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility .2s;
  }
  .nav-open .mobile-menu { visibility: visible; opacity: 1; }
  .nav-open .site-header { position: fixed; color: var(--cream); }
  .nav-open .site-header .btn-header { color: var(--white); }
  .nav-open { overflow: hidden; }
  .mobile-menu ul { list-style: none; margin: 0; padding: 0; }
  .mobile-menu__primary a { display: block; padding: 14px 0; font-family: var(--font-serif); font-size: 2rem; line-height: 1.12; border-bottom: 1px solid var(--line-on-dark); }
  .mobile-menu__label { margin: 32px 0 8px; color: var(--accent-light); font-size: var(--fs-sm); }
  .mobile-menu__secondary a { display: block; padding: 8px 0; font-size: 1.0625rem; }
  .mobile-menu__actions { display: grid; gap: 12px; margin-top: 32px; }
  .mobile-menu__actions .btn { width: 100%; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--white); border-top: 1px solid var(--line-on-dark); }
.site-footer__main {
  display: flex; justify-content: space-between; gap: 48px;
  padding-block: 48px;
}
.site-footer__brand { display: flex; flex-direction: column; justify-content: space-between; gap: 84px; max-width: 360px; }
.site-footer__brand .logo { margin-bottom: 24px; }
.site-footer__tagline { font-size: var(--fs-sm); line-height: var(--lh-body); }
.socials { display: flex; align-items: center; gap: 18px; list-style: none; margin: 0; padding: 0; }
.socials a { display: grid; place-items: center; width: 22px; height: 22px; opacity: 1; transition: opacity .2s ease; }
.socials a:hover { opacity: .7; }
.socials svg { width: 100%; height: 100%; object-fit: contain; }
.site-footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); width: calc((100% - 11 * var(--grid-gap)) / 2 + 5 * var(--grid-gap)); min-width: min(100%, 560px); }
.site-footer__label { color: var(--accent-light); font-size: var(--fs-sm); line-height: var(--lh-body); margin-bottom: 18px; }
.site-footer__cols ul { list-style: none; margin: 0; padding: 0; }
.site-footer__cols a { font-size: var(--fs-md); line-height: var(--lh-snug); }
.site-footer__cols a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__legal { background: var(--navy-2); color: var(--slate-light); font-size: var(--fs-sm); line-height: 1; }
.site-footer__legal .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px; }
.site-footer__legal ul { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; list-style: none; margin: 0; padding: 0; }
.site-footer__legal a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__legal a:hover { color: var(--white); }

@media (max-width: 900px) {
  .site-footer__main { flex-direction: column; gap: 40px; }
  .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .site-footer__legal .container { flex-direction: column; align-items: flex-start; line-height: 1.5; }
}

/* ---------- Heroes ---------- */
/* A: image-backed page hero — photo band behind a navy panel (Investors, Homeowners, About, partner pages) */
/* Sized from the 1440 artboard (band 634, panel 623) and scaled with width, capped at 1920. The band
   never shows wider than ~3:1; set --focus on the <img> to keep the subject in frame. */
.hero-panel { position: relative; padding-top: clamp(128px, 8.9vw, 170px); isolation: isolate; }
.hero-panel__bg { position: absolute; inset: 0 0 auto 0; height: min(clamp(520px, 44vw, 845px), max(520px, 78svh)); z-index: -1; overflow: hidden; }
.hero-panel__bg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.hero-panel__bg::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; background: linear-gradient(rgba(16, 34, 57, .45), rgba(16, 34, 57, 0)); }
.hero-panel__panel {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  min-height: min(clamp(480px, 43.3vw, 830px), max(480px, 74svh)); padding: clamp(24px, 3.34vw, 64px); background: var(--navy); color: var(--white);
}
@media (max-width: 900px) {
  .hero-panel { padding-top: calc(var(--header-h) + 32px); }
  .hero-panel__bg { height: 70%; }
  .hero-panel__panel { min-height: 0; padding: 32px 24px; }
}

/* ---------- Forms ---------- */
.form { display: grid; gap: 30px; }
.form__fields { display: grid; gap: 30px; }
.form__fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.field { display: grid; gap: 9px; padding-bottom: 6px; border-bottom: 1px solid currentColor; margin: 0; padding-inline: 0; border-inline: 0; border-top: 0; min-width: 0; }
.on-dark .field { border-bottom-color: rgba(255, 255, 255, 0.4); }
.field label, .field legend { font-weight: 700; font-size: var(--fs-md); line-height: var(--lh-ui); padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
  min-height: 30px; font-size: var(--fs-xl); line-height: var(--lh-ui); -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 96px; resize: vertical; }
.field ::placeholder { color: inherit; opacity: .4; }
.field select { padding-right: 40px; background-image: url("../icons/select-chevron.svg"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 7px; cursor: pointer; }
.field select:invalid, .field select.is-placeholder { color: rgba(16, 34, 57, .4); }
.on-dark .field select { background-image: url("../icons/select-chevron-white.svg"); }
.on-dark .field select:invalid, .on-dark .field select.is-placeholder { color: rgba(255, 255, 255, .4); }
.field select option { color: var(--navy); }
.field:focus-within { border-bottom-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
.on-dark .field:focus-within { border-bottom-color: var(--accent-light); box-shadow: 0 1px 0 0 var(--accent-light); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; }
.form__actions { display: grid; justify-items: start; gap: 18px; margin-top: 18px; }
.form__note { font-size: var(--fs-sm); line-height: var(--lh-body); }
.form__status { font-size: var(--fs-md); font-weight: 600; }
.form__status:empty { display: none; }
.field--error { border-bottom-color: #E5484D !important; }
.on-dark .field--error { border-bottom-color: #FF8A8A !important; }
.field__error { color: #C62F34; font-size: var(--fs-sm); line-height: 1.4; }
.on-dark .field__error { color: #FF8A8A; }
@media (max-width: 640px) {
  .form__fields--2 { grid-template-columns: minmax(0, 1fr); }
  .form__actions .btn { width: 100%; }
}

/* Contact / lead-form section: intro left (545), form right (660) */
.contact { padding-block: var(--section-pb); }
.contact__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--grid-gap); row-gap: 48px; align-items: start; }
.contact__grid > :first-child { grid-column: 1 / span 5; }
.contact__grid > :nth-child(2) { grid-column: 7 / span 6; }
.contact__intro { display: grid; gap: 36px; }
@media (max-width: 900px) {
  .contact__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .contact__grid > * { grid-column: 1 / -1 !important; }
}

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel__track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { scroll-snap-align: start; min-width: 0; }
.carousel__controls { display: flex; align-items: center; gap: 12px; }
.carousel__btn {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid currentColor; background: transparent; color: inherit;
  transition: background-color .2s ease, color .2s ease;
}
.carousel__btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.carousel__btn svg { width: 8px; height: 13px; }
.carousel__btn--prev svg { transform: rotate(180deg); }
.carousel__btn[disabled] { opacity: .35; pointer-events: none; }
.carousel__dots { display: flex; gap: 8px; }
.carousel__dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: currentColor; opacity: .25; }
.carousel__dot[aria-current="true"] { opacity: 1; }

/* ---------- Accordion (native details/summary) ---------- */
.accordion { border-bottom: 1px solid var(--line); }
.accordion details { border-top: 1px solid var(--line); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0;
  list-style: none; cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion__icon { flex: none; width: 12px; height: 7px; transition: transform .2s ease; }
.accordion details[open] .accordion__icon { transform: rotate(180deg); }
.accordion__body { padding: 0 0 24px; max-width: 64ch; }

/* ---------- Video modal ---------- */
.video-modal { width: min(100% - 2 * var(--gutter), 1400px); padding: 0; border: 0; background: #000; }
.video-modal::backdrop { background: rgba(16, 34, 57, .85); }
.video-modal__frame { position: relative; aspect-ratio: 16 / 9; }
.video-modal__frame iframe, .video-modal__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-modal__close {
  position: absolute; right: 0; top: -48px; width: 44px; height: 44px; border: 0; background: none; color: var(--white); font-size: 32px; line-height: 1;
}
.video-modal[open] { overflow: visible; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.nowrap { white-space: nowrap; }
.rule-top { border-top: 1px solid var(--line); }
.on-dark .rule-top { border-top-color: var(--line-on-dark); }

/* ---------- Viewport fit (desktop) ----------
   Portrait photos beside text (Figma 546×710 / 660×710) would grow taller than a laptop screen at
   1600–1900px wide. Cap them to the viewport height; object-fit: cover crops instead of stretching. */
@media (min-width: 901px) {
  /* low specificity on purpose, so a page's own hero/image cap can override it */
  :where(main) :is(.media, .video-thumb):where(:not(.lib-film__thumb)) { width: 100%; max-height: max(420px, 74svh); }
  /* width: 100% matters: with aspect-ratio, a max-height would otherwise shrink the width too */
}

/* ---------- Motion (subtle) ----------
   Scroll reveal: main.js tags below-the-fold blocks with [data-reveal]; they fade up once as they
   enter the viewport (siblings stagger via --i). Nothing on the first screen is hidden, and with
   prefers-reduced-motion the script does nothing. Hover: photos ease in slightly, cards lift. */
[data-reveal] {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity .8s cubic-bezier(.2, .65, .2, 1), transform .8s cubic-bezier(.2, .65, .2, 1);
  transition-delay: calc(min(var(--i, 0), 5) * 90ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal="media"] { transform: none; }
[data-reveal="media"] > img { transform: scale(1.06); transition: transform 1.6s cubic-bezier(.2, .65, .2, 1); }
[data-reveal="media"].is-in > img { transform: none; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* photos inside frames: slow, slight zoom */
  .image-card > img, .video-thumb > img, a .media > img, .media--hover > img {
    transition: transform 1.2s cubic-bezier(.2, .65, .2, 1);
  }
  .image-card:hover > img, .video-thumb:hover > img, a:hover .media > img { transform: scale(1.035); }
  /* cards: small lift */
  .lib-card, .lib-q, .ct-path, .lib-film {
    transition: transform .35s cubic-bezier(.2, .65, .2, 1), box-shadow .35s ease;
  }
  .lib-card:hover, .lib-q:hover, .ct-path:hover, .lib-film:hover {
    transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(16, 34, 57, .35);
  }
  .image-card__panel { transition: transform .45s cubic-bezier(.2, .65, .2, 1); }
  .image-card:hover .image-card__panel { transform: translateY(-4px); }
  /* buttons: fill already animates; add a touch of lift */
  .btn { transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
  .btn:hover { transform: translateY(-1px); }
}

/* Two fields side by side inside a single-column form (First Name / Last Name). Stacks on phones. */
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 30px; }
.form__fields--2 > .form__row { grid-column: 1 / -1; column-gap: inherit; }
@media (max-width: 640px) { .form__row { grid-template-columns: minmax(0, 1fr); } }
.form__status--error { color: #C62F34; font-weight: 600; }
.on-dark .form__status--error { color: #FF8A8A; }
.btn[aria-busy="true"] { opacity: .6; cursor: progress; }
