/* ==========================================================================
   DESIGN REFINEMENT
   Loaded after components.css. Same markup and components, dressed more
   quietly: system (SF) / Inter type at medium weight, wide-tracked small
   labels, generous spacing between sections, hairlines instead of ornament.
   Motion lives in motion.css + motion.js.
   ========================================================================== */

:root {
  /* SF on Apple devices, Inter everywhere else */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #161d2a;
  --on-ink: #ffffff;
  --hairline: rgba(26, 35, 50, 0.1);
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-md: 20px;
  --radius-lg: 30px;
  --shadow-soft: 0 24px 60px -30px rgba(26, 35, 50, 0.22), 0 2px 10px rgba(26, 35, 50, 0.04);
  --shadow-card: 0 36px 80px -32px rgba(26, 35, 50, 0.3), 0 4px 16px rgba(26, 35, 50, 0.05);
  /* Scrolled menu bar: frosted glass (translucent tint + backdrop blur) */
  --nav-surface-bg: rgba(255, 255, 255, 0.6);
  --nav-surface-blur: blur(22px) saturate(180%);
  --nav-surface-border: rgba(255, 255, 255, 0.7);
  /* one rhythm for the space between sections */
  --section-gap: clamp(2.5rem, 4.4vw, 4rem);
}

html[data-theme="dark"] {
  --ink: #f2f5fa;
  --on-ink: #0b1424;
  --hairline: rgba(255, 255, 255, 0.12);
  /* Scrolled menu bar: frosted glass, a shade lighter than the night sky.
     The blur also dims whatever is behind it, so the links stay readable
     when a bright photo scrolls underneath. */
  --nav-surface-bg: rgba(34, 46, 72, 0.6);
  --nav-surface-blur: blur(22px) saturate(170%) brightness(0.72);
  --nav-surface-border: rgba(255, 255, 255, 0.22);
  --nav-surface-inset: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 24px 60px -30px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 36px 80px -32px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Soft cross-fade between pages where the browser supports it */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: vt-out 0.25s ease both;
  }

  ::view-transition-new(root) {
    animation: vt-in 0.5s ease both;
  }
}

@keyframes vt-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
  }
}

/* Note: do not give .site-header a view-transition-name. That makes the
   header a "backdrop root", so the frosted bar can no longer see (or blur)
   the page behind it and just looks see-through. */

/* --------------------------------------------------------------------------
   Type: medium weight, tight tracking, room to breathe
   -------------------------------------------------------------------------- */
body {
  letter-spacing: -0.011em;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.032em;
  line-height: 1.08;
}

.hero-home .display {
  font-size: clamp(2.6rem, 6.8vw, 4.75rem);
  letter-spacing: -0.04em;
  line-height: 1.03;
  margin-bottom: 1.5rem;
}

.page-hero .display {
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  letter-spacing: -0.036em;
}

.services-head .display {
  font-size: clamp(1.9rem, 3.8vw, 2.75rem);
}

.partners-head .display,
.testimonials-head .display {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.cta-strip .display,
.contact-direct .display {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.lead {
  font-size: 1.1rem;
  line-height: 1.55;
  letter-spacing: -0.014em;
}

/* Small labels: wide-tracked capitals, no bullet */
.eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  margin-bottom: 1.15rem;
}

.eyebrow::before {
  display: none;
}

.logo-mark__text {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Space between sections: one consistent gap, so each heading sits close to
   the end of the section before it
   -------------------------------------------------------------------------- */
.home-stats-wrap {
  margin-top: clamp(0.5rem, 1.6vw, 1.25rem);
}

#services.section-pad,
#partners.section-pad,
#testimonials.section-pad {
  padding-top: var(--section-gap);
  padding-bottom: 0;
}

.cta-strip {
  padding-top: var(--section-gap);
  padding-bottom: clamp(3.25rem, 6vw, 5rem);
}

/* Contact: the card follows the page title instead of floating below it */
main.contact-page .page-hero {
  padding-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

/* --------------------------------------------------------------------------
   Buttons: solid, calm
   -------------------------------------------------------------------------- */
.btn {
  padding: 0.85rem 1.65rem;
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    transform 0.4s var(--ease-lux),
    box-shadow 0.4s var(--ease-lux),
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

.btn-primary,
html[data-theme="dark"] .btn-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--on-ink);
  box-shadow: 0 10px 26px -12px rgba(22, 29, 42, 0.55);
}

.btn-primary:hover,
html[data-theme="dark"] .btn-primary:hover {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 16px 34px -14px rgba(22, 29, 42, 0.6);
  transform: translateY(-1px);
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--hairline);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(26, 35, 50, 0.18);
  color: var(--text);
  transform: translateY(-1px);
}

html[data-theme="dark"] .btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Stats: large quiet numerals, hairlines between them
   -------------------------------------------------------------------------- */
.stats-band {
  gap: 0;
  padding: clamp(2.1rem, 4.5vw, 3rem) clamp(0.75rem, 2.5vw, 1.75rem);
}

.stat {
  padding: 0 clamp(0.6rem, 2vw, 1.5rem);
}

.stat + .stat {
  border-left: 1px solid var(--hairline);
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__num span {
  margin-left: 0.06em;
  font-size: 0.5em;
  letter-spacing: 0;
}

.stat__label {
  margin-top: 0.95rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

@media (max-width: 768px) {
  .stats-band {
    gap: 2.25rem 0;
  }

  .stat:nth-child(odd) {
    border-left: 0;
  }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.service-card {
  padding: clamp(1.6rem, 2.4vw, 2rem);
}

.service-card__icon {
  width: 38px;
  height: 38px;
  margin-bottom: 1.4rem;
  stroke-width: 1.3;
}

.service-card h3 {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-bottom: 0.55rem;
}

.service-card p {
  font-size: 0.93rem;
  line-height: 1.6;
}

/* Partners: lighter pills */
.partner-chips {
  gap: 0.7rem;
  max-width: 840px;
}

.chip {
  padding: 0.6rem 1.25rem;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.42);
  border-color: var(--hairline);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme="dark"] .chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hairline);
}

@media (min-width: 901px) {
  .chip:hover {
    transform: translateY(-2px);
  }
}

/* Testimonials: the quote carries the card */
.grid-testimonials {
  gap: 1.25rem;
}

.test-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.7rem, 2.6vw, 2.1rem);
}

.test-card__quote {
  height: 1.5rem;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
  line-height: 1;
}

.test-card p {
  flex: 1;
  margin-bottom: 1.7rem;
  font-size: 1.05rem;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: -0.014em;
  color: var(--text);
}

.test-card footer {
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.test-card__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.test-card__role {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cta-card {
  padding: clamp(2.5rem, 6vw, 3.75rem) clamp(1.75rem, 5vw, 3rem);
}

/* --------------------------------------------------------------------------
   Portfolio / gallery
   -------------------------------------------------------------------------- */
.portfolio-card {
  position: relative;
}

/* Opaque caption panel: it only ever sat over the sky, so blur bought nothing */
.portfolio-card__info {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] .portfolio-card__info {
  background: rgba(17, 27, 45, 0.84);
}

.portfolio-card__title {
  font-weight: 600;
  letter-spacing: -0.018em;
}

.portfolio-card__meta {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.gallery-item img {
  transition: transform 1.4s var(--ease-lux), filter 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.045);
}

/* --------------------------------------------------------------------------
   Odds and ends
   -------------------------------------------------------------------------- */
/* Small inline flag that sits on the text line (drawn as SVG so it looks
   the same everywhere; Windows shows flag emoji as two letters) */
.flag {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-left: 0.3em;
  vertical-align: -0.17em;
}

.faq-item summary {
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* The answer sits in the middle of the panel that opens: same space above
   the text as below it (it used to start flush under the question) */
.faq-item__body {
  padding: 1.2rem 1.25rem 1.13rem;
}

.site-footer small {
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Dark menu bar: same frosted surface at every width (the small-screen bar
   has its own blur declaration), and brighter links once it is floating
   over page content
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .site-header::before {
  -webkit-backdrop-filter: var(--nav-surface-blur);
  backdrop-filter: var(--nav-surface-blur);
}

@media (min-width: 901px) {
  html[data-theme="dark"] .site-header.is-scrolled .nav-list a {
    color: rgba(255, 255, 255, 0.86);
  }

  html[data-theme="dark"] .site-header.is-scrolled .nav-list a:hover,
  html[data-theme="dark"] .site-header.is-scrolled .nav-list a[aria-current="page"] {
    color: #fff;
  }
}

/* --------------------------------------------------------------------------
   Phones and tablets: the menu bar keeps its full size when you scroll.
   The frosted surface still fades in so the bar stays readable over the
   page; only the shrinking (narrower bar, hidden wordmark) is switched off.
   Covers the small-screen layout, and any touch device on the wide layout
   (an iPad held sideways).
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .site-header.is-scrolled:not(.is-open):not(.menu-transitioning) {
    left: calc(clamp(1.25rem, 4vw, 2.5rem) + var(--nav-inset-extra, 0px));
    right: calc(clamp(1.25rem, 4vw, 2.5rem) + var(--nav-inset-extra, 0px));
  }

  .site-header.is-scrolled:not(.is-open):not(.menu-transitioning) .logo-mark__text {
    max-width: 9rem;
    margin-left: 0.6rem;
    opacity: 1;
  }
}

@media (min-width: 901px) and (pointer: coarse) {
  .site-header.is-scrolled {
    width: min(1120px, calc(100% - 2rem));
  }

  .site-header.is-scrolled .logo-mark__text {
    max-width: 9rem;
    margin-left: 0.65rem;
    opacity: 1;
  }

  .site-header.is-scrolled .logo-mark::after {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Photo viewer (photography / my setup): previous / next arrows, close
   button and a counter. Built by lightbox.js around the existing #lightbox.
   -------------------------------------------------------------------------- */
#lightbox {
  background: rgba(8, 12, 20, 0.92);
  cursor: zoom-out;
}

#lightbox img {
  max-width: min(88%, 1500px);
  max-height: 84vh;
  cursor: default;
  transition: opacity 0.28s ease, transform 0.45s var(--ease-lux);
}

#lightbox.is-swapping img {
  opacity: 0;
  transform: scale(0.985);
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lightbox__btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.lightbox__btn--prev,
.lightbox__btn--next {
  top: 50%;
  margin-top: -24px;
}

.lightbox__btn--prev {
  left: clamp(0.6rem, 2.5vw, 2rem);
}

.lightbox__btn--next {
  right: clamp(0.6rem, 2.5vw, 2rem);
}

.lightbox__btn--close {
  top: clamp(0.75rem, 2.5vw, 1.5rem);
  right: clamp(0.6rem, 2.5vw, 2rem);
  width: 42px;
  height: 42px;
}

.lightbox__count {
  position: absolute;
  left: 50%;
  bottom: clamp(0.9rem, 3vh, 1.6rem);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

html.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  #lightbox img {
    max-width: 94%;
  }

  .lightbox__btn {
    width: 40px;
    height: 40px;
    background: rgba(8, 12, 20, 0.55);
  }

  .lightbox__btn--prev,
  .lightbox__btn--next {
    margin-top: -20px;
  }
}

/* --------------------------------------------------------------------------
   Menu bar without backdrop blur support: fall back to a near-solid surface
   so page content never shows through the links
   -------------------------------------------------------------------------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --nav-surface-bg: rgba(255, 255, 255, 0.94);
  }

  html[data-theme="dark"] {
    --nav-surface-bg: rgba(46, 58, 84, 0.96);
  }
}
