/* Autopilot Coffee Co.
   Pages: index.html, about.html, how-it-works.html, contact.html

   Recolor the site with the tokens below.
   Contour lines: assets/Guatemala-topo-background.svg.
   Line strength is stroke-opacity on the group in that file.
   Logo for this dark site: assets/logo.png. Icon: assets/icon.png.

   Mobile menu: the header checkbox (#nav-toggle) opens the nav.
   No JavaScript. The contact form script is only on contact.html.
*/

:root {
  --espresso: #241B17;
  --raised: #2A211C;
  --cream: #F4EBDD;
  --cream-soft: rgba(244, 235, 221, 0.78);
  --line: rgba(244, 235, 221, 0.16);
  --caramel: #C8955B;
  --caramel-hover: #d7a56c;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --max: 1120px;
  color-scheme: dark;
  accent-color: var(--caramel);
}

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

html {
  background: var(--espresso);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--espresso);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fixed contour map. Content sits above it.
   The SVG strokes are already Cream. Edit stroke-opacity in
   assets/Guatemala-topo-background.svg to make the map stronger or quieter. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/Guatemala-topo-background.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:visited {
  color: inherit;
}

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

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

::selection {
  background: var(--caramel);
  color: var(--espresso);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-150%);
  z-index: 20;
  background: var(--caramel);
  color: var(--espresso);
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
  outline-color: var(--cream);
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--caramel);
}

.lede {
  max-width: 40rem;
  color: var(--cream-soft);
  font-size: 1.125rem;
  line-height: 1.6;
}

.muted {
  color: var(--cream-soft);
}

.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;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--espresso);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  color: var(--cream);
  text-decoration: none;
  flex: none;
}

.brand:hover .brand__logo {
  opacity: 0.82;
}

.brand__logo {
  display: block;
  width: min(190px, 54vw);
  height: auto;
}

.site-footer .brand__logo {
  width: min(220px, 70vw);
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle:focus,
.nav-toggle:focus-visible {
  outline: none;
}

.nav-toggle:focus-visible + .nav-button {
  outline: 2px solid var(--caramel);
  outline-offset: 3px;
}

.nav-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  flex: none;
}

.nav-button__bars {
  display: grid;
  gap: 5px;
}

.nav-button__bars span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.nav-toggle:checked + .nav-button {
  color: var(--caramel);
  border-color: var(--caramel);
}

.nav-toggle:checked + .nav-button .nav-button__bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .nav-button .nav-button__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-button .nav-button__bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--espresso);
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 1.25rem 0.75rem;
}

.nav-toggle:checked ~ .site-nav {
  display: flex;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.35rem 0;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

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

@media (min-width: 721px) {
  .nav-toggle,
  .nav-button {
    display: none;
  }

  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1.6rem;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .site-nav a {
    min-height: 44px;
    padding: 0.25rem 0;
    border: 0;
    white-space: nowrap;
  }
}

/* ---- Hero and page heads ---- */

.hero {
  padding: clamp(2.5rem, 6vw, 4.75rem) 0 clamp(3rem, 6vw, 5rem);
}

.hero__layout,
.split,
.feature,
.contact-layout {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.55rem, 5.4vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
}

.hero h1 em {
  display: block;
  margin-top: 0.08em;
  font-style: italic;
  font-weight: 500;
  color: var(--caramel);
}

/* Soften the map behind headlines so the type stays easy to read. */
.hero__copy,
.page-head .wrap {
  position: relative;
  z-index: 1;
}

.hero__copy::before,
.page-head .wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1.5rem -10% -1.25rem -16%;
  background: radial-gradient(ellipse at 22% 40%, rgba(36, 27, 23, 0.92) 0%, rgba(36, 27, 23, 0.62) 46%, rgba(36, 27, 23, 0) 76%);
  pointer-events: none;
}

.page-head {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
}

.page-head--center .wrap,
#locations > .wrap > .eyebrow,
#locations > .wrap > h2 {
  text-align: center;
}

.page-head--center .lede {
  margin-inline: auto;
}

.section {
  padding: clamp(2.5rem, 5vw, 4.25rem) 0;
  border-top: 1px solid var(--line);
}

.section__intro {
  max-width: 40rem;
  margin-bottom: 2.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.35rem;
  margin-top: 1.5rem;
}

p:has(+ .actions) {
  margin-bottom: 0;
}

/* ---- Tiles, facts, locations ---- */

.points,
.steps,
.facts,
.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.points,
.steps {
  display: grid;
  gap: 2rem;
}

.aside {
  margin-top: 2.25rem;
}

.steps-close {
  margin: 2.5rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  text-align: center;
}

.tile {
  border-top: 1px solid var(--line);
  padding-top: 1.15rem;
}

.index {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--caramel);
}

.tile h2,
.tile h3 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.steps .tile h2 {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.steps .index {
  margin: 0;
}

.facts li {
  display: grid;
  gap: 0.2rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.facts li:last-child {
  border-bottom: 1px solid var(--line);
}

.facts span {
  color: var(--caramel);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.location-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
}

.location-list--center {
  justify-content: center;
  grid-template-columns: minmax(240px, 22rem);
}

.location-list--center .location-card {
  text-align: center;
}

.actions--center {
  justify-content: center;
}

.location-card,
.cta-panel {
  background: var(--raised);
  border: 1px solid var(--line);
}

.location-card {
  margin: 0;
  padding: 1.3rem 1.35rem 1.45rem;
}

.location-card h3 {
  font-size: 1.55rem;
}

.cta-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.cta-panel h2 {
  margin-bottom: 0.45rem;
}

.cta-panel .actions {
  margin-top: 0;
}

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

.photo-frame {
  position: relative;
  width: 100%;
  margin: 0;
  background: var(--raised);
  border: 1px solid var(--line);
  overflow: hidden;
}

.photo-frame--portrait {
  aspect-ratio: 4 / 5;
}

.photo-frame--landscape {
  aspect-ratio: 3 / 2;
}

.photo-frame--square {
  aspect-ratio: 1 / 1;
}

.photo-frame > img,
.photo-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-frame > img {
  object-fit: cover;
}

.photo-frame--studio {
  background: #f7f4ef;
}

.photo-frame--studio > img {
  object-fit: contain;
}

.photo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
}

.photo-slot p {
  margin: 0;
}

.photo-slot__label {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.photo-slot__file {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--cream-soft);
  overflow-wrap: anywhere;
}

.photo-pair {
  display: grid;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.photo-row {
  display: grid;
  gap: 1rem;
}

/* ---- Buttons and links ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  background: var(--caramel);
  color: var(--espresso);
  border: 1px solid var(--caramel);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

a.button,
a.button:visited,
button.button,
a.button:hover,
button.button:hover {
  color: var(--espresso);
  text-decoration: none;
}

.button:hover {
  background: var(--caramel-hover);
  border-color: var(--caramel-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline-color: var(--cream);
}

.text-link {
  padding: 0.55rem 0.1rem;
  font-weight: 500;
  text-underline-offset: 0.22em;
}

/* ---- Contact ---- */

address {
  font-style: normal;
  margin: 0 0 1rem;
}

a.email-link,
a.footer-email {
  text-decoration-color: var(--caramel);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a.email-link {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.2vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.qr-link {
  display: inline-block;
  margin-top: 1.35rem;
  line-height: 0;
}

.qr-link img {
  display: block;
  width: 156px;
  height: auto;
}

.contact-form .button {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--cream);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--caramel);
  outline-offset: 2px;
  border-color: var(--caramel);
}

::placeholder {
  color: rgba(244, 235, 221, 0.45);
}

.form-note {
  margin-top: 0.85rem;
  color: var(--cream-soft);
  font-size: 0.92rem;
}

.form-status {
  color: var(--caramel);
  margin-top: 0.75rem;
}

.form-status:empty {
  display: none;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.75rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

.footer-motto {
  margin: 0.85rem 0 0;
  color: var(--cream-soft);
}

.fine-print {
  margin: 0.35rem 0 0;
  color: var(--cream-soft);
  font-size: 0.75rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-nav a {
  color: var(--cream);
  text-decoration: none;
  padding: 0.2rem 0;
}

.footer-nav a:hover {
  color: var(--caramel);
}

a.footer-email {
  overflow-wrap: anywhere;
}

.legal {
  margin: 2rem 0 0;
  color: var(--cream-soft);
  font-size: 0.85rem;
}

/* ---- Wider layouts ---- */

@media (min-width: 800px) {
  .hero__layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: clamp(2rem, 5vw, 4.5rem);
  }

  .split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 4rem;
    align-items: start;
  }

  .contact-layout {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 4rem;
    align-items: start;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
  }

  .points,
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
  }

  .facts li {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
  }

  .photo-pair {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .photo-row {
    grid-template-columns: 1fr 1fr;
  }

  .contact-form .button {
    width: auto;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }

  .footer-contact {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-button__bars span {
    transition: none;
  }
}

@media print {
  body::before {
    display: none !important;
  }

  body,
  .site-header,
  .photo-frame,
  .cta-panel,
  .location-card {
    background: #fff !important;
    color: #241b17 !important;
  }

  .nav-toggle,
  .nav-button {
    display: none !important;
  }

  .brand__logo {
    filter: brightness(0);
  }

  .site-nav {
    display: flex !important;
    position: static !important;
    background: transparent !important;
    border: 0 !important;
  }

  a,
  .eyebrow,
  .index,
  .lede,
  .muted,
  .legal {
    color: #241b17 !important;
  }
}
