/* ==========================================================================
   Grace Guide — marketing site
   Mobile-first, section-organized
   ========================================================================== */

:root {
  --gg-teal: #3ec9b9;
  --gg-teal-soft: #7dd3c8;
  --gg-teal-deep: #0f766e;
  --gg-mint: #b8ebe3;
  --gg-ink: #0b1220;
  --gg-ink-soft: rgba(11, 18, 32, 0.86);
  --gg-snow: rgba(255, 255, 255, 0.94);
  --gg-muted: rgba(255, 255, 255, 0.72);
  --gg-line: rgba(255, 255, 255, 0.12);
  --gg-card: rgba(255, 255, 255, 0.07);
  --gg-card-strong: rgba(255, 255, 255, 0.1);
  --gg-shadow: 0 18px 50px rgba(5, 20, 30, 0.45);
  --gg-shadow-soft: 0 10px 30px rgba(5, 20, 30, 0.25);
  --gg-radius-lg: 22px;
  --gg-radius-md: 16px;
  --gg-radius-sm: 12px;
  --gg-header-h: 64px;
  --gg-max: 1120px;
  --gg-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gg-snow);
  background: #071018;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gg-teal-soft);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--gg-ink);
  color: var(--gg-snow);
  border-radius: 999px;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
}

/* --------------------------------------------------------------------------
   Ambient background
   -------------------------------------------------------------------------- */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-bg__stack {
  position: absolute;
  inset: -8%;
  filter: blur(34px) saturate(1.05);
  transform: translateZ(0);
  will-change: filter;
}

@media (prefers-reduced-motion: reduce) {
  .ambient-bg__stack {
    filter: blur(28px) saturate(1.02);
  }
}

.ambient-bg__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2.4s var(--gg-ease);
}

.ambient-bg__layer.is-active {
  opacity: 1;
}

.ambient-bg__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(62, 201, 185, 0.22), transparent 55%),
    radial-gradient(900px 600px at 85% 30%, rgba(125, 211, 200, 0.12), transparent 50%),
    linear-gradient(165deg, rgba(7, 16, 24, 0.2), rgba(7, 16, 24, 0.65));
  mix-blend-mode: multiply;
}

.ambient-bg__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 14, 22, 0.55), rgba(6, 14, 22, 0.82));
}

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7, 16, 24, 0.72), rgba(7, 16, 24, 0.35));
  border-bottom: 1px solid var(--gg-line);
}

.site-header__inner {
  max-width: var(--gg-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--gg-header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.brand__name {
  font-size: 1.05rem;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--gg-line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  padding: 0;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--gg-snow);
  border-radius: 2px;
  transition: transform 0.25s var(--gg-ease), opacity 0.25s var(--gg-ease);
}

.site-nav {
  position: fixed;
  inset: var(--gg-header-h) 0 auto 0;
  background: rgba(7, 16, 24, 0.96);
  border-bottom: 1px solid var(--gg-line);
  padding: 0.75rem 1.25rem 1.25rem;
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--gg-ease), opacity 0.3s var(--gg-ease);
}

.site-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-nav__link {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--gg-muted);
  font-weight: 550;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--gg-snow);
  background: rgba(255, 255, 255, 0.06);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 880px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    inset: auto;
    background: transparent;
    border: 0;
    padding: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav__list {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }

  .site-nav__link {
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   Layout shell & sections
   -------------------------------------------------------------------------- */

main {
  position: relative;
  z-index: 1;
}

.shell {
  max-width: var(--gg-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.25rem 0;
  scroll-margin-top: calc(var(--gg-header-h) + 0.75rem);
}

.section--hero {
  padding: 2.25rem 0 3.5rem;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
}

.section--closing {
  padding-bottom: 2rem;
}

.section-head {
  margin-bottom: 1.75rem;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: 0.01em;
}

.section-sub {
  margin: 0;
  color: var(--gg-muted);
  max-width: 52ch;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gg-mint);
  font-weight: 650;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero__visual.reveal {
  /* Keep the turquoise backplate permanently visible (no flash). */
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(320px, 72vw);
  height: min(320px, 72vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: transparent;
  filter: none;
  opacity: 0 !important;
  transition: none;
}

.hero__icon-card {
  position: relative;
  padding: 1.0rem;
  border-radius: 34px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden; /* Clip the turquoise glow so it stays within the stroke. */
}

.hero__icon-card::before {
  content: '';
  position: absolute;
  inset: -22%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(62, 201, 185, 0.35), transparent 62%);
  filter: blur(44px);
  opacity: 0.72;
  pointer-events: none;
  z-index: 0;
}

.hero__icon {
  position: relative;
  z-index: 1;
  width: min(240px, 54vw);
  height: auto;
  border-radius: 26px;
  transform-origin: center;
  transform: scale(1.15);
}

.hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero__lede {
  margin: 0 0 1.5rem;
  color: var(--gg-muted);
  font-size: 1.05rem;
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 3rem;
  }

  .hero__visual {
    order: 2;
  }

  .hero__copy {
    order: 1;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--gg-ease), box-shadow 0.2s var(--gg-ease), background 0.2s var(--gg-ease), border-color 0.2s var(--gg-ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--gg-teal), #2fb8a8);
  color: #041016;
  box-shadow: 0 12px 30px rgba(47, 184, 168, 0.35);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(47, 184, 168, 0.45);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--gg-snow);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

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

/* --------------------------------------------------------------------------
   Panels & cards
   -------------------------------------------------------------------------- */

.panel {
  border-radius: var(--gg-radius-lg);
  background: linear-gradient(180deg, var(--gg-card-strong), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--gg-line);
  box-shadow: var(--gg-shadow-soft);
  padding: 1.5rem;
}

.panel--intro .intro-quote {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--gg-snow);
}

.panel__grid--split {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 800px) {
  .panel--intro {
    padding: 2rem 2rem;
  }

  .panel__grid--split {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.25rem;
  }
}

.device-shot {
  margin: 0;
  border-radius: var(--gg-radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--gg-shadow);
  background: rgba(0, 0, 0, 0.2);
}

.device-shot__img {
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Feature rows (Guidance)
   -------------------------------------------------------------------------- */

.feature {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: var(--gg-radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gg-line);
  box-shadow: var(--gg-shadow-soft);
}

.feature__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.feature__text {
  margin: 0;
  color: var(--gg-muted);
}

.device-frame {
  margin: 0;
  border-radius: var(--gg-radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: var(--gg-shadow);
}

.device-frame__img {
  width: 100%;
  height: auto;
}

.device-frame--compact {
  max-width: 420px;
  margin-inline: auto;
}

.device-frame--flush {
  border-radius: var(--gg-radius-md);
}

@media (min-width: 860px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .feature--reverse .feature__content {
    order: 2;
  }

  .feature--reverse .device-frame {
    order: 1;
  }
}

/* --------------------------------------------------------------------------
   Studies
   -------------------------------------------------------------------------- */

.card {
  border-radius: var(--gg-radius-lg);
  border: 1px solid var(--gg-line);
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--gg-shadow-soft);
}

.card__lead {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gg-snow);
}

.study-grid {
  display: grid;
  gap: 1.25rem;
}

.study-card {
  border-radius: var(--gg-radius-lg);
  border: 1px solid var(--gg-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  padding: 1.35rem;
  display: grid;
  gap: 1.1rem;
  transition: transform 0.25s var(--gg-ease), box-shadow 0.25s var(--gg-ease), border-color 0.25s var(--gg-ease);
}

.study-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gg-shadow);
  border-color: rgba(255, 255, 255, 0.2);
}

.study-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.study-card__text {
  margin: 0;
  color: var(--gg-muted);
}

.study-card--wide {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .study-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-card--wide {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .study-card:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Customization / cross preview
   -------------------------------------------------------------------------- */

.custom-grid {
  display: grid;
  gap: 1.25rem;
}

.custom-card {
  border-radius: var(--gg-radius-lg);
  border: 1px solid var(--gg-line);
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  box-shadow: var(--gg-shadow-soft);
  transition: transform 0.25s var(--gg-ease), box-shadow 0.25s var(--gg-ease);
}

.custom-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--gg-shadow);
}

.custom-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.custom-card__text {
  margin: 0 0 1.1rem;
  color: var(--gg-muted);
}

.cross-preview {
  border-radius: var(--gg-radius-lg);
  padding: 1.5rem 1.25rem 1.25rem;
  background: radial-gradient(600px 240px at 50% 0%, rgba(62, 201, 185, 0.18), transparent 60%), rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-preview__inner {
  position: relative;
  width: min(220px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 0.75rem;
}

.cross-preview__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.25rem;
  filter: brightness(0) invert(1);
  opacity: 0;
  transition: opacity 0.55s var(--gg-ease);
}

.cross-preview__layer.is-visible {
  opacity: 1;
}

.cross-preview__caption {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gg-muted);
}

@media (min-width: 900px) {
  .custom-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .custom-card:hover {
    transform: none;
  }

  .cross-preview__layer {
    transition: opacity 0.2s linear;
  }
}

/* --------------------------------------------------------------------------
   Legal
   -------------------------------------------------------------------------- */

.legal-layout {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
}

.legal-ref {
  margin: 0;
  border-radius: var(--gg-radius-lg);
  overflow: hidden;
  border: 1px solid var(--gg-line);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: var(--gg-shadow-soft);
}

.legal-ref__img {
  width: 100%;
  height: auto;
  opacity: 0.95;
}

.legal-actions {
  display: grid;
  gap: 0.85rem;
}

.legal-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--gg-radius-md);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  box-shadow: var(--gg-shadow-soft);
  transition: transform 0.2s var(--gg-ease), border-color 0.2s var(--gg-ease), background 0.2s var(--gg-ease);
}

.legal-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 201, 185, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
}

.legal-tile__label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.legal-tile__hint {
  font-size: 0.9rem;
  color: var(--gg-muted);
}

@media (min-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr 0.9fr;
    gap: 2rem;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-tile:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Closing & footer
   -------------------------------------------------------------------------- */

.section--closing {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.closing {
  text-align: center;
  padding: 2rem 1rem 1rem;
  border-radius: var(--gg-radius-lg);
  background: linear-gradient(180deg, rgba(62, 201, 185, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--gg-shadow-soft);
}

.closing__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
}

.closing__text {
  margin: 0 auto 1.25rem;
  max-width: 52ch;
  color: var(--gg-muted);
}

.closing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gg-muted);
  font-size: 0.92rem;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}

.site-footer__copy {
  margin: 0;
}

.site-footer__nav a {
  color: var(--gg-muted);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--gg-snow);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
}

.site-footer__dot {
  opacity: 0.45;
}

@media (min-width: 720px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Image fallback & reveal animations
   -------------------------------------------------------------------------- */

.img-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 1.25rem;
  text-align: center;
  color: var(--gg-muted);
  font-size: 0.95rem;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.img-fallback.is-visible {
  display: flex;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--gg-ease), transform 0.7s var(--gg-ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
