/*
 * Shared foundation for eoinmcgrath.com
 * Page-specific heroes, grids and interactions stay in each page's <style>.
 */
:root {
  color-scheme: dark;
  --bg: #122434;
  --ink: #ece9e1;
  --mute: #93a4b3;
  --line: #8ecae6;
  --rule: rgba(236, 233, 225, .14);
  --accent: #f0709f;
  --btn-ink: #0f1b26;
  --serif: "Bricolage Grotesque", sans-serif;
  --display: var(--serif);
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

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

*, *::before, *::after { box-sizing: inherit; }
html {
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(5rem + env(safe-area-inset-top, 0px));
}
body {
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; transition: color .2s ease; }
a:hover { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: max(1.5rem, env(safe-area-inset-left, 0px)) max(1.5rem, env(safe-area-inset-right, 0px));
}
.skip-link {
  position: absolute;
  top: 0;
  left: max(1.5rem, env(safe-area-inset-left, 0px));
  z-index: 50;
  transform: translateY(-150%);
  padding: .65rem 1rem;
  background: var(--ink);
  color: var(--btn-ink);
  font-weight: 600;
}
.skip-link:focus { top: calc(.5rem + env(safe-area-inset-top, 0px)); transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Shared sticky header: the .scrolled class is set by each page's tiny script. */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: transparent;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.scrolled header {
  background-color: rgba(10, 22, 35, .95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--rule);
}
nav {
  min-height: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  font-size: .95rem;
}
nav .name { font-weight: 600; text-decoration: none; white-space: nowrap; }
nav ul { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
nav a { display: inline-block; padding: .5rem 0; text-decoration: none; }
nav ul a { color: var(--mute); }
nav ul a:hover { color: var(--accent); }

/* Common controls and small typography accents. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.45rem;
  border-radius: .25rem;
  background: var(--ink);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); color: var(--btn-ink); }
.cta { display: flex; align-items: center; flex-wrap: wrap; }
.eyebrow { color: var(--line); font-size: .76rem; font-weight: 600; text-transform: uppercase; }

/* Footer layout is consistent; each page chooses its wording. */
footer {
  position: relative;
  z-index: 1;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  background: rgba(5, 11, 19, .38);
  color: var(--mute);
  font-size: .9rem;
}
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
footer a { text-underline-offset: .2em; text-decoration-color: var(--rule); }

@media (max-width: 760px) {
  nav ul { gap: 1.1rem; }
}
@media (max-width: 480px) {
  html { scroll-padding-top: calc(7.5rem + env(safe-area-inset-top, 0px)); }
  nav { flex-wrap: wrap; align-items: flex-start; gap: 0 .75rem; }
  nav .name { flex-basis: 100%; }
  nav ul { width: 100%; justify-content: flex-start; gap: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
