:root {
  --background: #f7f7f2;
  --ink: #141414;
  --muted: #66645d;
  --surface: #ffffff;
  --accent: #c83d30;
  --accentAlt: #1f6b63;
  --line: #dedbd2;
  --font-display: "Inter Tight", Arial, Helvetica, sans-serif;
  --font-body: "Inter", Arial, Helvetica, sans-serif;
  --max: 1180px;
  --gutter: 24px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accentAlt);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.admin-header {
  min-height: var(--header-height);
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: color-mix(in srgb, var(--background) 92%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--surface);
  border-radius: 50%;
  font-weight: 750;
  font-size: 14px;
}

.brand-mark--image {
  overflow: hidden;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-link strong,
.brand-link small {
  display: block;
  white-space: nowrap;
}

.brand-link strong {
  font-weight: 750;
  line-height: 1.1;
}

.brand-link small {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
}

.site-nav a,
.text-link {
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
}

.site-nav a {
  padding: 8px 10px;
}

.site-nav a:hover,
.text-link:hover {
  color: var(--ink);
}

.text-link {
  border-bottom: 1px solid currentColor;
}

.text-link--light {
  color: rgba(255, 255, 255, 0.82);
}

.text-link--light:hover {
  color: #ffffff;
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 750;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.header-cta {
  background: var(--ink);
  color: var(--surface);
  flex: 0 0 auto;
}

.button:hover,
.header-cta:hover {
  transform: translateY(-1px);
}

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

.button--ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.button--secondary {
  background: var(--surface);
  color: var(--ink);
}

.hero,
.case-hero {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: flex-end;
  background-position: center;
  background-size: cover;
  color: #ffffff;
  position: relative;
}

.hero::after,
.case-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.38));
  pointer-events: none;
}

.hero__inner,
.case-hero__inner {
  width: min(760px, calc(100% - var(--gutter) - var(--gutter)));
  margin: 0 auto;
  padding: 112px 0 58px;
  position: relative;
  z-index: 1;
}

.case-hero__inner {
  width: min(920px, calc(100% - var(--gutter) - var(--gutter)));
}

.hero h1,
.case-hero h1,
.section h2,
.media-section h2,
.cta-section h2,
.case-block h2,
.editor-panel h1,
.editor-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero h1,
.case-hero h1 {
  max-width: 760px;
  font-size: 64px;
}

.hero p:not(.eyebrow),
.case-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accentAlt);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.82);
}

.metric-band {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.metric-band--case {
  border-top: 1px solid var(--line);
}

.metric-list {
  width: min(var(--max), calc(100% - var(--gutter) - var(--gutter)));
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  min-height: 120px;
  padding: 26px 22px;
  border-left: 1px solid var(--line);
}

.stat:last-child {
  border-right: 1px solid var(--line);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
}

.stat span {
  margin-top: 8px;
  color: var(--muted);
}

.section,
.media-section,
.cta-section,
.contact-section,
.case-layout {
  width: min(var(--max), calc(100% - var(--gutter) - var(--gutter)));
  margin: 0 auto;
}

.section,
.media-section {
  padding: 86px 0;
}

.section--intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.72fr);
  gap: 48px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.section__heading h2,
.section__bar h2,
.media-section h2,
.cta-section h2,
.case-block h2 {
  font-size: 44px;
}

.section__lead {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.section__bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.project-card--large {
  grid-row: span 2;
}

.project-card a {
  display: grid;
  min-height: 100%;
}

.project-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--line);
}

.project-card--large .project-card__media {
  aspect-ratio: 4 / 4.35;
}

.project-card__media img,
.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.project-card:hover .project-card__media img {
  transform: scale(1.035);
}

.project-card__body {
  padding: 22px;
}

.project-card h3,
.video-tile h3,
.service-item h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
}

.project-card p:not(.eyebrow),
.video-tile p,
.service-item p,
.case-block p,
.cta-section p {
  color: var(--muted);
}

.project-card p:not(.eyebrow) {
  margin: 12px 0 0;
}

.media-section {
  display: grid;
  grid-template-columns: 0.62fr 1fr;
  gap: 34px;
  align-items: start;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.media-section__copy {
  position: sticky;
  top: calc(var(--header-height) + 32px);
}

.media-section__copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.video-grid {
  display: grid;
  gap: 18px;
}

.video-tile {
  background: var(--surface);
  border: 1px solid var(--line);
}

.video-tile iframe,
.embed-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000000;
}

.video-tile__caption {
  padding: 18px;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-item {
  min-height: 240px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.cta-section {
  margin-bottom: 72px;
  padding: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr) auto;
  gap: 28px;
  align-items: center;
  background: var(--ink);
  color: var(--surface);
}

.cta-section .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.cta-section p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.contact-section {
  margin-bottom: 72px;
  padding: 52px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.82fr);
  gap: 42px;
  align-items: start;
  background: var(--ink);
  color: var(--surface);
}

.contact-section .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.contact-section h2 {
  margin: 0;
  max-width: 620px;
  color: var(--surface);
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.98;
  letter-spacing: 0;
}

.contact-section__copy > p:not(.eyebrow) {
  max-width: 590px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 18px;
}

.contact-details {
  margin: 34px 0 0;
  display: grid;
  gap: 18px;
}

.contact-details div {
  display: grid;
  gap: 5px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.contact-details dt {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.contact-details dd {
  margin: 0;
  color: #ffffff;
  font-weight: 650;
}

.contact-form {
  padding: 22px;
  background: var(--surface);
  color: var(--ink);
}

.contact-form label {
  color: var(--muted);
}

.contact-form textarea {
  min-height: 136px;
}

.contact-form__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  min-height: 96px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  color: var(--ink);
}

.site-footer a {
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  color: var(--ink);
  border-color: currentColor;
}

.case-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 60px;
  padding: 78px 0;
}

.case-sidebar {
  align-self: start;
  position: sticky;
  top: calc(var(--header-height) + 30px);
}

.case-sidebar nav {
  display: grid;
  gap: 10px;
}

.case-sidebar a {
  color: var(--muted);
  font-weight: 650;
}

.case-sidebar a:hover {
  color: var(--ink);
}

.case-content {
  min-width: 0;
}

.case-block {
  padding: 0 0 62px;
  margin: 0 0 62px;
  border-bottom: 1px solid var(--line);
}

.case-block:last-child {
  margin-bottom: 0;
}

.case-block p {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 19px;
}

.case-gallery {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.case-gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
}

.case-gallery figure:first-child {
  grid-column: 1 / -1;
}

.case-gallery figure:first-child img {
  aspect-ratio: 16 / 9;
}

.case-gallery img {
  aspect-ratio: 4 / 3;
}

.case-gallery figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.process-list {
  counter-reset: steps;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.process-list li {
  min-height: 70px;
  padding: 18px 18px 18px 58px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
}

.process-list li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 18px;
  top: 17px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--accentAlt);
  color: #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 750;
}

.admin-page {
  background: var(--background);
}

.admin-shell {
  width: min(1320px, calc(100% - var(--gutter) - var(--gutter)));
  margin: 32px auto 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.editor-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.editor-panel--sticky {
  position: sticky;
  top: calc(var(--header-height) + 18px);
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.editor-panel h1,
.editor-panel h2 {
  font-size: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid--colors {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-note {
  margin: -4px 0 18px;
  color: var(--muted);
}

#jsonPreview {
  min-height: 620px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  :root {
    --gutter: 20px;
  }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero h1,
  .case-hero h1 {
    font-size: 52px;
  }

  .section--intro,
  .media-section,
  .case-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .media-section__copy,
  .case-sidebar,
  .editor-panel--sticky {
    position: static;
  }

  .case-sidebar nav {
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    overflow-x: auto;
  }

  .service-list,
  .contact-section,
  .cta-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --header-height: 64px;
  }

  body {
    font-size: 15px;
  }

  .site-header,
  .admin-header {
    padding: 12px var(--gutter);
    gap: 10px;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .site-header .brand-link {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .site-header .header-cta {
    display: none;
  }

  .site-header .site-nav {
    grid-column: 1 / -1;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .site-header .brand-link strong {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-header .brand-link small {
    display: none;
  }

  .header-cta {
    min-height: 38px;
    padding: 9px 12px;
  }

  .hero,
  .case-hero {
    min-height: 680px;
  }

  .hero__inner,
  .case-hero__inner {
    width: calc(100% - 44px);
    max-width: 720px;
    padding: 92px 0 44px;
  }

  .hero h1,
  .case-hero h1 {
    max-width: 100%;
    font-size: 38px;
  }

  .hero p:not(.eyebrow),
  .case-hero p:not(.eyebrow) {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    overflow-wrap: break-word;
  }

  .metric-list,
  .project-grid,
  .project-grid--compact,
  .case-gallery,
  .form-grid,
  .form-grid--colors {
    grid-template-columns: 1fr;
  }

  .metric-list {
    width: 100%;
  }

  .stat,
  .stat:last-child {
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 94px;
  }

  .section,
  .media-section {
    padding: 62px 0;
  }

  .section__bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section__heading h2,
  .section__bar h2,
  .media-section h2,
  .contact-section h2,
  .cta-section h2,
  .case-block h2 {
    font-size: 34px;
  }

  .section__lead,
  .media-section__copy p:not(.eyebrow),
  .case-block p {
    font-size: 16px;
  }

  .project-card--large {
    grid-row: auto;
  }

  .project-card--large .project-card__media,
  .project-card__media {
    aspect-ratio: 4 / 3;
  }

  .cta-section {
    padding: 30px 22px;
    margin-bottom: 54px;
  }

  .contact-section {
    padding: 32px 22px;
    margin-bottom: 54px;
    gap: 28px;
  }

  .contact-section__copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .case-layout {
    padding: 54px 0;
    gap: 34px;
  }

  .case-block {
    padding-bottom: 44px;
    margin-bottom: 44px;
  }

  .case-gallery figure:first-child {
    grid-column: auto;
  }

  .case-gallery figure:first-child img {
    aspect-ratio: 4 / 3;
  }

  .admin-shell {
    margin-top: 18px;
  }

  .editor-panel {
    padding: 18px;
  }
}

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