/* ==========================================================================
   Gérard Kieffer — pixel art redesign
   Fonts: Press Start 2P (hero H1) + Figtree (headings) + Ubuntu Sans (body)
   FontAwesome: loaded separately in index.html.
   ========================================================================== */


/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Core palette */
  --dark:         #0C0C1D;   /* pixel-dark navy */
  --blue:         #131875;   /* brand blue — links, accents on light bg */
  --blue-dark:    #1a5ba8;
  --yellow:       #FFE600;   /* electric yellow — signature accent */
  --white:        #FAFAFA;
  --warm:         #F0EDE8;   /* off-white for alternate sections */
  --text:         #1A1A1A;   /* body text on white: 16.1:1 ✓ */
  --muted:        #5A5A5A;   /* secondary text */
  --border:       #0C0C1D;   /* pixel borders */
  --border-light: #D0CCC8;   /* decorative / dividers */

  /* Fonts */
  --font-pixel:   'Press Start 2P', monospace;
  --font-heading: 'Figtree', Arial, sans-serif;
  --font-body:    'Ubuntu Sans', Arial, sans-serif;

  /* 4px pixel grid base */
  --px: 4px;

  /* Pixel shadows */
  --shadow-px:        4px 4px 0 0 var(--border);
  --shadow-px-yellow: 8px 8px 0 0 var(--yellow);

  /* Spacing (4px multiples) */
  --sp-sm:  1rem;    /* 16px */
  --sp-md:  2rem;    /* 32px */
  --sp-lg:  4rem;    /* 64px */
  --sp-xl:  5rem;    /* 80px */
  --gutter: 2rem;

  /* Content widths */
  --max-w:        62rem;
  --max-w-narrow: 46rem;
}


/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

ul {
  list-style: none;
}


/* --------------------------------------------------------------------------
   Base typography
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

/* Hero H1 only uses the pixel font — all other headings use Figtree */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
}

h2 { font-size: clamp(1.35rem, 3vw,  1.875rem); }
h3 { font-size: clamp(1.1rem,  2vw,  1.375rem); }

p {
  margin-bottom: var(--sp-md);
}
p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.1s ease;
}
a:hover {
  color: var(--blue-dark);
}

em {
  font-style: italic;
}


/* --------------------------------------------------------------------------
   Focus — keyboard navigation (WCAG 2.4.7)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 0;
}


/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 9999;
  padding: 0.6em 1.2em;
  background: var(--yellow);
  color: var(--dark);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 400;
  text-decoration: none;
  border: 2px solid var(--dark);
  box-shadow: var(--shadow-px);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--dark);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   FontAwesome icon integration
   -------------------------------------------------------------------------- */
.icon::before {
  display: inline-block;
  font-family: 'Font Awesome 5 Free';
  font-weight: 400;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.icon.solid::before  { font-weight: 900; }
.icon.brands::before {
  font-family: 'Font Awesome 5 Brands';
  font-weight: 400;
}
.icon > .label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Buttons — pixel shadow press effect
   -------------------------------------------------------------------------- */
.button {
  display: inline-block;
  padding: 0.75em 1.75em;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0;
  border: 2px solid var(--dark);
  color: var(--dark);
  background: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-px);
  transition: box-shadow 0.08s ease, transform 0.08s ease;
}
.button:hover {
  box-shadow: 2px 2px 0 0 var(--dark);
  transform: translate(2px, 2px);
  text-decoration: none;
  color: var(--dark);
  background: var(--white);
}

/* Primary = yellow fill */
.button.primary {
  background: var(--yellow);
  border-color: var(--dark);
  color: var(--dark);
}
.button.primary:hover {
  background: var(--yellow);
  color: var(--dark);
}

.button.icon::before {
  margin-right: 0.5em;
  vertical-align: -0.05em;
}

/* Hero buttons on dark background */
#header .button {
  border-color: var(--white);
  color: var(--white);
  background: transparent;
  box-shadow: 4px 4px 0 0 rgba(255,255,255,0.5);
}
#header .button:hover {
  color: var(--white);
  background: transparent;
  box-shadow: 2px 2px 0 0 rgba(255,255,255,0.5);
  transform: translate(2px, 2px);
}
#header .button.primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--dark);
  box-shadow: 4px 4px 0 0 rgba(255,255,255,0.3);
}
#header .button.primary:hover {
  background: var(--yellow);
  color: var(--dark);
  box-shadow: 2px 2px 0 0 rgba(255,255,255,0.3);
  transform: translate(2px, 2px);
}

ul.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}
ul.actions.special {
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .button:hover {
    transition: none;
    transform: none;
    box-shadow: var(--shadow-px);
  }
  #header .button,
  #header .button:hover {
    transform: none;
    box-shadow: 4px 4px 0 0 rgba(255,255,255,0.5);
  }
}


/* --------------------------------------------------------------------------
   Section wrappers
   -------------------------------------------------------------------------- */
.wrapper {
  padding: var(--sp-lg) var(--gutter);
  background: var(--white);
  border-top: 2px solid var(--dark);
}
.wrapper.style2 {
  background: var(--warm);
  text-align: center;
}
.wrapper > .inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.wrapper.style2 > .inner {
  max-width: var(--max-w-narrow);
}
.inner.alt > * + * {
  border-top: 2px solid var(--border-light);
  margin-top: var(--sp-lg);
  padding-top: var(--sp-lg);
}
section.special {
  text-align: center;
}

/* Section heading with yellow pixel underline */
header.major {
  margin-bottom: var(--sp-lg);
}
header.major h2 {
  margin-bottom: 0.5em;
}
header.major p {
  font-size: 1.05rem;
}
header.major::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: var(--px);
  background: var(--yellow);
  border: 1px solid var(--dark);
  margin: var(--sp-md) auto 0;
}

/* CTA section — dark variant */
#three.wrapper {
  background: var(--dark);
  border-top: 4px solid var(--yellow);
}
#three h2 {
  color: var(--white);
}
#three p {
  color: rgba(255,255,255,0.75);
}
#three .button {
  border-color: var(--white);
  color: var(--white);
  background: transparent;
  box-shadow: 4px 4px 0 0 rgba(255,255,255,0.4);
}
#three .button:hover {
  box-shadow: 2px 2px 0 0 rgba(255,255,255,0.4);
  transform: translate(2px, 2px);
  background: transparent;
  color: var(--white);
}
#three .button.primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--dark);
  box-shadow: 4px 4px 0 0 rgba(255,255,255,0.25);
}
#three .button.primary:hover {
  background: var(--yellow);
  color: var(--dark);
  box-shadow: 2px 2px 0 0 rgba(255,255,255,0.25);
}
#three header.major::after {
  background: var(--yellow);
  border-color: rgba(255,255,255,0.3);
}


/* --------------------------------------------------------------------------
   Spotlights — alternating image + text rows
   -------------------------------------------------------------------------- */
.spotlight {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}
.spotlight .image {
  flex: 0 0 180px;
}
.spotlight .image img {
  width: 100%;
  border-radius: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--dark);
  box-shadow: var(--shadow-px);
}
.spotlight .content {
  flex: 1;
}
.spotlight .content h3 {
  margin-bottom: 0.6em;
}
.spotlight:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}


/* --------------------------------------------------------------------------
   Icon lists
   -------------------------------------------------------------------------- */
ul.icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2em;
}
ul.icons.major li {
  font-size: 2.5rem;
  color: var(--border-light);
}
ul.icons.major li a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.1s ease;
}
ul.icons.major li a:hover {
  color: var(--dark);
}
ul.icons.labeled {
  gap: 1em 2.5em;
}
ul.icons.labeled li {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95rem;
}
ul.icons.labeled .icon::before {
  font-size: 1.4rem;
  color: var(--blue);
}
ul.icons.labeled .icon > .label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
#footer ul.icons {
  gap: 0 1.5em;
}
#footer ul.icons a {
  font-size: 1.5rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s ease;
}
#footer ul.icons a:hover {
  color: var(--yellow);
}


/* --------------------------------------------------------------------------
   Hero / Header
   -------------------------------------------------------------------------- */
#header {
  min-height: 100svh;
  background-color: var(--dark);
  /* Pixel grid overlay — the grid IS the pixel art */
  background-image:
    linear-gradient(rgba(32, 112, 200, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 112, 200, 0.1) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl) var(--gutter);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* Yellow pixel stripe at the bottom of the hero */
#header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--px);
  background: var(--yellow);
}

#header > .inner {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  width: 100%;
  max-width: var(--max-w);
  position: relative;
  z-index: 1;
}

#header .content {
  flex: 1;
  text-align: right;
}

#header h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1.1rem, 2.5vw, 1.875rem);
  line-height: 1.8;  /* Press Start 2P needs generous line-height */
  color: var(--white);
  margin-bottom: 0.8em;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
}

#header p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--sp-md);
  max-width: 28rem;
  margin-left: auto;
}

#header a:not(.button) {
  color: var(--yellow);
  text-decoration: underline;
}
#header a:not(.button):hover {
  color: #fff;
}

#header .content ul.actions {
  justify-content: flex-end;
}

/* Decorative pixel label above name */
.hero-label {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--yellow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  margin-left: auto;
  display: inline-block;
  border: 1px solid rgba(255,230,0,0.35);
  padding: 0.4em 0.8em;
}

/* Portrait — pixel art frame replaces phone mockup */
#header .image.phone {
  flex: 0 0 auto;
  width: 20rem;
}
#header .image.phone .inner {
  position: relative;
  padding: 0;
  border: 3px solid var(--yellow);
  border-radius: 0;
  box-shadow: 8px 8px 0 0 var(--yellow), 14px 14px 0 0 rgba(255, 230, 0, 0.18);
}
/* Remove phone chrome */
#header .image.phone .inner::before,
#header .image.phone .inner::after {
  display: none;
}
#header .image.phone img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
#footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  padding: var(--sp-lg) var(--gutter);
  border-top: 4px solid var(--yellow);
}
#footer ul.icons {
  margin-bottom: var(--sp-md);
}
#footer .copyright {
  font-size: 0.85rem;
}
#footer .copyright a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: underline;
}
#footer .copyright a:hover {
  color: var(--yellow);
}


/* --------------------------------------------------------------------------
   Responsive — tablets (≤ 980px)
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  :root {
    --sp-lg: 3rem;
    --sp-xl: 3.5rem;
    --gutter: 2.5rem;
  }
  .spotlight .image {
    flex-basis: 140px;
  }
}


/* --------------------------------------------------------------------------
   Responsive — phones (≤ 736px)
   -------------------------------------------------------------------------- */
@media (max-width: 736px) {
  :root {
    --sp-lg: 2.5rem;
    --sp-xl: 2.5rem;
    --gutter: 1.5rem;
  }

  #header > .inner {
    flex-direction: column-reverse;
    gap: var(--sp-md);
    text-align: center;
  }
  #header .content {
    text-align: center;
  }
  #header .hero-label {
    margin-left: 0;
    margin-right: 0;
  }
  #header .content ul.actions {
    justify-content: center;
  }

  .spotlight,
  .spotlight:nth-child(even) {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-md);
  }
  .spotlight .image {
    flex-basis: auto;
    width: 130px;
    margin: 0 auto;
  }

  ul.actions {
    flex-direction: column;
    align-items: center;
  }
}


/* --------------------------------------------------------------------------
   Responsive — small phones (≤ 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root {
    --gutter: 1rem;
  }
  #header .image.phone {
    width: 12rem;
  }
  #header h1 {
    font-size: 1rem;
  }
}


/* --------------------------------------------------------------------------
   Tooltips — CSS-only, visible on hover and keyboard focus
   The data-tooltip value mirrors aria-label so screen readers use
   aria-label (the accessible name) and never read the tooltip twice.
   -------------------------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
  padding: 0.3em 0.7em;
  border: 2px solid var(--yellow);
  pointer-events: none;
  opacity: 0;
  z-index: 100;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  [data-tooltip]::after {
    transition: opacity 0.15s ease;
  }
}


/* --------------------------------------------------------------------------
   Sub-page components
   Reusable across any page that links main.css.
   -------------------------------------------------------------------------- */

/* Page header — compact dark hero for sub-pages */
.page-header {
  background-color: var(--dark);
  background-image:
    linear-gradient(rgba(32, 112, 200, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 112, 200, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--white);
  padding: var(--sp-lg) var(--gutter);
  border-bottom: 4px solid var(--yellow);
}
.page-header > .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  align-items: start;
}
.page-header h1 {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 2vw, 1.375rem);
  line-height: 1.8;
  color: var(--white);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  margin-bottom: 0.4em;
}
.page-header h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
  font-weight: 400;
  line-height: 1.8;
  color: var(--yellow);
  letter-spacing: 0.1em;
  margin: 0;
}
.page-header h3 {
  color: var(--white);
  margin-bottom: 0.5em;
}
.page-header p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}
.page-header a:not(.back-link) {
  color: var(--yellow);
  text-decoration: underline;
}
.page-header a:not(.back-link):hover {
  color: var(--white);
}

/* Page tagline / subtitle — decorative, not a navigable heading */
.page-subtitle {
  font-family: var(--font-pixel);
  font-size: clamp(0.5rem, 1vw, 0.7rem);
  font-weight: 400;
  line-height: 1.8;
  color: var(--yellow);
  letter-spacing: 0.1em;
  margin: 0;
}

/* Back link — pixel style navigation */
.back-link {
  display: inline-block;
  margin-bottom: var(--sp-md);
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  line-height: 1.8;
}
.back-link::before {
  content: '← ';
}
.back-link:hover {
  color: var(--yellow);
}

/* Photo entries */
.photo-entry {
  padding: var(--sp-lg) 0;
  border-bottom: 2px solid var(--border-light);
}
.photo-entry:last-child {
  border-bottom: none;
}
.photo-entry h2 {
  margin-bottom: 0.75em;
  font-size: clamp(1.1rem, 2vw, 1.375rem);
}
.photo-entry p {
  max-width: var(--max-w-narrow);
  margin-bottom: var(--sp-md);
}

/* Side-by-side photo grid */
.photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--px);
}
.photo-pair + .photo-pair {
  margin-top: var(--px);
}
.photo-pair figure {
  margin: 0;
}
.photo-pair img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--dark);
}
.photo-pair figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4em;
  line-height: 1.4;
}

/* Year / era label chip */
.photo-label {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  color: var(--yellow);
  background: var(--dark);
  padding: 0.3em 0.6em;
  margin-bottom: 0.35em;
}

/* FAQ section */
.faqs ul {
  list-style: disc;
  padding-left: 1.5em;
}
.faqs ul li {
  margin-bottom: 0.5em;
}

/* Sub-page responsive */
@media (max-width: 736px) {
  .page-header > .inner {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }
  .photo-pair {
    grid-template-columns: 1fr;
  }
}
