/* ============================================
   Crystal Skin -- bespoke blocks

   Layout (compositions), tokens, and generic utilities come from brio
   (assets/vendor/brio.css) and overrides.css. This file styles only the
   project-specific blocks, on brio semantic tokens.
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* Buttons -- the design uses uppercase CTAs (brio buttons are sentence
   case). Buttons are chrome: they stay on the system sans, not the
   brand display faces (tried Josefin here, it read costumey). */
.button {
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}


/* -- Site Header -- */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.site-logo__wordmark {
  height: 4.5rem;
  width: 100%;
  color: var(--color-text);

  &:hover {
    color: var(--color-primary);
  }

  path {
    fill: currentColor;
  }
}

.site-logo__mark {
  height: 4.5rem;
  width: 100%;
  color: var(--color-text);

  &:hover {
    color: var(--color-primary);
  }

  path {
    fill: currentColor;
  }
}

.site-logo__image {
  height: 4.75rem;
  width: 100%;
}

/*.site-logo__mark {*/
/*  width: 2.75rem;*/
/*  height: 2.75rem;*/
/*  background: var(--color-text);*/
/*  border-radius: var(--radius-sm);*/
/*  display: flex;*/
/*  align-items: center;*/
/*  justify-content: center;*/
/*  color: var(--color-surface);*/
/*  font-family: var(--font-heading);*/
/*  font-size: 1.25rem;*/
/*}*/

.site-logo__text {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--color-text);
}

/* -- Navbar links: refined treatment over brio's default nav-link -- */
.navbar__links .nav-link {
  --nav-link-font-size: var(--step--1);
  font-family: var(--font-subheading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  position: relative;
}

/* Underline wipes in from the left, replacing brio's native one. */
.navbar__links .nav-link::after {
  content: "";
  position: absolute;
  /*left: var(--nav-link-padding-x);*/
  left: var(--nav-link-padding-x);
  right: var(--nav-link-padding-x);
  bottom: calc(var(--nav-link-padding-y) - 0.15rem);
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}

.navbar__links .nav-link[type="button"]::after {
  left: 0;
  width: auto;
}

.navbar__links .nav-link:hover,
.navbar__links .nav-link[aria-current="page"] {
  color: var(--color-primary);
  text-decoration: none;
}

.navbar__links .nav-link:hover::after,
.navbar__links .nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .navbar__links .nav-link::after { transition: none; }
}

/* -- Services dropdown -- */
.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
}

.nav-dropdown__chevron {
  transition: transform var(--transition-fast);
}

.nav-dropdown__trigger[aria-expanded="true"] .nav-dropdown__chevron {
  transform: rotate(180deg);
}

/* Match menu items to the nav-link treatment. */
.nav-dropdown .dropdown-item {
  font-family: var(--font-subheading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  --dropdown-item-color: var(--color-text-muted);
}

.nav-dropdown .dropdown-item:hover,
.nav-dropdown .dropdown-item[aria-current="page"] {
  --dropdown-item-color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
  .nav-dropdown__chevron { transition: none; }
}

/* -- Mobile nav (brio drawer) -- */
.navbar__menu {
  display: none;
}

.drawer-nav .nav-link {
  display: block;
  font-family: var(--font-subheading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  --nav-link-font-size: var(--step-0);
}

.drawer-nav__groups {
  padding-inline-start: var(--space-md);
  --flow-space: var(--space-2xs);
}

.drawer-nav__group-link {
  display: block;
  font-family: var(--font-subheading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--step--1);
  color: var(--color-text-muted);
  text-decoration: none;
}

.drawer-nav__group-link:hover {
  color: var(--color-primary);
}

@media (max-width: 44rem) {
  .navbar__links {
    display: none;
  }

  .navbar__menu {
    display: inline-flex;
  }
}

/* brio leaves motion-gating the drawer to consumers. */
@media (prefers-reduced-motion: reduce) {
  .drawer-panel,
  .drawer::backdrop {
    transition: none;
  }
}


/* -- Hero (editorial split: brio .switcher + .frame) -- */
.hero__content {
  --flow-space: var(--space-md);
}

.hero__label {
  font-family: var(--font-subheading);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary-text);
}

.hero__title {
  --flow-space: var(--space-sm);
}

.hero__body {
  font-size: var(--step-1);
  color: var(--color-text-muted);
  max-width: var(--cs-measure);
}

.hero__media {
  border-radius: var(--radius-lg);
}

.hero__trust {
  list-style: none;
  padding: 0;
  --flow-space: var(--space-lg);
  --cluster-gap: var(--space-2xs) var(--space-md);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.hero__trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.hero__trust-item::before {
  content: "\2713";
  color: var(--color-accent);
}


/* -- Section Intro -- */
.section-intro {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
  --stack-gap: var(--space-sm);
}

.section-intro__label {
  font-family: var(--font-subheading);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary-text);
}

.section-intro__title {
  font-size: var(--step-3);
  line-height: 1.2;
}

.section-intro__body {
  color: var(--color-text-muted);
}


/* -- Bento (composable asymmetric grid) --
   Pure structure: a 3-track grid with a tunable base row height. Cells opt
   into shapes by composing span modifiers (square is the default). Row
   height is in container-query units so squares stay roughly square as the
   grid scales; override --bento-row to tune. Container queries (not viewport)
   so the grid reflows on its own width. */
.bento {
  container-type: inline-size;
}

.bento__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: var(--bento-row, clamp(10rem, 28cqi, 20rem));
  gap: var(--space-md);
}

.bento__cell {
  min-inline-size: 0;
}

/* square (1x1) -- default */
.bento__cell.is-wide {
  grid-column: span 2;
}

/* landscape (2x1)         */
.bento__cell.is-tall {
  grid-row: span 2;
}

/* portrait (1x2)          */
.bento__cell.is-full {
  grid-column: 1 / -1;
}

/* banner (full width)     */
/* is-wide + is-tall compose into a 2x2 feature block. */

@container (max-width: 40rem) {
  .bento__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container (max-width: 24rem) {
  .bento__grid {
    grid-template-columns: 1fr;
  }

  /* Collapse horizontal spans to one column; keep is-tall as a taller hero. */
  .bento__cell.is-wide,
  .bento__cell.is-full {
    grid-column: span 1;
  }
}


/* -- Tile (media tile: full-bleed image + overlay, whole tile links) --
   Drops into a bento cell (block-size: 100% fills the cell). The scrim and
   text colors are fixed dark/light literals -- mode-invariant, same rationale
   as .ba-pair__label -- because text sits over photos in either theme. */
.tile {
  position: relative;
  display: block;
  block-size: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  isolation: isolate;
  text-decoration: none;
}

.tile__img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.tile:hover .tile__img,
.tile:focus-visible .tile__img {
  transform: scale(1.06);
}

.tile__overlay {
  position: relative; /* above the absolutely-placed image */
  z-index: 1;
  block-size: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-3xs);
  padding: var(--space-lg);
  /* Scrim for white text legibility (WCAG AA). Three knobs, bottom to top:
     the 0.92 alpha is overall darkness in the text band, 0.55 @ 42% is how far
     up the dark reaches, 80% is where it fully clears to the photo. Lower the
     first two if it reads too heavy on the images. Pair with opaque text
     (.tile__desc has no alpha) -- semi-transparent small text never clears AA.
     The scrim guarantees contrast independent of the gold/brown tint. */
  background: linear-gradient(
    to top,
    oklch(18% 0.01 60 / 0.92) 0%,
    oklch(18% 0.01 60 / 0.55) 42%,
    transparent 80%
  );
}

.tile__title {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  line-height: 1.15;
  color: oklch(93% 0.004 70);
  transition: color var(--transition-fast);
}

.tile:hover .tile__title,
.tile:focus-visible .tile__title {
  color: oklch(99% 0.004 70);
}

.tile__desc {
  font-size: var(--step--1);
  color: oklch(94% 0.004 70);
}

.tile:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tile__img {
    transition: none;
  }

  .tile:hover .tile__img,
  .tile:focus-visible .tile__img {
    transform: none;
  }
}

/* -- Tile tinting (wash photos in a brand tone) --
   Grayscale the photo, then blend a brand color over it. mix-blend-mode:
   color keeps the photo's luminance and adopts the tint's hue, turning a
   color or B&W shot into an on-brand monochrome. Per-tile tone via
   --tile-tint; the presets just set a default tone. Hover/focus restores the
   full-color photo. The tint layer (::after, auto z-index) paints above the
   image but below .tile__overlay (z-index 1), so text stays unblended. */
.tile:is(.is-toned, .is-gold, .is-brown, .is-stone) .tile__img {
  filter: grayscale(1) contrast(1.04);
  transition: filter var(--transition-normal), transform var(--transition-normal);
}

.tile:is(.is-toned, .is-gold, .is-brown, .is-stone)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tile-tint, var(--color-primary));
  mix-blend-mode: color;
  transition: opacity var(--transition-normal);
}

/* Gold lives at accent; brown is the brand primary. */
.tile.is-gold {
  --tile-tint: var(--accent-9);
}

.tile.is-brown {
  --tile-tint: var(--primary-9);
}

.tile.is-stone {
  --tile-tint: var(--neutral-9);
}

.tile:is(.is-toned, .is-gold, .is-brown, .is-stone):hover .tile__img,
.tile:is(.is-toned, .is-gold, .is-brown, .is-stone):focus-visible .tile__img {
  filter: grayscale(0) contrast(1);
}

.tile:is(.is-toned, .is-gold, .is-brown, .is-stone):hover::after,
.tile:is(.is-toned, .is-gold, .is-brown, .is-stone):focus-visible::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tile:is(.is-toned, .is-gold, .is-brown, .is-stone) .tile__img {
    transition: none;
  }
}


/* -- Process (what to expect) -- */
.process {
  list-style: none;
  padding: 0;
  --grid-gap: var(--space-xl);
  /* brio .grid is auto-fill, which leaves empty tracks (and left-aligns) when
     the item count is small; auto-fit collapses them so the steps stay centered. */
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-min, 14rem), 1fr));
  justify-content: center;
}

.process__step {
  text-align: center;
  --stack-gap: var(--space-xs);
}

.process__num {
  width: 3rem;
  height: 3rem;
  margin-inline: auto;
  background: var(--cs-color-accent-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-text);
  font-family: var(--font-heading);
  font-size: var(--step-1);
}

.process__title {
  font-size: var(--step-1);
}

.process__text {
  font-size: var(--step--1);
  color: var(--color-text-muted);
  max-width: 28ch;
  margin-inline: auto;
}


/* -- Video (click-to-load YouTube facade) --
   The ratio comes from brio's .frame (set inline per video), but .frame is a
   flex box with no positioning, so the poster/iframe are anchored with
   position:absolute inset:0 against .video__frame instead of a percentage
   height -- the fallback <a> holds only absolute children, so a block-size:100%
   chain would collapse to zero and the poster would vanish. Portrait (Shorts)
   caps its width so a 9/16 box doesn't tower over the grid; the play chip
   colors are fixed light literals, mode-invariant, same rationale as .tile
   (they sit over a photo). */
.video {
  margin: 0;
}

.video__frame {
  position: relative;
  inline-size: 100%;
  border-radius: var(--radius-lg);
  background: var(--neutral-3);
}

/* Portrait (Shorts) caps and centers the frame, not the figure. Capping the
   figure with auto margins drops its grid stretch, leaving the aspect-ratio
   frame with no definite inline-size, so it collapses to 0x0. The figure keeps
   its stretch; inline-size:100% above gives the frame a definite width to
   derive its height from. */
.video.is-portrait .video__frame {
  max-inline-size: 20rem;
  margin-inline: auto;
}

.video__link {
  position: absolute;
  inset: 0;
  display: block;
}

.video__poster {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: 4rem;
  block-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: oklch(20% 0.01 60 / 0.62);
  color: oklch(99% 0.004 70);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.video__link:hover .video__play,
.video__link:focus-visible .video__play {
  background: var(--color-primary);
  transform: scale(1.06);
}

.video__frame iframe {
  inline-size: 100%;
  block-size: 100%;
  border: 0;
}

.video__caption {
  margin-block-start: var(--space-sm);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .video__link:hover .video__play,
  .video__link:focus-visible .video__play {
    transform: none;
  }
}


/* -- Testimonial Card -- */
.card.is-testimonial {
  p.quote {
    font-family: var(--font-subheading);
    font-size: var(--step-1);
    font-style: italic;
    line-height: 1.5;
    color: var(--color-text-muted);
  }

  p.quote::before,
  p.quote::after {
    content: '\201C';
    color: var(--color-primary);
    font-size: var(--step-2);
    line-height: 0;
    vertical-align: -0.2em;
    margin-inline-end: 0.1em;
  }

  p.quote::after {
    content: '\201D';
  }

  p.attribution {
    font-size: var(--step--1);
    color: var(--color-primary-text);
  }

  .attribution__source {
    color: var(--color-text-muted);
  }

  .rating {
    --flow-space: 0;
  }
}

/* -- CTA Banner (sits inside a .dark-theme section) -- */
.cta-banner {
  text-align: center;
  --stack-gap: var(--space-lg);
}

.cta-banner__title {
  font-size: var(--step-4);
}

.cta-banner__body {
  color: var(--color-text-muted);
  max-width: 50ch;
  margin-inline: auto;
}

/* Tracks accent (gold), not primary: a brown hairline disappears
   against the dark CTA sections this sits in. Explicit inline-size
   (not max-width): the UA gives <hr> auto inline margins, which beat
   align-items: stretch in a .stack and collapse an auto width to 0. */
.gold-rule {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-accent), transparent);
  inline-size: min(12rem, 100%);
  margin-inline: auto;
}


/* -- Aside Callout -- */
.aside-callout {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  background: var(--cs-color-accent-pale);
  --stack-gap: var(--space-sm);
}

.aside-callout__title {
  font-size: var(--step-1);
}

.aside-callout__text {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}


/* -- Pricing (table styling comes from brio .table; this is just the note) -- */
.pricing-note {
  font-size: var(--step--1);
  color: var(--color-text-muted);
  font-style: italic;
}

.two-grid {
  text-align: center;
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 48rem) {
  .two-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* -- Before & After -- */
.ba-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
}

.ba-pair {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-raised);
}

.ba-pair__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ba-pair__img {
  aspect-ratio: 1;
  background: var(--neutral-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  position: relative;
}

.ba-pair__img + .ba-pair__img {
  border-inline-start: 1px solid var(--color-border);
}

/* Overlay label: fixed dark chip + light text, independent of theme. */
.ba-pair__label {
  position: absolute;
  bottom: var(--space-xs);
  left: var(--space-xs);
  background: oklch(22% 0.008 55 / 0.72);
  color: oklch(96% 0.004 70);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
}

.ba-pair__info {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}


/* Comparison slider lives in its own file (assets/css/comparison-slider.css),
   ready to move into brio alongside the <comparison-slider> element. */


/* -- Blog / articles (page styles prescribed by the brio blog patterns;
   brio deliberately doesn't ship these) -- */
.article-kicker {
  font-size: var(--step--1);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.article-category {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary-text);
  font-size: var(--step--2);
  font-weight: var(--font-weight-medium);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}


/* -- Site Footer (sits inside a .dark-theme section) -- */
.site-footer a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--color-primary);
}

.footer-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 2fr repeat(3, 1fr);
}

@media (max-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 30rem) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col__title {
  font-family: var(--font-subheading);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-block-end: var(--space-md);
}

.footer-col ul {
  padding: 0;
}

.footer-col li + li {
  margin-block-start: var(--space-xs);
}

.footer-brand__text {
  font-family: var(--font-heading);
  font-size: var(--step-2);
  font-weight: 400;
  color: var(--color-text);
}

.footer-brand__desc {
  color: var(--color-text-muted);
  font-size: var(--step--1);
  max-width: 30ch;
}

.footer-bottom {
  border-block-start: 1px solid var(--color-border);
  padding-block-start: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}


/* -- Placeholder (mockup only) -- */
.placeholder-img {
  background: var(--neutral-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  font-style: italic;
}


/* ===========================
   COLOR-MODE TOGGLES + PHOTO VARIANTS

   Mode is forced via brio's .light-theme / .dark-theme on <html>;
   system mode (no class) follows prefers-color-scheme. Each rule pairs
   a forced-dark selector with a system-dark one (no class + OS dark).
   =========================== */

/* Mode-only elements (logo swap): show light by default, flip for dark. */
.light-mode-only {
  display: block;
}

.dark-mode-only {
  display: none;
}

html.dark-theme .light-mode-only {
  display: none;
}

html.dark-theme .dark-mode-only {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not(.light-theme):not(.dark-theme) .light-mode-only {
    display: none;
  }

  html:not(.light-theme):not(.dark-theme) .dark-mode-only {
    display: block;
  }
}

.social-link {
  display: inline-flex;
  gap: var(--space-3xs);
  font-size: var(--step-0);

  .icon-box {
    --icon-box-bg: transparent;
    --icon-box-size: 1.5rem;
    color: var(--color-text);
  }
}
