/* ==========================================================================
   williambrand.dev — shared shell
   Every page loads this file. Colours and fonts are variables; each page's
   own stylesheet redefines them on :root to give that page its look.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-wdth-wght.woff2") format("woff2-variations"),
       url("/assets/fonts/archivo-wdth-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("/assets/fonts/vt323.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Neutral defaults — pages override these */
  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --fg: #151515;
  --muted: #4d4d4d;
  --dim: #6b6b6b;
  --line: #e2e2e2;
  --line-strong: #c8c8c8;
  --accent: #1a56db;
  --accent-hover: #1646b3;
  --on-accent: #ffffff;

  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --radius-btn: 10px;
  --radius-media: 16px;

  --gutter: clamp(1.25rem, 5.6vw, 4.5rem);
  --max: 1136px;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, p, figure, dl, dd { margin: 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-btn);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--bg); }

/* --- Layout --------------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

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

.site-header { border-bottom: 1px solid var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 5.5rem;
}

.site-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.site-name:hover { color: var(--fg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav__link {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
}
.site-nav__link:hover { color: var(--fg); }

@media (max-width: 760px) {
  .site-nav__link { display: none; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn--lg {
  min-height: 56px;
  padding: 0 1.875rem;
  font-size: 1.0625rem;
}

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn--ghost { border-color: var(--line-strong); color: var(--fg); font-weight: 500; }
.btn--ghost:hover { border-color: var(--muted); color: var(--fg); }

/* Not a link: shown before an app is live on the App Store */
.btn--soon {
  background: var(--bg-alt);
  color: var(--muted);
  font-weight: 500;
  cursor: default;
}

/* Pre-launch switch: <html class="prelaunch"> shows .when-soon and hides
   .when-live. Remove the class on launch day. */
.prelaunch .when-live { display: none !important; }
html:not(.prelaunch) .when-soon { display: none !important; }

/* --- Footer --------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem 3rem;
  padding-block: 3.25rem 3.5rem;
}

.site-footer__meta {
  display: grid;
  gap: 0.375rem;
}

.site-footer__small {
  font-size: 0.9375rem;
  color: var(--dim);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
}

.site-footer__nav a {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.625rem; /* 44px tap target */
}
.site-footer__nav a:hover { color: var(--fg); }
