/* Shared sitewide foundation. Keep page-specific layout rules in each page. */
:root {
  --bg0: #f8fafc;
  --bg1: #eef3f8;
  --bg2: #dfe8f0;

  --ink: #0f172a;
  --muted: #475569;
  --muted2: #64748b;
  --paper: #f8fafc;
  --surface: #ffffff;
  --surfaceAlt: #f1f5f9;
  --line: rgba(15, 23, 42, .12);
  --accent: #1f4b5f;
  --accent2: #bb6b36;

  --card: rgba(255, 255, 255, .88);
  --cardBorder: var(--line);
  --ring: rgba(15, 23, 42, .10);
  --radius: 16px;
  --shadow: 0 10px 28px rgba(31, 41, 55, .10);
  --btnGradA: var(--accent);
  --btnGradB: #2b6177;
  --content-max: min(1120px, 94vw);
}

* {
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

::view-transition-group(page-content) {
  animation-duration: 1s;
  animation-timing-function: ease;
}

::view-transition-old(page-content) {
  animation-name: fade-out;
}

::view-transition-new(page-content) {
  animation-name: fade-in;
}

main {
  view-transition-name: page-content;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

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

  to {
    opacity: 1;
  }
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, .86), rgba(248, 250, 252, 0) 360px),
    linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 52%, var(--bg2) 100%) fixed;
  background-repeat: no-repeat;
  background-size: 100% 360px, cover;
  background-attachment: scroll, fixed;
  color: var(--ink);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 68%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 68%);
  opacity: .42;
}

a {
  color: inherit;
  text-decoration: none;
}

section {
  scroll-margin-top: 80px;
}

header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(18, 26, 45, .92);
  border-bottom: 1px solid var(--ring);
  z-index: 50;
}

.nav {
  max-width: var(--content-max);
  margin: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.spacer {
  flex: 1;
}

nav a {
  color: #fff;
  opacity: .95;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, .14);
}

.hamburger {
  display: none;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 26px;
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px clamp(16px, 3vw, 28px);
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.eyebrow {
  display: block;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.title {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -.045em;
  color: var(--ink);
}

.subtitle,
.lead {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
}

.subtitle {
  margin: 0 0 22px;
  max-width: 720px;
}

.lead {
  margin: 0;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Gallery controls: always keep icons visible */
.carousel .ctrl button,
.lightbox .ctrl button,
.lightbox .close {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
}

/* Dark-mode gallery controls */
@media (prefers-color-scheme: dark) {
  .carousel .ctrl button,
  .lightbox .ctrl button,
  .lightbox .close {
    background: rgba(30, 41, 59, 0.92);
    color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  }
}

.btn {
  --btn-surface: linear-gradient(180deg, #53637d 0%, #687895 100%);
  --btn-surface-hover: linear-gradient(180deg, #5d6f8b 0%, #7283a0 100%);
  --btn-ink: #ffffff;
  --btn-border-a: rgba(255, 255, 255, .26);
  --btn-border-b: rgba(9, 13, 24, .55);
  --btn-shadow: 0 3px 5px rgba(9, 13, 24, .28), 0 0 0 1px rgba(9, 13, 24, .72);
  --btn-shadow-hover: 0 5px 9px rgba(9, 13, 24, .32), 0 0 0 1px rgba(9, 13, 24, .78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    var(--btn-surface) padding-box,
    linear-gradient(180deg, var(--btn-border-a), var(--btn-border-b)) border-box;
  color: var(--btn-ink);
  font: inherit;
  font-weight: 750;
  letter-spacing: .01em;
  box-shadow: var(--btn-shadow);
  text-decoration: none;
  transform: translateY(0) scale(1);
  transform-origin: center;
  transition:
    transform 160ms cubic-bezier(.2, 1.45, .35, 1),
    box-shadow 160ms ease,
    filter 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

a.btn,
button.btn {
  cursor: pointer;
}

a.btn:hover,
button.btn:hover,
a.btn:focus-visible,
button.btn:focus-visible {
  background:
    var(--btn-surface-hover) padding-box,
    linear-gradient(180deg, var(--btn-border-a), var(--btn-border-b)) border-box;
  box-shadow: var(--btn-shadow-hover);
  transform: translateY(-1px) scale(1.015);
}

a.btn:focus-visible,
button.btn:focus-visible {
  outline: 3px solid rgba(31, 75, 95, .24);
  outline-offset: 3px;
}

a.btn:active,
button.btn:active {
  transform: translateY(0) scale(.96);
  box-shadow: 0 2px 4px rgba(9, 13, 24, .30), 0 0 0 1px rgba(9, 13, 24, .78), inset 0 1px 2px rgba(9, 13, 24, .20);
}

.btn.primary {
  --btn-surface: linear-gradient(180deg, #4e6688 0%, #6680a1 100%);
  --btn-surface-hover: linear-gradient(180deg, #597497 0%, #718bad 100%);
  --btn-ink: #fff;
  --btn-border-a: rgba(255, 255, 255, .30);
  --btn-border-b: rgba(9, 13, 24, .58);
  --btn-shadow: 0 3px 5px rgba(9, 13, 24, .30), 0 0 0 1px rgba(9, 13, 24, .74);
  --btn-shadow-hover: 0 5px 9px rgba(9, 13, 24, .34), 0 0 0 1px rgba(9, 13, 24, .80);
  color: #fff;
}

a.btn.primary:hover,
button.btn.primary:hover {
  filter: saturate(1.04);
}

.btn[disabled],
.btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--btn-shadow);
}

.btn[disabled]:hover,
.btn:disabled:hover,
.btn[disabled]:active,
.btn:disabled:active {
  background:
    var(--btn-surface) padding-box,
    linear-gradient(180deg, var(--btn-border-a), var(--btn-border-b)) border-box;
  transform: none;
  box-shadow: var(--btn-shadow);
}

.btn img {
  width: 20px;
  height: 20px;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 60;
}

.sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 18px 28px;
  box-shadow: var(--shadow);
}

.sheet a {
  display: block;
  padding: 14px 10px;
  border-radius: 12px;
  color: #111827;
  font-weight: 800;
}

.sheet a:hover {
  background: #f3f4f6;
}

footer {
  color: var(--footer-ink, #334155);
  padding: 40px 20px;
  border-top: 1px solid var(--ring, rgba(15, 23, 42, .10));
  position: relative;
  z-index: 1;
}

footer .inner {
  max-width: var(--content-max, min(1120px, 94vw));
  margin: auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer a {
  color: var(--footer-link, #1f4b5f);
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 3px;
}

footer a:hover,
footer a:focus-visible {
  color: var(--footer-link-hover, #173c4d);
  text-decoration: underline;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--footer-social-ink, #1f4b5f);
  border: 1px solid rgba(31, 75, 95, .22);
  background: rgba(255, 255, 255, .46);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

.footer-social:hover,
.footer-social:focus-visible {
  background: rgba(31, 75, 95, .10);
  border-color: rgba(31, 75, 95, .34);
  transform: translateY(-1px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  nav {
    display: none;
  }

  .hamburger {
    display: block;
    margin-left: auto;
  }

  .wrap {
    padding: 22px 14px;
  }

  .card {
    padding: 20px;
  }

  .title,
  h1 {
    letter-spacing: -.035em;
  }

  .cta .btn {
    width: 100%;
    justify-content: center;
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --card: rgba(18, 26, 45, .74);
    --cardBorder: rgba(255, 255, 255, .10);
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --muted2: #94a3b8;
    --line: rgba(255, 255, 255, .12);
    --accent: #8fc4d4;
    --accent2: #f0aa72;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  }

  body {
    background:
      linear-gradient(180deg, rgba(18, 26, 45, .82), rgba(18, 26, 45, 0) 360px),
      linear-gradient(135deg, #0f172a 0%, #182235 52%, #223544 100%) fixed;
    background-repeat: no-repeat;
    background-size: 100% 360px, cover;
    background-attachment: scroll, fixed;
  }

  body::before {
    background:
      linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .34;
  }

  .btn {
    --btn-surface: linear-gradient(180deg, #53637d 0%, #687895 100%);
    --btn-surface-hover: linear-gradient(180deg, #5d6f8b 0%, #7283a0 100%);
    --btn-border-a: rgba(255, 255, 255, .24);
    --btn-border-b: rgba(2, 6, 23, .62);
    --btn-shadow: 0 3px 5px rgba(0, 0, 0, .34), 0 0 0 1px rgba(2, 6, 23, .80);
    --btn-shadow-hover: 0 5px 9px rgba(0, 0, 0, .40), 0 0 0 1px rgba(2, 6, 23, .86);
    color: #fff;
  }

  .btn.primary {
    --btn-surface: linear-gradient(180deg, #4e6688 0%, #6680a1 100%);
    --btn-surface-hover: linear-gradient(180deg, #597497 0%, #718bad 100%);
    --btn-ink: #ffffff;
    --btn-border-a: rgba(255, 255, 255, .28);
    --btn-border-b: rgba(2, 6, 23, .64);
    --btn-shadow: 0 3px 5px rgba(0, 0, 0, .36), 0 0 0 1px rgba(2, 6, 23, .82);
    --btn-shadow-hover: 0 5px 9px rgba(0, 0, 0, .42), 0 0 0 1px rgba(2, 6, 23, .88);
    color: #ffffff;
  }

  a.btn:focus-visible,
  button.btn:focus-visible {
    outline-color: rgba(143, 196, 212, .34);
  }

  a.btn.primary:hover,
  button.btn.primary:hover {
    filter: saturate(1.04);
  }

  .sheet {
    background: rgba(18, 26, 45, .94);
  }

  .sheet a {
    color: var(--ink);
  }

  .sheet a:hover {
    background: rgba(255, 255, 255, .06);
  }

  footer {
    color: var(--footer-ink-dark, #cbd5e1);
  }

  footer a {
    color: var(--footer-link-dark, #f8fafc);
  }

  footer a:hover,
  footer a:focus-visible {
    color: var(--footer-link-hover-dark, #ffffff);
  }

  .footer-social {
    color: var(--footer-social-ink-dark, #ffffff);
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06);
  }

  .footer-social:hover,
  .footer-social:focus-visible {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .24);
  }
}

/* Fullscreen gallery / lightbox controls */
#lightbox .ctrl button,
#lightbox .close,
#lbPrev,
#lbNext {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}



/* Dark-mode-safe fullscreen controls */
@media (prefers-color-scheme: dark) {
  #lightbox .ctrl button,
  #lightbox .close,
  #lbPrev,
  #lbNext {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #f8fafc !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
  }
}
