/* gapnostic.com: what every page shares.
 *
 * The same quiet instrument as the app (frontend/src/styles/tokens.css): one
 * ink-blue accent, Inter for the interface, Source Serif 4 for anything read
 * closely, hairlines instead of boxes. Loaded after a page's own styles, so the
 * header, footer and type here win on every page.
 */

:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-sunken: #f3f5f9;
  --border: #e4e8ef;
  --row-sep: #edf0f4;
  --text: #141c2e;
  --text-soft: #515b70;
  --text-faint: #636d82;
  --ink: #0d1526;
  --accent: #243a73;
  --accent-hover: #2c4891;
  --accent-bright: #3b62e0;
  --accent-soft: #eef2fb;
  --accent-line: #c8d3ef;
  --navy: #10172a;
  --ai-surface: #f3f5fc;
  --ai-rule: #97a5cd;
  --green: #166534;
  --font-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-lift: 0 18px 44px rgba(13, 21, 38, 0.12), 0 2px 6px rgba(13, 21, 38, 0.05);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --focus-ring: 0 0 0 3px rgba(59, 98, 224, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

.gx-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- header --- */

header.gx-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--row-sep);
}

.gx-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.gx-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.gx-brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.gx-nav {
  display: flex;
  gap: 28px;
}

.gx-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.gx-nav a:hover {
  color: var(--ink);
}

.gx-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- the menu on a phone: a button that opens the places, no script --- */

.gx-menu {
  display: none;
  position: relative;
}

.gx-menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.gx-menu summary::-webkit-details-marker {
  display: none;
}

.gx-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  display: grid;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}

.gx-menu nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}

.gx-menu nav a:hover {
  background: var(--panel-sunken);
}

/* --- buttons --- */

.gx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    transform 160ms var(--ease);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 18px rgba(36, 58, 115, 0.22);
}

.gx-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.gx-button.secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: none;
}

.gx-button.secondary:hover {
  border-color: var(--accent-line);
  background: var(--panel);
}

.gx-button.quiet {
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
}

.gx-button.quiet:hover {
  color: var(--ink);
  background: var(--panel-sunken);
  transform: none;
}

.gx-button.large {
  min-height: 50px;
  padding: 0 24px;
  font-size: 16px;
  border-radius: 12px;
}

/* --- footer --- */

footer.gx-footer {
  margin: 0;
  padding: 64px 0 40px;
  background: var(--navy);
  border-top: none;
  color: #aeb8d0;
  font-size: 14px;
}

.gx-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.gx-footer .gx-brand {
  color: #fff;
}

.gx-footer p {
  margin: 14px 0 0;
  max-width: 34ch;
  line-height: 1.6;
  color: #aeb8d0;
}

.gx-footer h2 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f8bab;
  margin: 4px 0 14px;
}

.gx-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gx-footer li {
  margin: 0 0 10px;
}

.gx-footer a {
  color: #d5dcec;
  text-decoration: none;
}

/* Big enough to tap on a phone (QA, 15 October 2026: about 17 px tall). */
.gx-footer li a {
  display: inline-block;
  padding: 7px 0;
}

.gx-footer li {
  margin: 0 0 2px;
}

.gx-footer a:hover {
  color: #fff;
}

.gx-footer-base {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: #7f8bab;
}

/* --- article pages: the same serif titles as the app --- */

.gx-article main {
  padding-top: 64px;
  padding-bottom: 80px;
}

.gx-article main h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink);
}

.gx-article main h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.gx-article main a.entry h2 {
  font-family: var(--font-display);
}

/* --- smaller screens --- */

@media (max-width: 860px) {
  .gx-nav {
    display: none;
  }
  .gx-menu {
    display: block;
  }
  .gx-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gx-footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .gx-inner {
    padding: 0 16px;
  }
  .gx-actions .gx-button.quiet {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
