/* ===== Tokens ===== */
:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm limestone */
  --color-bg: #f5f2ec;
  --color-surface: #faf8f4;
  --color-surface-2: #fdfcfa;
  --color-surface-offset: #ede9e1;
  --color-surface-offset-2: #e5e0d6;
  --color-divider: #dcd6cb;
  --color-border: #cfc8bb;

  /* Text */
  --color-text: #1e1d19;
  --color-text-muted: #66625a;
  --color-text-faint: #94908a;
  --color-text-inverse: #faf8f4;

  /* Accent — spruce */
  --color-primary: #2f5241;
  --color-primary-hover: #24402f;
  --color-primary-active: #1a2e22;
  --color-primary-highlight: #d9e2da;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.2 0.01 80 / 0.09);
  --shadow-lg: 0 14px 36px oklch(0.2 0.01 80 / 0.14);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1240px;

  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #151614;
  --color-surface: #1b1c19;
  --color-surface-2: #20211e;
  --color-surface-offset: #1d1e1b;
  --color-surface-offset-2: #232420;
  --color-divider: #262723;
  --color-border: #3a3b36;
  --color-text: #d5d3cd;
  --color-text-muted: #8d8a82;
  --color-text-faint: #64625c;
  --color-text-inverse: #1b1c19;
  --color-primary: #85b399;
  --color-primary-hover: #9cc5ac;
  --color-primary-active: #6d9c82;
  --color-primary-highlight: #2a352e;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.34);
  --shadow-lg: 0 14px 36px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #151614;
    --color-surface: #1b1c19;
    --color-surface-2: #20211e;
    --color-surface-offset: #1d1e1b;
    --color-surface-offset-2: #232420;
    --color-divider: #262723;
    --color-border: #3a3b36;
    --color-text: #d5d3cd;
    --color-text-muted: #8d8a82;
    --color-text-faint: #64625c;
    --color-text-inverse: #1b1c19;
    --color-primary: #85b399;
    --color-primary-hover: #9cc5ac;
    --color-primary-active: #6d9c82;
    --color-primary-highlight: #2a352e;
  }
}

/* ===== Layout primitives ===== */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--transition-interactive),
    background var(--transition-interactive);
}
.header--scrolled {
  border-bottom-color: color-mix(in oklab, var(--color-text) 12%, transparent);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
  margin-right: auto;
}
.brand svg {
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.nav {
  display: none;
  align-items: center;
  gap: var(--space-6);
}
.nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) 0;
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--color-text);
}
@media (min-width: 880px) {
  .nav {
    display: flex;
  }
}
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-offset);
}
.icon-btn:active {
  background: var(--color-surface-offset-2);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}
.btn--primary:active {
  background: var(--color-primary-active);
}
.btn--ghost {
  color: var(--color-text);
  border: 1px solid color-mix(in oklab, var(--color-text) 18%, transparent);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: color-mix(in oklab, var(--color-text) 34%, transparent);
  background: var(--color-surface-offset);
}
.btn--ghost:active {
  background: var(--color-surface-offset-2);
}
.btn--sm {
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
}
.header .btn--sm {
  display: none;
}
@media (min-width: 620px) {
  .header .btn--sm {
    display: inline-flex;
  }
}

/* ===== Hero ===== */
.hero {
  padding-block: clamp(var(--space-10), 7vw, var(--space-20)) 0;
}
.hero__grid {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: center;
  }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 1.9vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-top: var(--space-4);
  max-width: 24ch;
}
.hero__lead {
  margin-top: var(--space-5);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.hero__meta strong {
  color: var(--color-text);
  font-weight: 500;
}

.hero__figure {
  position: relative;
  margin: 0;
}
.hero__figure img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--color-surface-offset);
  box-shadow: var(--shadow-md);
}

.hero-bleed {
  margin-top: clamp(var(--space-12), 8vw, var(--space-24));
}
.hero-bleed img {
  width: 100%;
  height: clamp(240px, 42vw, 520px);
  object-fit: cover;
  background: var(--color-surface-offset);
}

/* ===== Sections ===== */
.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}
.section--tight {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16));
}
.section--surface {
  background: var(--color-surface);
  border-block: 1px solid color-mix(in oklab, var(--color-text) 8%, transparent);
}
.section__head {
  max-width: 62ch;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}
.section__head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  margin-top: var(--space-3);
}
.section__head p {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
}

/* ===== Work / gallery ===== */
.gallery {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .gallery {
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-5);
  }
  .gallery__item--wide {
    grid-column: span 4;
  }
  .gallery__item--tall {
    grid-column: span 2;
  }
  .gallery__item--half {
    grid-column: span 3;
  }
  .gallery__item--full {
    grid-column: span 6;
  }
}
.gallery__item {
  margin: 0;
  position: relative;
}
.gallery__btn {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-offset);
  position: relative;
}
.gallery__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery__item--wide .gallery__btn img {
  aspect-ratio: 16 / 10;
}
.gallery__item--tall .gallery__btn img {
  aspect-ratio: 3 / 4;
}
.gallery__item--half .gallery__btn img {
  aspect-ratio: 4 / 3;
}
.gallery__item--full .gallery__btn img {
  aspect-ratio: 16 / 8;
}
@media (max-width: 719px) {
  .gallery__item .gallery__btn img {
    aspect-ratio: 4 / 3;
  }
  .gallery__item--tall .gallery__btn img {
    aspect-ratio: 3 / 4;
  }
}
@media (hover: hover) {
  .gallery__btn:hover img {
    transform: scale(1.03);
  }
}
.gallery__btn:active img {
  transform: scale(0.995);
}
.gallery__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.gallery__cap span {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ===== Capabilities ===== */
.capabilities {
  display: grid;
  gap: var(--space-10);
}
@media (min-width: 900px) {
  .capabilities {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-16);
  }
}
.capabilities__intro p {
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}
.cap-list {
  display: grid;
  gap: 0;
}
.cap-list li {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-5);
  border-top: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  max-width: none;
}
.cap-list li:last-child {
  border-bottom: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
}
.cap-list h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}
.cap-list p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ===== Projects ===== */
.project + .project {
  margin-top: clamp(var(--space-10), 7vw, var(--space-16));
}
.project__head {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
}
.project__head h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.project__head p {
  color: var(--color-text-muted);
  max-width: 62ch;
}
@media (min-width: 900px) {
  .project__head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--space-6);
    align-items: baseline;
  }
}

/* ===== Service area ===== */
.area {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 900px) {
  .area {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
  }
}
.towns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.towns li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  max-width: none;
}
[data-theme='dark'] .towns li {
  background: var(--color-surface-offset-2);
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: var(--space-16);
    align-items: center;
  }
}
.contact-lines {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-8);
}
.contact-line {
  display: grid;
  gap: var(--space-1);
}
.contact-line .eyebrow {
  color: var(--color-text-faint);
}
.contact-line a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.contact-line a:hover,
.contact-line a:focus-visible {
  color: var(--color-primary);
}
.contact-line p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
}
.contact-card {
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  background: var(--color-surface-2);
  border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.contact-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}
.contact-card p {
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}
.contact-card .btn {
  width: 100%;
  margin-top: var(--space-6);
}
.contact-card .btn + .btn {
  margin-top: var(--space-3);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  padding-block: var(--space-10);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.footer a {
  color: var(--color-text-muted);
}
.footer a:hover {
  color: var(--color-text);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
  background: oklch(0.13 0.006 90);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 260ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 260ms;
}
.lightbox[data-open='true'] {
  opacity: 1;
  visibility: visible;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: #f0eee8;
}
.lightbox__title {
  font-size: var(--text-sm);
  margin-right: auto;
}
.lightbox__bar button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: #f0eee8;
}
.lightbox__bar button:hover,
.lightbox__bar button:focus-visible {
  background: oklch(1 0 0 / 0.14);
}
.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}
.lightbox__stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  border-radius: var(--radius-md);
  transform: scale(0.98);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox[data-open='true'] .lightbox__stage img {
  transform: scale(1);
}

body.lb-open .header,
body.lb-open .callbar {
  visibility: hidden;
}

/* ===== Mobile call bar ===== */
.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
}
.callbar .btn {
  width: 100%;
}
@media (min-width: 620px) {
  .callbar {
    display: none;
  }
}
@media (max-width: 619px) {
  body {
    padding-bottom: 84px;
  }
}

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
