:root {
  --content-width: 1200px;
  --content-gutter: clamp(1rem, 2.5vw, 2rem);
  --frame-gutter: clamp(0px, 4vw, 3rem);
  --frame-radius: 0.8rem;
  --header-top-gap: 1.5rem;
  --header-surface: ghostwhite;
  --header-text: #171717;
  --header-muted: #606773;
  --header-border: #e6e2dc;
  --backdrop: #ecebe6;
  --frame-border: #d8d5cd;
  --ambient-ink: #8b8d91;
  --ambient-line: rgba(75, 79, 84, 0.18);
  --bg: #f7f6f2;
  --surface: ghostwhite;
  --surface-soft: #fff1e5;
  --surface-strong: #f0ede7;
  --text: #171717;
  --muted: #606773;
  --border: #e6e2dc;
  --orange: #ff7a00;
  --orange-soft: rgba(255, 122, 0, 0.28);
  --orange-hover: #ff922b;
  --danger: #be2f25;
  --success: #176b3b;
  --success-soft: #e9f6ed;
  --success-border: #b8dfc4;
  --error-soft: #fff0ee;
  --error-border: #edc3bf;
  --shadow: 0 18px 45px rgba(18, 18, 18, 0.12);
}

:root[data-theme="dark"] {
  --bg: #0d0e10;
  --surface: #17191d;
  --surface-soft: rgba(255, 122, 0, 0.14);
  --surface-strong: #111316;
  --text: #f7f4ef;
  --muted: #b8bec7;
  --border: #303238;
  --orange-hover: #ff9a33;
  --orange-soft: rgba(255, 122, 0, 0.2);
  --danger: #ff756d;
  --success: #9ee2b3;
  --success-soft: #18251c;
  --success-border: #365b40;
  --error-soft: #2b1919;
  --error-border: #603532;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 196px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--backdrop);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 19;
  height: calc(var(--header-top-gap) + 0.8rem);
  background: var(--backdrop);
  pointer-events: none;
}

.ambient-code {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--ambient-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
}

.ambient-code span {
  position: absolute;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--ambient-line);
  white-space: nowrap;
}

.ambient-code span::after {
  position: absolute;
  top: 50%;
  width: 2rem;
  height: 1px;
  background: var(--ambient-line);
  content: "";
}

.ambient-code-one {
  top: 17%;
  left: 2.5%;
}

.ambient-code-one::after,
.ambient-code-four::after {
  right: -2rem;
}

.ambient-code-two {
  top: 31%;
  right: 2.5%;
}

.ambient-code-two::after,
.ambient-code-three::after {
  left: -2rem;
}

.ambient-code-three {
  right: 3.5%;
  bottom: 25%;
}

.ambient-code-four {
  bottom: 13%;
  left: 2.5%;
}

.site-shell {
  position: relative;
  width: min(calc(100% - 2 * var(--frame-gutter)), var(--content-width));
  margin: 1.5rem auto;
  background: var(--bg);
  border: 1px solid var(--frame-border);
  border-radius: var(--frame-radius);
}

a {
  color: inherit;
}

main {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: var(--header-top-gap);
  z-index: 20;
  width: min(100%, var(--content-width));
  min-height: 180px;
  margin-inline: auto;
  color: var(--header-text);
  display: grid;
  grid-template-columns: minmax(15rem, 1.2fr) 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem var(--content-gutter);
  background: var(--header-surface);
  border-bottom: 1px solid var(--header-border);
  border-radius: calc(var(--frame-radius) - 1px) calc(var(--frame-radius) - 1px) 0 0;
}

.brand {
  display: flex;
  width: fit-content;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(15rem, 22vw, 18rem);
  height: auto;
}

.brand-logo-dark {
  display: none;
}

.brand-logo-light {
  display: block;
}

.top-nav,
.header-actions,
.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.top-nav {
  justify-content: center;
  gap: clamp(0.8rem, 3vw, 2rem);
  color: var(--header-muted);
  font-size: 0.95rem;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--header-text);
}

.header-actions {
  justify-content: flex-end;
}

.theme-toggle,
.cart-pill {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.85rem;
  color: var(--header-text);
  background: var(--header-surface);
  border: 1px solid var(--header-border);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.theme-toggle:hover,
.cart-pill:hover {
  border-color: color-mix(in srgb, var(--orange) 55%, var(--header-border));
}

.cart-pill strong {
  display: grid;
  min-width: 1.7rem;
  min-height: 1.7rem;
  place-items: center;
  color: #111;
  background: var(--orange);
  border-radius: 999px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 5vw, 4rem) var(--content-gutter) 2.5rem;
}

.hero-copy {
  max-width: 48rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow),
.section-intro p:not(.eyebrow),
.panel-heading p {
  color: var(--muted);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 43rem;
  font-size: 1.14rem;
}

.hero-actions,
.form-actions {
  flex-wrap: wrap;
  margin-top: 1.7rem;
}

.button,
.add-button,
.remove-button,
.quantity-button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.65rem;
  font-weight: 900;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.05rem;
}

.primary,
.add-button {
  color: #111;
  background: var(--orange);
}

.primary:hover,
.add-button:hover {
  background: var(--orange-hover);
}

.secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.hero-card,
.service-card,
.cart-panel,
.request-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(1rem, 3vw, 1.4rem);
}

.hero-card-label {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-weight: 800;
}

.quote-preview-row,
.quote-preview-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.quote-preview-row strong {
  color: var(--orange);
  white-space: nowrap;
}

.quote-preview-total {
  align-items: center;
  margin-top: 0.8rem;
  padding: 1rem;
  color: #111;
  background: var(--orange);
  border: 0;
  border-radius: 0.75rem;
  font-weight: 900;
}

.section-intro {
  padding: 2rem var(--content-gutter) 1.2rem;
}

.service-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 var(--content-gutter);
  padding: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.category-tab {
  min-height: 2.75rem;
  padding: 0.6rem 0.9rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-weight: 800;
  white-space: nowrap;
}

.category-tab:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.category-tab[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: inset 0 -2px var(--orange);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  justify-items: center;
  gap: 1rem;
  padding: 1rem var(--content-gutter) 3rem;
}

.service-card {
  display: flex;
  width: 100%;
  max-width: 20rem;
  min-height: 21.5rem;
  flex-direction: column;
  padding: 1.1rem;
  box-shadow: none;
}

.service-card[hidden] {
  display: none;
}

.service-card.selected {
  border-color: color-mix(in srgb, var(--orange) 72%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 20%, transparent);
}

.card-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  margin-bottom: 1rem;
  color: #111;
  background: var(--orange);
  border-radius: 0.7rem;
  font-weight: 900;
}

.tag {
  margin: 0 0 0.35rem;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.service-card p:not(.tag) {
  color: var(--muted);
}

.card-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 1rem;
}

.card-bottom span {
  color: var(--text);
  font-weight: 900;
}

.add-button {
  width: 10rem;
  flex: 0 0 10rem;
  padding: 0.65rem 0.9rem;
  white-space: nowrap;
}

.add-button.in-cart {
  color: var(--text);
  background: var(--orange-soft);
}

.add-button.in-cart:hover {
  background: color-mix(in srgb, var(--orange) 42%, var(--surface));
}

.quote-layout {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  margin-inline: auto;
  padding: 1rem var(--content-gutter) 3rem;
}

.cart-panel,
.request-form {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.cart-panel {
  position: static;
}

.cart-continue {
  width: 100%;
  margin-top: 1rem;
}

.panel-heading {
  margin-bottom: 1.2rem;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed color-mix(in srgb, var(--orange) 32%, var(--border));
  border-radius: 0.75rem;
}

.cart-items {
  display: grid;
  max-height: 18rem;
  gap: 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  padding: 0.9rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.cart-item h3 {
  font-size: 1rem;
}

.cart-item p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-controls {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.quantity-controls {
  display: inline-grid;
  grid-template-columns: 2rem 2rem 2rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
}

.quantity-button {
  min-height: 2rem;
  color: var(--text);
  background: var(--surface);
  border-radius: 0;
}

.quantity-controls span {
  text-align: center;
  font-weight: 900;
}

.remove-button {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  color: var(--danger);
  background: transparent;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.request-form {
  display: grid;
  gap: 1rem;
}

.request-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 900;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.8rem 0.85rem;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 42%, transparent);
  outline-offset: 2px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.form-note[data-state="success"],
.form-note[data-state="error"] {
  padding: 0.9rem 1rem;
  border: 1px solid;
  border-radius: 0.6rem;
  font-weight: 750;
}

.form-note[data-state="success"] {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-border);
}

.form-note[data-state="error"] {
  color: var(--danger);
  background: var(--error-soft);
  border-color: var(--error-border);
}

.site-footer {
  width: min(100%, var(--content-width));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--content-gutter);
  color: var(--header-text);
  background: var(--header-surface);
  border-top: 1px solid var(--header-border);
  border-radius: 0 0 calc(var(--frame-radius) - 1px) calc(var(--frame-radius) - 1px);
}

.site-footer img {
  display: block;
  width: clamp(9.5rem, 15vw, 12rem);
  height: auto;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

}

@media (max-width: 860px) {
  :root {
    --header-top-gap: 1rem;
  }

  .ambient-code {
    display: none;
  }

  .site-shell {
    --frame-gutter: 1rem;
    margin-block: 1rem;
  }

  .site-header {
    grid-template-columns: minmax(14rem, 1fr) auto;
  }

  .top-nav {
    display: none;
  }

  .hero,
  .quote-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  :root {
    --header-top-gap: 0;
  }

  .site-shell {
    width: 100%;
    margin: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .site-header {
    align-items: start;
    grid-template-columns: 1fr;
    top: 0;
    min-height: 180px;
    gap: 0.75rem;
    padding-block: 0.7rem;
    border-radius: 0 0 0.8rem 0.8rem;
  }

  .site-footer {
    border-radius: 0;
  }

  .brand-logo {
    width: clamp(14rem, 76vw, 18rem);
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle,
  .cart-pill {
    flex: 1;
    justify-content: center;
  }

  .cart-pill span {
    display: none;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .service-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .service-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .service-card {
    min-height: 0;
  }

  .card-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .add-button {
    width: 100%;
    flex-basis: auto;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-controls {
    justify-items: start;
  }
}
