/* Home — portfolio landing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --ink: #eef2fa;
  --ink-soft: rgba(238, 242, 250, 0.68);
  --ink-faint: rgba(238, 242, 250, 0.45);
  --line: rgba(255, 255, 255, 0.12);
  --surface: rgba(255, 255, 255, 0.06);
  --radius: 22px;
}

html {
  scroll-behavior: smooth;
}

body.home-page {
  min-height: 100svh;
  font-family: var(--font-sans, "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--home-bg-color, #0a0e15);
  background-image: var(--home-bg-image, none);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 1920px), (min-resolution: 2dppx) {
  body.home-page {
    background-image: var(--home-bg-image-4k, var(--home-bg-image, none));
  }
}

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

svg {
  display: block;
}

/* Ambient scrim keeps content readable over any background */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70rem 40rem at 82% -12%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 62%),
    radial-gradient(58rem 38rem at -8% 108%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(6, 10, 17, 0.55), rgba(6, 10, 17, 0.78) 60%, rgba(6, 10, 17, 0.9));
}

.home-page.has-photo .backdrop {
  background:
    radial-gradient(70rem 40rem at 82% -12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(5, 9, 15, 0.7), rgba(5, 9, 15, 0.9) 62%, rgba(5, 9, 15, 0.97));
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 4vw, 48px) clamp(16px, 2.5vw, 26px);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-bottom: clamp(20px, 3vw, 34px);
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.topbar-link svg {
  width: 1rem;
  height: 1rem;
}

.topbar-link:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.topbar-count {
  display: grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}

/* App launcher */
.app-launcher {
  position: relative;
  margin-right: auto;
}

.launcher-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.launcher-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.launcher-toggle:hover,
.app-launcher.is-open .launcher-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.launcher-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 36px));
  max-height: min(62vh, 430px);
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 19, 29, 0.92);
  box-shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.18s ease;
}

.app-launcher.is-open .launcher-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.launcher-title {
  margin: 0 0 10px;
  padding-left: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 6px 11px;
  border-radius: 12px;
  text-align: center;
  transition: background 0.16s ease;
}

.launcher-item:hover,
.launcher-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.launcher-ico {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.launcher-item:hover .launcher-ico {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.11);
}

.launcher-ico svg {
  width: 1.05rem;
  height: 1.05rem;
}

.launcher-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* Hero */
.hero {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(12px, 3vh, 36px);
}

.hero-copy {
  min-width: 0;
  max-width: 34rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.eyebrow-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.hero-title {
  margin-top: 1.1rem;
  font-family: var(--font-heading, "Instrument Serif", "Times New Roman", Georgia, serif);
  font-size: clamp(3.1rem, 7vw, 5.6rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  color: color-mix(in srgb, var(--accent) 42%, #f4f7ff);
}

.hero-lead {
  max-width: 30rem;
  margin-top: 1.35rem;
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  line-height: 1.75;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Card grid */
.hero-cards {
  min-width: 0;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}

.route-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1 / 1.04;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: var(--card-tint, #1b2434);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.route-card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--card-image, none);
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.route-card-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(6, 10, 17, 0.05) 18%, rgba(6, 10, 17, 0.5) 62%, rgba(6, 10, 17, 0.92) 100%),
    linear-gradient(140deg, color-mix(in srgb, var(--card-tint, #1b2434) 30%, transparent), transparent 62%);
}

.route-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  width: 100%;
  padding: clamp(14px, 1.5vw, 20px);
}

.route-card-index {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.route-card-title {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.route-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.76);
}

.route-card-cta svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.25s ease;
}

@media (hover: hover) {
  .route-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 26px 52px rgba(0, 0, 0, 0.48);
  }

  .route-card:hover .route-card-media {
    transform: scale(1.07);
  }

  .route-card:hover .route-card-cta svg {
    transform: translateX(4px);
  }
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: clamp(18px, 3vh, 28px);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.footer-visits {
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

:where(a, button):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, #fff);
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 900px) {
  body.home-page {
    background-attachment: scroll;
  }

  .hero {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 2.2rem;
    padding-block: 0.5rem 1.5rem;
  }

  .hero-copy {
    max-width: 40rem;
  }

  .hero-title {
    font-size: clamp(2.9rem, 9.5vw, 4.2rem);
  }

  .route-card {
    aspect-ratio: 1 / 0.82;
  }
}

@media (max-width: 560px) {
  .shell {
    padding-inline: 18px;
  }

  .topbar-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.74rem;
  }

  .launcher-panel {
    width: min(300px, calc(100vw - 36px));
    padding: 12px;
  }

  .launcher-ico {
    width: 2.35rem;
    height: 2.35rem;
  }

  .launcher-label {
    font-size: 0.68rem;
  }

  .hero-title {
    font-size: clamp(2.55rem, 12.5vw, 3.4rem);
  }

  .hero-lead {
    font-size: 0.92rem;
  }

  .route-grid {
    gap: 10px;
  }

  .route-card {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }

  .route-card-body {
    padding: 12px;
    gap: 0.22rem;
  }

  .route-card-title {
    font-size: 0.95rem;
  }

  .route-card-cta {
    font-size: 0.64rem;
  }

  .footer {
    font-size: 0.68rem;
  }
}

.route-grid .route-card--wide {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
