/* ============================================================================
   evans.coffee — The Evans Garage
   Coffee-house browns and 1950s Ford two-tone: cream paper, espresso ink,
   a Tropical Turquoise accent and a ribbon red. Archivo (wide caps, like
   chrome badge lettering) with Yellowtail script, the way Ford paired them.
   CSP-clean: no inline styles anywhere, so style-src 'self' holds.
   ========================================================================== */

:root {
  --paper:    #f6efe4;
  --paper-2:  #efe4d2;
  --paper-3:  #e7d8c2;
  --ink:      #2a1d16;
  --ink-2:    #6a5647;
  --line:     #d9c6ab;
  --accent:   #2c7c80;   /* Tropical Turquoise, darkened for text contrast */
  --accent-2: #8fcfcf;
  --red:      #a9342b;
  --gold:     #b5852c;
  --footer:   #2a1d16;
  --footer-ink: #f1e6d6;
  --shadow:   0 1px 2px rgb(42 29 22 / .08), 0 12px 32px -12px rgb(42 29 22 / .28);

  --radius: 14px;
  --wrap: 72rem;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Yellowtail", "Brush Script MT", cursive;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #17110d;
    --paper-2:  #211913;
    --paper-3:  #2b2119;
    --ink:      #f1e6d6;
    --ink-2:    #b9a58f;
    --line:     #3d2f25;
    --accent:   #74c4c4;
    --accent-2: #2c6f72;
    --red:      #df6a5e;
    --gold:     #dcae58;
    --footer:   #0f0b08;
    --footer-ink: #e9dcc9;
    --shadow:   0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .7);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4, p, ul, dl, figure { margin: 0; }
ul { padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--paper); padding: .5rem .9rem; border-radius: 6px; z-index: 20; }
.skip:focus { left: .5rem; }

.kicker {
  font-size: .72rem; font-weight: 650; font-stretch: 125%;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  text-wrap: balance;
}

/* ---- Draft banner -------------------------------------------------------- */
.draft {
  background: repeating-linear-gradient(-45deg, var(--gold) 0 12px, #c9993f 12px 24px);
  color: #2a1d16; text-align: center; font-size: .8rem; font-weight: 600; padding: .35rem 1rem;
}

/* ---- Top bar ------------------------------------------------------------- */
.topbar { border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }

.wordmark { display: inline-flex; align-items: baseline; text-decoration: none; color: var(--ink); }
.wordmark:hover { color: var(--ink); }
.wordmark__script { font-family: var(--script); font-size: 2.1rem; line-height: 1; color: var(--red); }
.wordmark__tld { font-size: .78rem; font-weight: 600; font-stretch: 125%; letter-spacing: .08em; margin-left: .15rem; color: var(--ink-2); }

.topnav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.topnav a {
  color: var(--ink); text-decoration: none;
  font-size: .78rem; font-weight: 650; font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase;
  padding-block: .4rem; border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.hero__text { container-type: inline-size; }
.hero__title { margin-top: 1rem; line-height: .9; }
.hero__script {
  display: block; font-family: var(--script); font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem); color: var(--red);
  transform: rotate(-4deg); transform-origin: left bottom; margin-bottom: -.1em; padding-left: .1em;
}
.hero__block {
  display: block; font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  /* sized to the column, so GARAGE always fits: the word is ~5.4em wide */
  font-size: min(18cqi, 6rem); letter-spacing: -.01em; color: var(--ink);
}

.hero__tagline { margin-top: 1.5rem; max-width: 30rem; font-size: 1.15rem; color: var(--ink-2); }

.tally { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.tally li {
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem;
  font-size: .82rem; color: var(--ink-2); background: var(--paper-2);
}
.tally strong { color: var(--ink); font-weight: 800; }
.tally a { font-weight: 700; }

.hero__photo figcaption, .section-head__credit {
  margin-top: .75rem; font-size: .82rem; color: var(--ink-2);
}

/* ---- Photo frames -------------------------------------------------------- */
.frame {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--paper-3); box-shadow: var(--shadow);
  aspect-ratio: 3 / 2;
}
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
a.frame:hover img { transform: scale(1.025); }

/* Empty: a 1950s sunburst until the photos arrive. */
.frame--empty {
  display: grid; place-items: center; align-content: center; gap: .9rem;
  background:
    radial-gradient(circle at 50% 50%, var(--paper-2) 0 18%, transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 50%, var(--paper-2) 0 7.5deg, var(--paper-3) 7.5deg 15deg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.frame__note {
  font-size: .72rem; font-weight: 650; font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-2); background: var(--paper); padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line);
}

/* The atomic-age four-point sparkle, drawn with a mask so it takes currentColor. */
.sparkle {
  width: 2.75rem; aspect-ratio: 1; background: var(--accent);
  -webkit-mask: url("assets/sparkle.svg") center / contain no-repeat;
          mask: url("assets/sparkle.svg") center / contain no-repeat;
}

/* ---- Pinstripe divider (two-tone trim with a sparkle) --------------------- */
.pinstripe {
  max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
}
.pinstripe::before, .pinstripe::after {
  content: ""; height: 7px;
  background: linear-gradient(var(--accent) 0 2px, transparent 2px 5px, var(--red) 5px 7px);
}
.pinstripe span { width: 1.1rem; aspect-ratio: 1; background: var(--gold);
  -webkit-mask: url("assets/sparkle.svg") center / contain no-repeat;
          mask: url("assets/sparkle.svg") center / contain no-repeat;
}

/* ---- Cars ---------------------------------------------------------------- */
.cars { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem); }

.section-head { text-align: center; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-head__title {
  margin-top: .5rem; font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(2.2rem, 5.5vw, 3.5rem); line-height: 1; letter-spacing: -.005em;
}

.car__row {
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.car + .car { margin-top: clamp(4rem, 10vw, 7rem); }
.car:nth-of-type(even) .car__media { order: 2; }
.car__albumlink {
  display: inline-block; margin-top: .9rem; font-size: .8rem; font-weight: 700; font-stretch: 112%;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.car__albumlink:hover { text-decoration: underline; }
/* photos stay in view while a long show card scrolls past */
.car__media { position: sticky; top: 1.5rem; }

.car__count {
  position: absolute; right: .75rem; bottom: .75rem;
  background: rgb(23 17 13 / .72); color: #f6efe4; backdrop-filter: blur(4px);
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: .25rem .6rem; border-radius: 999px;
}

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); gap: .6rem; margin-top: .75rem; }
.thumbs a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--paper-3); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease, opacity .3s ease; }
.thumbs a:hover img { transform: scale(1.06); opacity: .9; }

/* The windshield show card. */
.placard {
  position: relative; background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 6px 6px 0 var(--accent-2);
}

.placard__entry {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: .7rem; margin-bottom: 1.1rem; border-bottom: 1px dashed var(--line);
  font-size: .68rem; font-weight: 650; font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
}

.placard__name { line-height: 1; }
.placard__year {
  display: block; font-weight: 900; font-stretch: 125%;
  font-size: clamp(2.75rem, 6vw, 3.75rem); letter-spacing: -.02em; color: var(--red);
}
.placard__model {
  display: block; margin-top: .45rem; font-weight: 800; font-stretch: 112%; text-transform: uppercase;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem); letter-spacing: .02em; line-height: 1.2;
}
.placard__nick { margin-top: .5rem; font-family: var(--script); font-size: 1.75rem; line-height: 1.1; color: var(--accent); }

.specs { margin-top: 1.25rem; display: grid; gap: .1rem; }
.specs div { display: flex; align-items: baseline; gap: .5rem; font-size: .92rem; padding-block: .3rem; }
.specs dt { color: var(--ink-2); white-space: nowrap; }
/* dotted leader between label and value */
.specs div { background: linear-gradient(to right, var(--line) 50%, transparent 0) 0 calc(100% - .55em) / 6px 1px repeat-x; }
.specs dt, .specs dd { background: var(--paper-2); }
.specs dt { padding-right: .4rem; }
.specs dd { margin: 0 0 0 auto; padding-left: .4rem; font-weight: 600; text-align: right; }

.placard__story { margin-top: 1.25rem; display: grid; gap: .8rem; color: var(--ink); }

.awards { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.awards__title {
  font-size: .68rem; font-weight: 650; font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: .75rem;
}
.awards ul { display: grid; gap: .75rem; }
.awards li { display: grid; grid-template-columns: 1.6rem 1fr; column-gap: .6rem; line-height: 1.35; }
.awards__what { font-weight: 700; }
.awards__where { grid-column: 2; font-size: .86rem; color: var(--ink-2); }

/* A little show ribbon: gold rosette with red tails. */
.rosette { grid-row: span 2; position: relative; width: 1.35rem; height: 1.8rem; margin-top: .1rem; }
.rosette::before {
  content: ""; position: absolute; inset: 0 0 auto 0; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0 42%, var(--paper-2) 43% 50%, var(--gold) 51%);
  z-index: 1;
}
.rosette::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 45%; bottom: 0;
  background: var(--red); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

/* ---- Album --------------------------------------------------------------- */
.album { margin-top: clamp(3rem, 7vw, 5rem); }
.album__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 2rem;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem); padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.album__head .kicker { flex-basis: 100%; }
.album__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem .9rem; line-height: 1; }
.album__script {
  font-family: var(--script); font-weight: 400; font-size: clamp(3.25rem, 8vw, 5rem); color: var(--red);
  rotate: -4deg; padding-inline: .05em .15em;
}
.album__block { font-weight: 900; font-stretch: 125%; text-transform: uppercase; font-size: clamp(1rem, 2.4vw, 1.5rem); letter-spacing: .01em; }
.album__credit { font-size: .85rem; color: var(--ink-2); padding-bottom: .35rem; }

/* Bento grid, 4 across: a big 2x2 tile left, four small, a row of four, then the
   big tile on the right (index.php sets is-big/is-left/is-right).
   `dense` lets the small tiles fill in around the big ones. */
.album__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense;
  gap: clamp(.4rem, 1vw, .75rem);
}
.album__item a {
  position: relative; display: block; height: 100%; aspect-ratio: 3 / 2;
  overflow: hidden; border-radius: 10px; background: var(--paper-3);
}
.album__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.album__item a:hover img { transform: scale(1.04); }
.album__item.is-left  { grid-column: 1 / span 2; grid-row: span 2; }
.album__item.is-right { grid-column: 3 / span 2; grid-row: span 2; }
.album__item.is-big a { aspect-ratio: auto; }
.album__grid.is-collapsed .is-extra { display: none; }
.album__item { position: relative; }

/* The last preview tile doubles as the "show all" control. */
.album__moretile {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .15rem;
  border: 0; border-radius: 10px; cursor: pointer; font: inherit; text-align: center;
  background: rgb(23 17 13 / .62); color: #f6efe4; backdrop-filter: blur(2px);
  transition: background .2s ease;
}
.album__moretile[hidden] { display: none; }
.album__moretile:hover { background: rgb(169 52 43 / .82); }
.album__morecount { font-weight: 900; font-stretch: 125%; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1; }
.album__morelabel { font-size: .68rem; font-weight: 650; font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; }

.album__more { text-align: center; margin-top: clamp(1.25rem, 3vw, 2rem); }
.button {
  font: inherit; font-size: .78rem; font-weight: 700; font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 999px; padding: .9rem 1.7rem; cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent-2); transition: background .2s ease, translate .2s ease;
}
.button:hover { background: var(--red); translate: 0 -1px; }

@media (max-width: 700px) {
  .album__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album__item.is-big { grid-column: 1 / -1; grid-row: auto; }
  .album__item.is-big a { aspect-ratio: 3 / 2; }
}

/* ---- Footnote ------------------------------------------------------------ */
.footnote { padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem); }
.footnote__card {
  max-width: 48rem; margin-inline: auto; display: flex; gap: clamp(1.5rem, 4vw, 2.5rem); align-items: center;
  border-top: 1px solid var(--line); padding-top: 2rem;
  font-size: .95rem; color: var(--ink-2);
}
/* A snapshot print: square crop, white border, a slight tilt.
   object-position frames Jim and Janet in their photo; adjust if it changes. */
.footnote__photo {
  flex: none; width: clamp(9rem, 22vw, 12rem); aspect-ratio: 1; height: auto;
  object-fit: cover; object-position: 54% 32%;
  padding: .45rem; background: #fbf7f0; border-radius: 4px;
  box-shadow: var(--shadow); rotate: -2.5deg;
}
.footnote__title {
  font-size: .7rem; font-weight: 650; font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: .5rem;
}
.footnote__title span { color: var(--red); }
.footnote__sig { margin-top: .6rem; font-family: var(--script); font-size: 1.5rem; line-height: 1.2; color: var(--ink); }

/* ---- Footer -------------------------------------------------------------- */
.footer { background: var(--footer); color: var(--footer-ink); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem; }
.footer .wordmark__script { color: #e07a6e; font-size: 2.4rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; font-size: .85rem; color: rgb(241 230 214 / .75); }
.footer a { color: var(--footer-ink); }
.footer a:hover { color: #8fcfcf; }

/* ---- Lightbox ------------------------------------------------------------ */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(12 9 7 / .97); color: #f1e6d6;
}
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: rgb(12 9 7 / .6); }
.lightbox__stage { display: grid; place-items: center; min-height: 0; padding: 3.5rem clamp(.5rem, 6vw, 5rem) 0; }
.lightbox__img {
  width: auto; height: auto; border-radius: 6px;
  max-width: calc(100vw - 2 * clamp(.5rem, 6vw, 5rem));
  max-height: calc(100dvh - 3.5rem - 5.5rem); /* top padding, caption */
}
.lightbox__caption { text-align: center; padding: 1rem 1rem 1.25rem; font-size: .9rem; }
.lightbox__title { display: block; font-weight: 700; font-stretch: 112%; letter-spacing: .02em; }
.lightbox__meta { color: rgb(241 230 214 / .65); font-size: .8rem; }
.lightbox__btn {
  position: absolute; display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(241 230 214 / .1); color: #f1e6d6; font: 400 2rem/1 var(--sans);
}
.lightbox__btn:hover { background: rgb(241 230 214 / .22); }
.lightbox__prev { left: clamp(.25rem, 2vw, 1.5rem); top: 50%; translate: 0 -50%; }
.lightbox__next { right: clamp(.25rem, 2vw, 1.5rem); top: 50%; translate: 0 -50%; }
.lightbox__close { right: .75rem; top: .75rem; font-size: 1.75rem; }
.lightbox.is-single .lightbox__prev, .lightbox.is-single .lightbox__next { display: none; }

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 880px) {
  .hero, .car__row { grid-template-columns: minmax(0, 1fr); }
  .hero__photo { order: -1; }
  .car:nth-of-type(even) .car__media { order: 0; }
  .car__media { position: static; }
  .placard { box-shadow: 4px 4px 0 var(--accent-2); }
}
@media (max-width: 520px) {
  .topnav a { letter-spacing: .08em; }
  .footnote__card { flex-direction: column; text-align: center; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 4.5rem; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}


/* ---- 404 ----------------------------------------------------------------- */
.nf { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding-block: 3rem; }
.nf__sparkle { display: block; width: 3.5rem; }
.nf__title { line-height: .9; }
.nf__title .hero__block { font-size: clamp(3rem, 12vw, 6rem); }
.nf__title .hero__script { transform-origin: center bottom; }
.nf__text { max-width: 28rem; color: var(--ink-2); }
.nf__link { font-weight: 700; }
