/* StudyGuard — reset, typography and small utilities. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Anchor links glide instead of jumping; switched off further down for
     visitors who ask for reduced motion. */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  /* Long emails and URLs must never push the layout sideways on a phone. */
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(21, 42, 69, 0.12);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--navy-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-accent-strong);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* The header stays on screen, so an anchor must stop below it. */
:target {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* Utilities */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-gutter);
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background-color: var(--navy-800);
  color: var(--white);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--white);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow--gold {
  color: var(--gold-700);
}

.subsection-title {
  margin-top: var(--space-8);
  margin-bottom: var(--space-5);
  font-size: var(--text-xl);
}

.notice {
  margin: var(--space-4) 0 0;
  padding: var(--space-4);
  border: var(--border-hairline);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background-color: var(--grey-050);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Scroll-in reveal --------------------------------------------------------- */

/*
 * Blocks fade and rise slightly as they enter the viewport. This is driven by
 * the scroll timeline in CSS, so no JavaScript is involved: browsers without
 * `animation-timeline` simply show the content straight away, which is why the
 * whole rule sits behind @supports.
 */
@keyframes sg-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section__head,
    .card,
    .step,
    .plan,
    .faq,
    .contact-link,
    .form-card,
    .panel {
      animation: sg-reveal var(--duration-slow) var(--ease-out) both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

/* Reduced motion ---------------------------------------------------------- */

/*
 * Respect the system setting: keep the site fully usable but perfectly still.
 * Hover states still change colour, they just stop moving.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
