/* ==========================================================================
   Ridgeline Aerial — shared styles
   Demo build for Barnraised. Plain CSS, no build step, no external fonts.
   Three runtime-switchable design directions via [data-style]:
     altitude   — near-black, high-sky blue, HUD/technical
     goldenhour — twilight navy, warm amber, cinematic/serif
     fieldwork  — paper white, graphite, signal green, survey/topo
   Switch at runtime with the bottom-right Design presets panel
   (preset-switcher.js / preset-switcher.css, loaded on every page).
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, h4, p, figure { margin: 0; }

/* ---------- Design tokens: three directions ---------- */
:root,
:root[data-style="altitude"] {
  --color-bg: #0c1118;
  --color-bg-alt: #121a24;
  --color-surface: #141b24;
  --color-fg: #eef2f7;
  --color-muted: #93a3b5;
  --color-accent: #8ecbff;
  --color-accent-fg: #0c1118;
  --color-border: #263140;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 2px;
  --label-transform: uppercase;
  --label-tracking: 0.08em;
  --heading-weight: 700;
}

:root[data-style="goldenhour"] {
  --color-bg: #161a33;
  --color-bg-alt: #1d2140;
  --color-surface: #20244a;
  --color-fg: #f5ead9;
  --color-muted: #c8b9a4;
  --color-accent: #f0a94e;
  --color-accent-fg: #161a33;
  --color-border: #3a3560;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --label-transform: none;
  --label-tracking: 0.02em;
  --heading-weight: 400;
}

:root[data-style="fieldwork"] {
  --color-bg: #f7f6f2;
  --color-bg-alt: #eeece5;
  --color-surface: #ffffff;
  --color-fg: #2b2f33;
  --color-muted: #5b6066;
  --color-accent: #146b3f;
  --color-accent-fg: #ffffff;
  --color-border: #c9c6bd;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 2px;
  --label-transform: uppercase;
  --label-tracking: 0.1em;
  --heading-weight: 700;
}

/* ---------- Base ---------- */
body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  transition: background-color .2s ease, color .2s ease;
}

[data-style="altitude"] body {
  background-image:
    linear-gradient(rgba(142, 203, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 203, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  line-height: 1.15;
}

h1 { font-size: clamp(1.9rem, 5vw + 1rem, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw + 1rem, 2rem); }
h3 { font-size: clamp(1.1rem, 1.5vw + 1rem, 1.4rem); }

p { color: var(--color-fg); }
.text-muted { color: var(--color-muted); }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

[data-style="fieldwork"] .section:nth-of-type(even) {
  background: var(--color-bg-alt);
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

[data-style="fieldwork"] .eyebrow { font-family: var(--font-body); font-variant: small-caps; }

.section-head { max-width: 46rem; margin-bottom: 2rem; }
.section-head p { margin-top: 0.75rem; color: var(--color-muted); }

/* ---------- Focus & motion ---------- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 1000;
  background: var(--color-accent);
  color: var(--color-accent-fg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}

.brand {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: var(--radius);
  color: var(--color-muted);
}

.site-nav a:hover { color: var(--color-fg); }

@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; gap: 0; padding-block: 0.5rem 0.25rem; }
  .brand { width: 100%; min-height: 44px; }
  .site-nav { width: 100%; overflow-x: auto; }
  .site-nav ul { flex-wrap: nowrap; }
}

.site-nav a[aria-current="page"] {
  color: var(--color-fg);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

/* ---------- Buttons & links ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--color-fg);
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.button-primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  border-color: var(--color-accent);
}

.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- Credentials row ---------- */
.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 1.25rem;
}

.credentials li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  background: rgba(255, 255, 255, 0.04);
}

[data-style="fieldwork"] .credentials li {
  font-family: var(--font-body);
  font-variant: small-caps;
  background: var(--color-surface);
}

/* ---------- Hero ---------- */
.hero { position: relative; }

.hero-media { position: relative; margin: 0; }

.hero-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-caption {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-content {
  padding: 2rem 1.25rem;
}

.hero-content h1 { margin-bottom: 0.6rem; }
.hero-tagline { font-size: 1.1rem; max-width: 34rem; }
.hero-actions { margin-top: 1rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hud-corner { display: none; }

/* Overlay heroes (altitude + goldenhour): the photo absolutely fills the hero
   behind in-flow content, so the content always fits regardless of viewport —
   the old absolute-content-in-16:9-box approach clipped the h1 on mobile. */
[data-style="altitude"] .hero-media,
[data-style="goldenhour"] .hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
[data-style="altitude"] .hero-media img,
[data-style="goldenhour"] .hero-media img {
  height: 100%;
  aspect-ratio: auto;
}

/* Altitude hero: darkened photo, overlaid left-aligned type, HUD corner brackets */
[data-style="altitude"] .hero-media img { filter: brightness(0.5) contrast(1.05) saturate(0.9); }
[data-style="altitude"] .hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  min-height: clamp(24rem, 46vw, 34rem);
  padding-top: 6rem;
  padding-bottom: 3rem;
  background: linear-gradient(180deg, rgba(12, 17, 24, 0.1) 0%, rgba(12, 17, 24, 0.9) 88%);
}
[data-style="altitude"] .hud-corner {
  display: block;
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--color-accent);
  z-index: 1;
}
[data-style="altitude"] .hud-corner--tl { top: 14px; left: 14px; border-top: 2px solid; border-left: 2px solid; }
[data-style="altitude"] .hud-corner--tr { top: 14px; right: 14px; border-top: 2px solid; border-right: 2px solid; }
[data-style="altitude"] .hud-corner--bl { bottom: 14px; left: 14px; border-bottom: 2px solid; border-left: 2px solid; }
[data-style="altitude"] .hud-corner--br { bottom: 14px; right: 14px; border-bottom: 2px solid; border-right: 2px solid; }

/* Golden hour hero: warm gradient overlay, centered type */
[data-style="goldenhour"] .hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: clamp(24rem, 42vw, 32rem);
  padding-top: 4rem;
  padding-bottom: 4rem;
  background: linear-gradient(160deg, rgba(240, 169, 78, 0.22) 0%, rgba(22, 26, 51, 0.55) 45%, rgba(22, 26, 51, 0.92) 100%);
}
[data-style="goldenhour"] .hero-actions { justify-content: center; }
[data-style="goldenhour"] .credentials { justify-content: center; }

/* Fieldwork hero: framed figure with caption bar, type stacked above */
[data-style="fieldwork"] .hero {
  display: flex;
  flex-direction: column;
}
[data-style="fieldwork"] .hero-content {
  order: -1;
  text-align: left;
  padding: 2rem 1.25rem 1.25rem;
}
[data-style="fieldwork"] .hero-media {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-inline: 1.25rem 1.25rem;
  margin-bottom: 2rem;
}
[data-style="fieldwork"] .hero-media img { aspect-ratio: 16 / 9; }
[data-style="fieldwork"] .hero-caption {
  position: static;
  width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  display: block;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

@media (min-width: 900px) {
  [data-style="fieldwork"] .hero-media { margin-inline: 2rem; }
}

/* ---------- Service area ---------- */
.area-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 1.5rem;
}

/* ---------- Services grid (index) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 1.35rem;
  text-decoration: none;
  color: var(--color-fg);
  min-height: 44px;
  transition: transform .15s ease, border-color .15s ease;
}
.service-card:hover { transform: translateY(-2px); border-color: var(--color-accent); }

.service-card .price {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 0.95rem;
}
[data-style="fieldwork"] .service-card .price { font-family: var(--font-body); font-variant: small-caps; letter-spacing: 0.06em; }

.service-card h3 { margin-top: 0.15rem; }
.service-card .blurb { color: var(--color-muted); font-size: 0.95rem; }
.service-card .cta { margin-top: auto; color: var(--color-accent); font-weight: 700; font-size: 0.9rem; }

/* ---------- Service detail sections (services.html) ---------- */
.service-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--color-border);
}
.service-detail:last-child { border-bottom: 0; }

@media (min-width: 860px) {
  .service-detail {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2.5rem;
  }
  .service-detail.is-reversed .service-photo { order: 2; }
}

.service-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.service-detail .price {
  display: inline-block;
  font-family: var(--font-mono);
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}
[data-style="fieldwork"] .service-detail .price { font-family: var(--font-body); font-variant: small-caps; letter-spacing: 0.06em; }

.service-detail h2 { margin-bottom: 0.75rem; }
.service-detail p { color: var(--color-muted); }
.service-detail p + p { margin-top: 0.6rem; }

/* ---------- Portfolio grid & lightbox ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (min-width: 980px) {
  .portfolio-grid { grid-template-columns: repeat(4, 1fr); }
}

.portfolio-tile {
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
  min-height: 44px;
  display: block;
  width: 100%;
}

.portfolio-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .2s ease;
}
.portfolio-tile:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.94);
  padding: 1.25rem;
}
.lightbox[hidden] { display: none; }

.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(20, 22, 28, 0.7);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .lightbox-prev { left: 0.4rem; }
  .lightbox-next { right: 0.4rem; }
}

/* ---------- Contact form ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .contact-layout { grid-template-columns: 1fr 1.2fr; align-items: start; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.field label {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  color: var(--color-muted);
}
[data-style="fieldwork"] .field label { font-family: var(--font-body); font-variant: small-caps; }

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-fg);
  font: inherit;
}

.field textarea { min-height: 140px; resize: vertical; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 1px;
}

.field-hint { font-size: 0.8rem; color: var(--color-muted); }

/* Honeypot — real field, hidden from sighted and AT users, not reachable by tab */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-alert {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.form-alert[hidden] { display: none; }

.form-success {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 1.5rem;
}
.form-success[hidden] { display: none; }

.contact-form[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 2rem;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.footer-inner a {
  color: var(--color-accent);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0.4rem;
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
