/* ==========================================================================
   Site styles
   Change the look of the whole site from the variables in :root below.
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #39ff14;        /* radioactive green */
  --color-bg-alt: #ff00e6;    /* hot magenta */
  --color-text: #2400ff;      /* electric blue */
  --color-muted: #d10000;     /* fire-engine red */
  --color-accent: #ff6a00;    /* traffic-cone orange */
  --color-accent-dark: #ffea00; /* highlighter yellow */
  --color-border: #00e5ff;    /* cyan */

  /* Typography */
  --font-body: "Comic Neue", "Comic Sans MS", cursive;
  --font-heading: "Bungee Shade", Impact, fantasy;

  /* Layout */
  --container-width: 1100px;
  --container-narrow: 720px;
  --radius: 6px;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-bg-alt);
  text-shadow: 4px 4px 0 var(--color-border), -3px -3px 0 var(--color-accent);
}

h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h3 { font-size: 1.35rem; }

p {
  margin: 0 0 1em;
}

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

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

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

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container.narrow {
  max-width: var(--container-narrow);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  z-index: 100;
}

/* ---------- Header & navigation ---------- */

.site-header {
  border-bottom: 6px dashed var(--color-bg-alt);
  background: var(--color-accent-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-muted);
  display: inline-block;
  transform: rotate(-3deg);
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav li a {
    display: block;
    padding: 0.6rem 0;
  }
}

/* ---------- Sections ---------- */

.hero {
  padding: clamp(4rem, 12vw, 8rem) 0;
  background: repeating-linear-gradient(45deg, var(--color-bg) 0 40px, var(--color-border) 40px 80px);
}

.hero h1 {
  display: inline-block;
  transform: rotate(-2deg);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.lede {
  font-size: 1.25rem;
  color: var(--color-muted);
  max-width: 36em;
  margin-bottom: 2rem;
}

.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
  scroll-margin-top: 4rem; /* keep jump-links clear of the sticky header */
}

.section-alt {
  background: var(--color-bg-alt);
  color: var(--color-accent-dark);
}

.section-alt h2 {
  color: var(--color-text);
  text-shadow: 4px 4px 0 var(--color-bg);
}

/* ---------- Photos ---------- */

.hero-inner,
.about-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.about-inner {
  grid-template-columns: 1fr 1.3fr;
}

.photo {
  width: 100%;
  object-fit: cover;
  border: 8px solid var(--color-bg-alt);
  box-shadow: 12px 12px 0 var(--color-accent), 24px 24px 0 var(--color-text);
}

.photo-hero {
  aspect-ratio: 3 / 4;
  transform: rotate(4deg);
  border-color: var(--color-accent-dark);
}

.photo-about {
  aspect-ratio: 3 / 4;
  transform: rotate(-3deg);
  border-radius: 50% 50% 12px 12px;
}

.section-snaps {
  background: var(--color-accent);
}

.section-snaps h2 {
  color: var(--color-accent-dark);
  text-shadow: 4px 4px 0 var(--color-text), -3px -3px 0 var(--color-bg-alt);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.polaroid {
  margin: 0;
  background: var(--color-accent-dark);
  padding: 0.9rem 0.9rem 0;
  box-shadow: 10px 10px 0 var(--color-bg-alt);
  transition: transform 0.2s;
}

.polaroid:nth-child(odd)  { transform: rotate(-3deg); }
.polaroid:nth-child(even) { transform: rotate(2.5deg); }

.polaroid:hover {
  transform: rotate(0) scale(1.04);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.polaroid figcaption {
  font-weight: bold;
  color: var(--color-text);
  text-align: center;
  padding: 0.75rem 0;
}

@media (max-width: 760px) {
  .hero-inner,
  .about-inner {
    grid-template-columns: 1fr;
  }

  .photo {
    max-width: 380px;
    margin: 0 auto;
  }
}

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

.button {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-text);
  font-weight: bold;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border: 4px solid var(--color-bg-alt);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--color-text);
  transition: transform 0.15s, background 0.2s;
}

.button:hover {
  background: var(--color-accent-dark);
  color: var(--color-bg-alt);
  transform: rotate(3deg) scale(1.08);
}

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

.site-footer {
  border-top: 6px dotted var(--color-accent);
  background: var(--color-text);
  padding: 2rem 0;
  color: var(--color-bg);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- Gentle motion ---------- */
/* Uses the separate rotate/translate/scale properties so each animation
   stacks on top of the element's existing tilt instead of replacing it. */

@keyframes sway {
  0%, 100% { rotate: -1.5deg; }
  50%      { rotate: 1.5deg; }
}

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}

@keyframes pulse {
  0%, 100% { scale: 1; }
  50%      { scale: 1.05; }
}

.brand         { animation: sway 3s ease-in-out infinite; }
.hero h1       { animation: sway 4s ease-in-out infinite; }
.photo-hero    { animation: sway 5s ease-in-out infinite, bob 3.5s ease-in-out infinite; }
.photo-about   { animation: sway 6s ease-in-out infinite reverse; }
.button        { animation: pulse 2s ease-in-out infinite; }
.polaroid      { animation: bob 3s ease-in-out infinite; }
.polaroid:nth-child(even) { animation-delay: -1.5s; }

/* Hovering holds things still so the existing hover effects take over */
.button:hover,
.polaroid:hover {
  animation: none;
}

/* Respect visitors who've asked their device for less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
}

/* Button sitting on the magenta Contact section needs a border that shows */
.section-alt .button {
  border-color: var(--color-accent-dark);
  overflow-wrap: anywhere;
}
