/*
  UNSW Face Test
  Shared design system for homepage, AI Faces, FAQ, language, researcher request,
  test, and completion pages.
*/

/* =========================
   Design tokens
========================= */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --text: #0c1b2a;
  --muted: #516173;
  --line: #d7e0ea;
  --brand: #0b4ea2;
  --brand-dark: #083c7a;
  --brand-soft: rgba(11, 78, 162, 0.08);
  --shadow: 0 8px 24px rgba(12, 27, 42, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1120px;
  --narrow: 760px;
}

/* =========================
   Base
========================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--brand-dark);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: -9999px;
  z-index: 1000;
  padding: 0.85rem 1rem;
  color: var(--text);
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

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

/* =========================
   Layout
========================= */

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.narrow {
  width: min(var(--narrow), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.section.compact {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.section-tint {
  background: linear-gradient(180deg, #eef4fb 0%, #f6f8fb 100%);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.2fr);
  gap: clamp(1.75rem, 4vw, 4rem);
  align-items: center;
}

.content-grid > .section-copy,
.content-grid > div {
  min-width: 0;
}

.section-copy {
  color: var(--muted);
  font-size: 1.03rem;
}

.section-copy p {
  margin: 0 0 1rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  max-width: 24ch;
}

/* =========================
   Header and navigation
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 251, 0.9);
  border-bottom: 1px solid rgba(215, 224, 234, 0.8);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.02rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  padding: 0.55rem 0.2rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.75rem 1rem !important;
  color: #fff !important;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(11, 78, 162, 0.18);
}

.nav-cta:hover {
  color: #fff !important;
  background: var(--brand-dark);
}

/* =========================
   Typography
========================= */

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 16ch;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

h2 {
  max-width: 20ch;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
}

h3 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h4 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p {
  margin-bottom: 1rem;
}

.hero-text {
  max-width: 58ch;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.7vw, 1.28rem);
  line-height: 1.6;
}

.section-copy {
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.7;
}

.section-copy p {
  margin: 0 0 1rem;
}

.card p,
.mini-card p,
.cta-section p,
.registry-box p {
  line-height: 1.65;
}

.card-kicker,
.link-card span,
.eyebrow,
.comparison-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--brand);
}

.card-cta {
  font-size: 0.98rem;
  line-height: 1.4;
}

/* =========================
   Hero
========================= */

.hero {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: clamp(2.25rem, 5vw, 4.5rem);
}

.hero .narrow {
  text-align: center;
}

.hero .narrow h1,
.hero .narrow h2 {
  margin-right: auto;
  margin-left: auto;
}

.hero-text {
  max-width: 60ch;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
}

.hero .narrow .hero-text {
  margin-right: auto;
  margin-left: auto;
}

.hero-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.hero .narrow .hero-actions,
.cta-section .hero-actions {
  justify-content: center;
}

/* =========================
   Buttons
========================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(11, 78, 162, 0.18);
}

.button-primary:hover {
  color: #fff;
  background: var(--brand-dark);
}

.button-secondary {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.button-secondary:hover {
  color: var(--text);
  border-color: #b8c6d6;
}

/* =========================
   Cards and link cards
========================= */

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

.card-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.link-card,
.mini-card,
.registry-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card,
.link-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card {
  min-height: 100%;
  padding: 1.35rem;
}

.card:hover,
.link-card:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: #b8c6d6;
  box-shadow: var(--shadow);
}

.card-kicker {
  display: inline-block;
  margin-bottom: 0.85rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.card-note {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-cta {
  margin-top: 1rem;
  color: var(--brand) !important;
  font-weight: 700;
}

.card:hover .card-cta {
  text-decoration: underline;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.9rem;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  background: var(--brand-soft);
  border-radius: 999px;
}

.link-cards {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.link-card {
  padding: 1rem 1.1rem;
}

.link-card span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link-card strong {
  display: block;
  font-size: 1.02rem;
}

.mini-card {
  padding: 1.1rem;
}

.mini-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.mini-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* =========================
   Images and media
========================= */

.image-band {
  padding: 1rem 0 clamp(2rem, 4vw, 3.5rem);
}

.ratio-image {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.image-small {
  width: min(50%, 520px);
  margin: 0 auto;
}

.image-caption {
  max-width: 44ch;
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* =========================
   Comparison labels
========================= */

.comparison-label {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-label span {
  display: block;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* =========================
   Callouts and CTAs
========================= */

.registry-box {
  padding: 2rem;
  text-align: center;
}

.registry-box p {
  max-width: 60ch;
  margin: 0.75rem auto;
  color: var(--muted);
}

.cta-section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fc 100%);
  border-top: 1px solid var(--line);
}

.cta-section .narrow {
  text-align: center;
}

.cta-section h2 {
  margin-right: auto;
  margin-left: auto;
}

.cta-section p {
  max-width: 60ch;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1.03rem;
}

/* =========================
   Language page
========================= */

.language-grid {
  margin-top: 0.5rem;
}

.language-page .hero,
body:has(.language-grid) .hero {
  padding-bottom: 1.25rem;
}

body:has(.language-grid) .section:first-of-type + .section {
  padding-top: 1.25rem;
}

/* =========================
   Footer
========================= */

.site-footer {
  padding: 2rem 0 2.5rem;
  background: #f3f7fb;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.footer-logo {
  display: inline-block;
}

.footer-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.site-footer p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1.25rem;
  justify-items: start;
}

.footer-links a {
  padding: 0.2rem 0;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* =========================
   Responsive
========================= */

@media (max-width: 920px) {
  .content-grid,
  .card-grid,
  .card-grid.two-column,
  .mini-card-row,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .comparison-label {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 0.6rem;
  }

  h1,
  h2 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero .narrow,
  .cta-section .narrow {
    text-align: left;
  }

  .hero .narrow h1,
  .hero .narrow h2,
  .cta-section h2 {
    margin-left: 0;
  }

  .hero .narrow .hero-text {
    margin-left: 0;
  }

  .hero .narrow .hero-actions,
  .cta-section .hero-actions {
    justify-content: flex-start;
  }

  .image-small {
    width: 100%;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
