/*
 * BYU IS links page. Phone-first, self-contained: system fonts only,
 * no external assets beyond the official lockup. See DESIGN-BRIEF.md.
 *
 * The first link in #links gets the primary treatment automatically
 * via :first-child, so app.js and links.json need no changes: whichever
 * link is listed first is the primary call to action.
 */

:root {
  --navy: #19315B;
  --navy-deep: #08122D;
  --blue-mid: #376293;
  --cyan: #9FE9ED;
  --cyan-bright: #B6EFF2;
  --grey: #7D8990;
  --pale: #CCD6E0;
  --pale-dim: #A9B8C9;
  --white: #FFFFFF;

  --radius: 16px;
  --radius-lg: 18px;
  --gap: 8px;
  --measure: 30rem;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(120% 60% at 50% -10%,
              #24476F 0%, var(--navy) 42%, var(--navy-deep) 100%);
  background-attachment: fixed;
  color: var(--white);
  min-height: 100svh;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: var(--measure);
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* Respect notches and home indicators; this is scanned on phones. */
  padding: max(2.25rem, env(safe-area-inset-top)) 1.25rem
           max(1.5rem, env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 1.15rem;
  text-align: center;
  animation: rise-in 0.5s ease both;
}

.lockup {
  width: 180px;
  max-width: 62%;
  height: auto;
  /* The lockup ships in navy on transparent, so invert it on a dark field. */
  filter: brightness(0) invert(1);
}

.title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.25;
  color: var(--pale);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* The one cyan dot before the tagline. */
.tagline::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ---------- Link buttons ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  /* On anything wider than a phone, keep the buttons a sane width
     and center them rather than stretching to the column edge. */
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
}

.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;

  /* Tap target stays above the 60px target from the brief. */
  min-height: 62px;
  padding: 0.5rem 1.1rem;

  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);

  color: var(--white);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  animation: rise-in 0.5s ease both;
}

/* Staggered entrance. Covers the eight-link maximum. */
.link:nth-child(1) { animation-delay: 0.06s; }
.link:nth-child(2) { animation-delay: 0.10s; }
.link:nth-child(3) { animation-delay: 0.14s; }
.link:nth-child(4) { animation-delay: 0.18s; }
.link:nth-child(5) { animation-delay: 0.22s; }
.link:nth-child(6) { animation-delay: 0.26s; }
.link:nth-child(7) { animation-delay: 0.30s; }
.link:nth-child(8) { animation-delay: 0.34s; }

.link:hover,
.link:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(159, 233, 237, 0.4);
}

.link:active { transform: scale(0.985); }

.link:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.link-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.25;
}

.link-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.link-subtitle {
  font-size: 0.78125rem;
  color: var(--pale-dim);
}

.link-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(159, 233, 237, 0.12);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  padding-bottom: 3px;
}

/* ---------- Primary link: whichever one is listed first ---------- */

.link:first-child {
  min-height: 72px;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--navy-deep);
  box-shadow: 0 10px 28px -14px rgba(159, 233, 237, 0.65);
}

.link:first-child:hover,
.link:first-child:focus-visible {
  background: var(--cyan-bright);
  border-color: var(--cyan-bright);
}

.link:first-child:focus-visible {
  outline-color: var(--white);
}

.link:first-child .link-text::before {
  content: "Start here";
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-mid);
}

.link:first-child .link-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.link:first-child .link-subtitle {
  font-size: 0.8125rem;
  color: rgba(8, 18, 45, 0.68);
}

.link:first-child .link-arrow {
  width: 34px;
  height: 34px;
  background: rgba(8, 18, 45, 0.1);
  color: var(--navy-deep);
  font-size: 1.375rem;
}

/* ---------- Placeholder: a link whose URL is still "#" ---------- */

.link.is-placeholder,
.link:first-child.is-placeholder {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  cursor: default;
}

.link.is-placeholder .link-subtitle,
.link:first-child.is-placeholder .link-subtitle { color: var(--grey); }

.link:first-child.is-placeholder .link-text::before { color: var(--grey); }

/* The arrow becomes a "Soon" pill. */
.link.is-placeholder .link-arrow {
  width: auto;
  height: auto;
  border-radius: 999px;
  background: none;
  border: 1px solid rgba(125, 137, 144, 0.5);
  padding: 0.3rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

.link.is-placeholder .link-arrow::after { content: "Soon"; }

/* Hide the chevron glyph itself, keep the pill. */
.link.is-placeholder .link-arrow { font-size: 0; }
.link.is-placeholder .link-arrow::after { font-size: 0.625rem; }

/* ---------- Empty state ---------- */

.links:empty::after {
  content: "Links are being updated. Check back shortly.";
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  padding: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--pale-dim);
  font-size: 0.9375rem;
}

/* ---------- Footer and notices ---------- */

.footer {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer::before {
  content: "";
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.footer p {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--grey);
}

.notice {
  text-align: center;
  color: var(--pale);
  font-size: 0.9rem;
}

.notice a { color: var(--cyan); }

/* ---------- Motion ---------- */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
