:root {
  color-scheme: light;
  --page: #fff;
  --surface: #f7f5fb;
  --text: #1e192b;
  --muted: #554e64;
  --line: #ded9e8;
  --accent: #65268a;
  --accent-strong: #50126f;
  --on-accent: #fff;
  --focus: #6d2f9c;
  --width: 1120px;
  --gutter: clamp(16px, 4vw, 42px);
}

:root[data-resolved-theme="dark"] {
  color-scheme: dark;
  --page: #17131f;
  --surface: #211a2d;
  --text: #f7f2fc;
  --muted: #ccc1d7;
  --line: #493c55;
  --accent: #e3b8fc;
  --accent-strong: #efdaff;
  --on-accent: #291337;
  --focus: #dca7ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.6 "Segoe UI", Arial, sans-serif;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
button { font: inherit; }

a:focus-visible,
button:focus-visible,
main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 2;
  padding: 8px 14px;
  background: var(--page);
  transform: translateY(calc(-100% - 12px));
}

.skip-link:focus { transform: none; }

.shell,
.nav-shell,
.footer-bottom {
  width: min(var(--width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--line); }

.nav-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 5px 7px;
  border-radius: 5px;
}

.brand img { width: clamp(132px, 18vw, 210px); }
:root[data-resolved-theme="dark"] .brand { background: #fff; }

.nav-links,
.footer-links,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}

.nav-links { justify-content: center; }

.nav-links a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .18em;
}

.theme-switcher {
  justify-self: end;
  display: flex;
}

.theme-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-button:hover { background: var(--surface); }

.theme-button[aria-pressed="true"] {
  border-color: currentColor;
  background: var(--surface);
  color: var(--accent);
}

.hero-section {
  background: var(--surface);
  padding-block: clamp(34px, 6vw, 84px);
}

.hero-grid,
.approach-grid,
.feedback-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 82px);
}

.hero-grid { align-items: center; }

.hero-grid h1,
.page-intro h1,
.legal-shell h1,
.error-shell h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.8vw, 4.4rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.hero-grid p {
  max-width: 47ch;
  margin: 22px 0 26px;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.23rem);
}

.hero-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-strong); }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: .2em;
  font-weight: 650;
}

.section { padding-block: clamp(36px, 5vw, 70px); }

.page-intro h1 { max-width: 22ch; }

.page-intro p {
  max-width: 53ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.case-study {
  display: grid;
  grid-template-areas: "title title" "story screenshot";
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px clamp(24px, 6vw, 82px);
  padding-block: clamp(26px, 4.5vw, 56px);
}

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

.case-group-title {
  margin: 0;
  padding-top: clamp(26px, 4.5vw, 56px);
  border-top: 1px solid var(--line);
  font-size: clamp(1.75rem, 3.3vw, 2.85rem);
  line-height: 1.15;
}

.case-study h2,
.case-study h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.15;
}

.case-context {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.case-study > div { grid-area: title; }
.case-study dl { grid-area: story; margin: 0; }
.case-study dt { font-weight: 700; }
.case-study dd { margin: 2px 0 0; color: var(--muted); }
.case-study dd + dt { margin-top: 14px; }

.case-media { grid-area: screenshot; margin: 0; }

.case-media a {
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.case-media img { border-radius: 7px; }
.case-media--portrait a { max-width: min(100%, 16rem); }

.case-media figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: .9rem;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.3vw, 2.85rem);
  font-weight: 720;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.section h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

.section p { margin: 9px 0 0; color: var(--muted); }

.results-list,
.feedback-list {
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.results-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.5fr);
  align-items: baseline;
  gap: 6px 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}

.results-list li:first-child { border-top: 1px solid var(--line); }
.results-list p { margin: 0; }

.results-list strong {
  color: var(--accent);
  font-size: clamp(1.18rem, 2.25vw, 1.55rem);
  letter-spacing: -.02em;
  line-height: 1.25;
}

#services { padding-top: 0; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 4vw, 50px);
  margin-top: 22px;
}

.service-grid article {
  border-top: 2px solid var(--line);
  padding-top: 14px;
}

.approach-section,
.contact-section { background: var(--surface); }

.approach-steps {
  margin: 0;
  padding-left: 1.55em;
}

.approach-steps li { padding-left: .45em; }
.approach-steps li + li { margin-top: 17px; }
.approach-steps li::marker { color: var(--accent); font-weight: 750; }

.feedback-list { margin: 0 0 8px; }

.feedback-list li {
  color: var(--muted);
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.feedback-list li:first-child { padding-top: 0; }
.contact-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-block: 16px;
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 20px;
}

.footer-shell p,
.footer-bottom { font-size: .94rem; }
.footer-bottom { margin-block: 0; }
.footer-bottom a { display: inline-block; margin-left: 12px; }

.legal-shell,
.error-shell {
  width: min(760px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  padding-block: clamp(32px, 6vw, 76px);
}

.legal-intro,
.legal-shell section p,
.legal-note,
.error-shell > p:not(.eyebrow) { color: var(--muted); }

.legal-shell section + section { margin-top: 26px; }
.legal-shell h2 { margin-bottom: 6px; }
.legal-shell section p { margin: 0; }
.legal-shell code { overflow-wrap: anywhere; }

.legal-note {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.eyebrow { color: var(--accent); font-weight: 700; }
.error-brand { margin-bottom: 22px; }
.error-shell > .button { margin-top: 8px; }

@media (max-width: 820px) {
  .nav-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 8px;
    padding-top: 4px;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .theme-switcher { grid-column: 2; grid-row: 1; }
  .brand { justify-self: start; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .case-study { grid-template-areas: "title" "story" "screenshot"; }

  .case-study,
  .hero-grid,
  .approach-grid,
  .feedback-grid,
  .service-grid,
  .results-list li { grid-template-columns: minmax(0, 1fr); }

  .hero-image { aspect-ratio: 16 / 7; }
  .results-list li { gap: 7px; }
  .nav-links { gap: 0 clamp(12px, 4vw, 18px); }
}

@media (forced-colors: active) {
  .button.primary { border-color: ButtonText; }
  .theme-button[aria-pressed="true"] { border-color: Highlight; }
}
