/*
 * Glacier Capital legacy-site refinement, 2026-07-19.
 * Presentation only: no copy, order, links, facts, or interaction text changes.
 */

:root {
  --glacier-navy: #0a1628;
  --glacier-navy-deep: #07111f;
  --glacier-panel: #151a2c;
  --glacier-panel-soft: #1a1f34;
  --glacier-gold: #c9a961;
  --glacier-gold-light: #e8d196;
  --glacier-rule: rgba(201, 169, 97, 0.16);
  --glacier-safe-top: env(safe-area-inset-top, 0px);
  --glacier-safe-right: env(safe-area-inset-right, 0px);
  --glacier-safe-bottom: env(safe-area-inset-bottom, 0px);
  --glacier-safe-left: env(safe-area-inset-left, 0px);
}

html,
body,
#root {
  min-height: 100%;
  background: var(--glacier-navy);
}

html {
  overflow-x: clip;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  overflow-x: clip;
  background:
    radial-gradient(circle at 78% -12%, rgba(201, 169, 97, 0.08), transparent 34rem),
    linear-gradient(180deg, var(--glacier-navy) 0%, var(--glacier-navy-deep) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Avoid the empty white/dark paint between HTML delivery and React hydration. */
#root:empty {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 25%, rgba(201, 169, 97, 0.08), transparent 38%),
    linear-gradient(180deg, var(--glacier-navy), var(--glacier-navy-deep));
}

/* Notch / Dynamic Island safe area, while keeping the existing navigation intact. */
header.fixed {
  padding-top: max(var(--glacier-safe-top), 10px) !important;
  padding-left: var(--glacier-safe-left);
  padding-right: var(--glacier-safe-right);
}

footer#contact {
  padding-bottom: max(var(--glacier-safe-bottom), 2.5rem) !important;
}

/* Both canvases receive a deterministic CSS paint before their JS effect runs. */
#hero > section > canvas,
#bridge canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background:
    linear-gradient(rgba(201, 169, 97, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 97, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 68% 42%, rgba(201, 169, 97, 0.10), transparent 38%),
    linear-gradient(180deg, var(--glacier-navy) 0%, var(--glacier-navy-deep) 100%);
  background-size: 40px 40px, 40px 40px, auto, auto;
}

/* Refine the portfolio as dark instrument panels with smaller champagne logo plates. */
#portfolio .grid.grid-cols-2 > .group {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 48%),
    linear-gradient(180deg, var(--glacier-panel-soft), var(--glacier-panel));
  border-color: rgba(201, 169, 97, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 18px 50px rgba(0, 0, 0, 0.12);
}

#portfolio .grid.grid-cols-2 > .group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 209, 150, 0.48), transparent);
  opacity: 0.42;
  pointer-events: none;
}

#portfolio .aspect-square {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(201, 169, 97, 0.10), transparent 45%),
    linear-gradient(145deg, #151a2a, #0d1321);
  border-color: rgba(201, 169, 97, 0.12);
}

#portfolio .aspect-square::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(201, 169, 97, 0.12);
  border-radius: 2px;
  pointer-events: none;
}

#portfolio .aspect-square img {
  width: 70% !important;
  height: 70% !important;
  padding: 7%;
  border: 1px solid rgba(201, 169, 97, 0.24);
  border-radius: 2px;
  background: #e8dfcd;
  filter: saturate(0.80) sepia(0.09) brightness(0.90) contrast(1.055);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

@media (hover: hover) and (pointer: fine) {
  #portfolio .grid.grid-cols-2 > .group:hover {
    border-color: rgba(232, 209, 150, 0.34);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 24px 64px rgba(0, 0, 0, 0.22);
  }

  #portfolio .grid.grid-cols-2 > .group:hover .aspect-square img {
    filter: saturate(0.94) sepia(0.02) brightness(0.98) contrast(1.04);
  }
}

/* Keyboard access remains visible against the dark palette. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--glacier-gold-light);
  outline-offset: 4px;
}

/* Paint-heavy components are isolated without changing their layout or order. */
#portfolio .group,
#thesis a,
#testimonials details,
#bridge > div > div {
  contain: paint;
}

/* Founder voice hierarchy: company first, speaker and role second. */
#testimonials details summary > div:first-child {
  display: flex;
  flex-direction: column;
}

#testimonials details summary > div:first-child > div:nth-child(2) {
  order: 1;
  color: var(--glacier-gold-light) !important;
  font-size: clamp(16px, 1.8vw, 24px) !important;
  font-weight: 720 !important;
  line-height: 1.28;
  letter-spacing: -.018em;
}

#testimonials details summary > div:first-child > div:nth-child(1) {
  order: 2;
  margin-top: 8px;
  color: rgba(232, 209, 150, .68) !important;
  font-size: clamp(11px, 1.05vw, 14px) !important;
  font-weight: 560 !important;
  line-height: 1.5;
}

#testimonials details summary > div:first-child > div:nth-child(3) {
  order: 3;
}

@media (max-width: 767px) {
  /* Give iOS's safe-area and the fixed header one continuous navy surface. */
  header.fixed {
    background:
      linear-gradient(180deg, rgba(7, 17, 31, 0.985), rgba(10, 22, 40, 0.94)) !important;
    border-bottom: 1px solid rgba(201, 169, 97, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    -webkit-backdrop-filter: blur(14px) saturate(118%);
    backdrop-filter: blur(14px) saturate(118%);
  }

  header.fixed > div > a:first-child,
  header.fixed > div > div > a > div {
    background: linear-gradient(145deg, rgba(26, 31, 50, 0.82), rgba(16, 24, 40, 0.92)) !important;
    border-color: rgba(232, 209, 150, 0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }

  #hero > section {
    height: 100dvh !important;
    min-height: 620px !important;
  }

  #hero > section > canvas {
    inset: 0 !important;
  }

  /* Replace the broken 300x150 mobile canvas stretch with a compact system map. */
  #bridge canvas {
    opacity: 0 !important;
  }

  #bridge canvas:first-child {
    pointer-events: none;
  }

  #bridge canvas:only-child {
    display: block;
  }

  #bridge div:has(> canvas) {
    height: 132px !important;
    min-height: 132px;
    background:
      radial-gradient(circle at 74% 42%, rgba(232, 209, 150, 0.92) 0 2px, transparent 3px),
      radial-gradient(circle at 28% 62%, rgba(201, 169, 97, 0.82) 0 2px, transparent 3px),
      linear-gradient(155deg, transparent 49.7%, rgba(201, 169, 97, 0.28) 50%, transparent 50.3%),
      linear-gradient(rgba(201, 169, 97, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(201, 169, 97, 0.045) 1px, transparent 1px),
      radial-gradient(circle at 75% 40%, rgba(201, 169, 97, 0.10), transparent 34%),
      linear-gradient(145deg, #151a2b, #0d1322) !important;
    background-size: auto, auto, auto, 24px 24px, 24px 24px, auto, auto !important;
  }

  #portfolio .grid.grid-cols-2 > .group {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  }

  #portfolio .aspect-square img {
    width: 72% !important;
    height: 72% !important;
    padding: 6%;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  }
}

@media (max-width: 389px) {
  header.fixed > div {
    padding-left: max(8px, var(--glacier-safe-left));
    padding-right: max(8px, var(--glacier-safe-right));
  }

  header.fixed a.flex.items-center {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  #portfolio .grid.grid-cols-2 {
    gap: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body,
  #root {
    background: #0a1628 !important;
  }
}

/* 06:20 precision pass: presentation only; public copy remains byte-locked. */
html {
  font-kerning: normal;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

/* Replace bright white logo tiles with restrained champagne instrument plates. */
#portfolio .aspect-square {
  display: grid;
  place-items: center;
  padding: clamp(10px, 1.35vw, 18px);
}

#portfolio .aspect-square::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 3px;
  background:
    linear-gradient(145deg, rgba(232, 209, 150, .78), rgba(166, 137, 82, .68)),
    #b49a63;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .32),
    inset 0 0 0 1px rgba(7, 17, 31, .18);
}

#portfolio .aspect-square img {
  position: relative;
  z-index: 1;
  width: 58% !important;
  height: 58% !important;
  padding: 5%;
  background: rgba(232, 223, 205, .86);
  border-color: rgba(232, 209, 150, .30);
  filter: saturate(.76) sepia(.11) brightness(.84) contrast(1.08);
  box-shadow: none;
}

/* Raise quiet utility gold above WCAG AA without changing hierarchy. */
#thesis [class*="text-[#C9A961]/60"] {
  color: #bca369 !important;
}

#bridge [class*="text-[#E8D196]/40"] {
  color: rgba(232, 209, 150, .76) !important;
}

footer#contact button {
  min-height: 24px;
  padding-block: 3px;
}

footer#contact a.transition-opacity {
  min-height: 28px;
  padding-block: 5px;
  display: inline-flex;
  align-items: center;
}

@media (hover: hover) and (pointer: fine) {
  #portfolio .grid.grid-cols-2 > .group:hover .aspect-square::before {
    background:
      linear-gradient(145deg, rgba(239, 217, 150, .90), rgba(185, 151, 87, .78)),
      #c1a56d;
  }

  #portfolio .grid.grid-cols-2 > .group:hover .aspect-square img {
    filter: saturate(.90) sepia(.04) brightness(.91) contrast(1.07);
  }
}

@media (max-width: 767px) {
  #portfolio .aspect-square {
    padding: 8px;
  }

  #portfolio .aspect-square::before {
    inset: 16%;
  }

  #portfolio .aspect-square img {
    width: 56% !important;
    height: 56% !important;
    padding: 4.5%;
  }

  header.fixed button,
  header.fixed a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(232, 209, 150, .10);
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
  #portfolio .aspect-square img,
  #portfolio .grid.grid-cols-2 > .group,
  footer#contact a,
  footer#contact button {
    animation: none !important;
    transition: none !important;
  }
}

/* Related reading: editorial density without disturbing the legacy page rhythm. */
.glacier-related-reading {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 128px) max(16px, var(--glacier-safe-right)) clamp(72px, 9vw, 140px) max(16px, var(--glacier-safe-left));
  background:
    radial-gradient(circle at 82% 14%, rgba(201, 169, 97, .10), transparent 30rem),
    linear-gradient(rgba(201, 169, 97, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 97, .025) 1px, transparent 1px),
    linear-gradient(180deg, #0a1628, #0b1423);
  background-size: auto, 44px 44px, 44px 44px, auto;
  border-top: 1px solid rgba(201, 169, 97, .12);
}

.glacier-related-reading::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 12%, rgba(232, 209, 150, .035) 48%, transparent 72%);
}

.glacier-related-reading__inner {
  position: relative;
  z-index: 1;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.glacier-related-reading__eyebrow {
  margin-bottom: 12px;
  color: var(--glacier-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
}

.glacier-related-reading__title,
.glacier-related-reading__heading {
  color: var(--glacier-gold-light);
  font-family: inherit;
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 650;
  line-height: 1.38;
  letter-spacing: normal;
}

.glacier-related-reading__title {
  margin: 0 0 clamp(28px, 4vw, 54px);
}

.glacier-related-reading__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(201, 169, 97, .18);
  border-left: 1px solid rgba(201, 169, 97, .18);
}

.glacier-related-reading__card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 260px;
  padding: clamp(24px, 3.5vw, 48px);
  background: linear-gradient(145deg, rgba(26, 31, 52, .96), rgba(13, 20, 35, .94));
  border-right: 1px solid rgba(201, 169, 97, .18);
  border-bottom: 1px solid rgba(201, 169, 97, .18);
  box-shadow: inset 0 1px rgba(255, 255, 255, .02);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(232, 209, 150, .10);
  transition: background .35s ease, border-color .35s ease, transform .35s ease;
}

.glacier-related-reading__card::after {
  content: "↗";
  position: absolute;
  top: clamp(22px, 3vw, 42px);
  right: clamp(22px, 3vw, 42px);
  color: rgba(232, 209, 150, .55);
  font-size: 18px;
  z-index: 4;
  pointer-events: none;
}

.glacier-related-reading__card:focus-visible {
  outline: 2px solid rgba(232, 209, 150, .58);
  outline-offset: -2px;
}

.glacier-related-reading__number {
  display: block;
  margin-bottom: clamp(30px, 4vw, 54px);
  color: var(--glacier-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

.glacier-related-reading__heading {
  max-width: calc(100% - 34px);
  margin: 0 0 12px;
}

.glacier-related-reading__meta {
  margin: 0 0 22px;
  color: rgba(232, 209, 150, .60);
  font-size: 12px;
  line-height: 1.7;
}

.glacier-related-reading__link {
  display: inline;
  color: rgba(232, 209, 150, .88);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.75;
  text-decoration-color: rgba(201, 169, 97, .34);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: color .3s ease, text-decoration-color .3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .glacier-related-reading__card:hover {
    z-index: 1;
    background: linear-gradient(145deg, rgba(36, 41, 64, .98), rgba(16, 24, 41, .96));
    border-color: rgba(232, 209, 150, .34);
    transform: translateY(-2px);
  }

  .glacier-related-reading__link:hover {
    color: #f0dda4;
    text-decoration-color: rgba(240, 221, 164, .82);
  }
}

/* Global office cards route through the existing contact and QR interactions. */
#bridge a[data-office-contact-bound="true"] {
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 169, 97, .12);
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(26, 31, 52, .78), rgba(13, 20, 35, .70));
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(232, 209, 150, .10);
}

.glacier-office-email-hidden {
  display: none !important;
}

.glacier-office-route {
  margin-top: 6px;
  padding: clamp(22px, 5vw, 32px);
  border: 1px solid rgba(212, 175, 55, .18);
  border-radius: 3px;
  background:
    radial-gradient(circle at 82% 12%, rgba(232, 209, 150, .12), transparent 44%),
    rgba(35, 40, 60, .62);
  text-align: center;
}

.glacier-office-route__city {
  color: var(--glacier-gold-light);
  font-size: clamp(21px, 5vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.glacier-office-route__role {
  margin-top: 6px;
  color: rgba(232, 209, 150, .62);
  font-size: 12px;
  line-height: 1.5;
}

.glacier-office-route__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.glacier-office-route__confirm,
.glacier-office-route__cancel {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  touch-action: manipulation;
}

.glacier-office-route__confirm {
  color: var(--glacier-navy);
  background: linear-gradient(135deg, #c9a961, #ead28f, #c9a961);
  box-shadow: 0 12px 34px rgba(201, 169, 97, .16);
}

.glacier-office-route__cancel {
  color: var(--glacier-gold-light);
  border: 1px solid rgba(232, 209, 150, .26);
  background: transparent;
}

@media (max-width: 767px) {
  .glacier-related-reading {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .glacier-related-reading__grid {
    grid-template-columns: 1fr;
  }

  .glacier-related-reading__card {
    min-height: 0;
    padding: 26px 22px 30px;
  }

  .glacier-related-reading__number {
    margin-bottom: 28px;
  }

  #bridge a[data-office-contact-bound="true"] {
    min-height: 68px;
    padding: 12px 14px;
  }
}

@media (max-width: 389px) {
  .glacier-office-route__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
  .glacier-related-reading__card,
  .glacier-related-reading__link {
    animation: none !important;
    transition: none !important;
  }
}
