/* Light frosted surfaces; section backgrounds remain opaque for the scroll stack. */
:root {
  --glass-blur: 16px;
  --glass-edge: #dfe5ee;
  --glass-shadow: inset 0 1px 0 #ffffff, 0 12px 34px #1c35540a;
}

/* Solid fallback first. No transparency is required to read a card or use a form. */
:is(.hero-contact-brief, .hero-requisites, .calculator-card, .service-card,
    .price-group, .contact-card, .contact-details, .partnership-line, dialog) {
  background: #fbfcfe;
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
}
.hero-note {
  background: #fff9e9;
  border-color: #e9dfbc;
  box-shadow: inset 0 1px 0 #ffffff, 0 10px 30px #9e79100a;
}
.hero-contact-brief, .hero-requisites { border-color: #e2e7ee; }
.service-card:hover { box-shadow: inset 0 1px 0 #ffffff, 0 18px 38px #1c355414; }
.hero-requisites .requisite-item { border-color: #dce2eb; }
.hero-requisites .requisite-copy, .requisite-copy { background: #ffffff; }

/* The calculator has one filtered outer shell; its readable result stays solid. */
.calc-fields { background: transparent; }
.calc-summary {
  background: #fbfcfe;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.estimate-content {
  background: linear-gradient(180deg, #fbfcfe, #ffffff);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
input, select, textarea { background-color: #ffffff; }
.request-draft { background: #ffffff; }

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  :is(.hero-contact-brief, .hero-requisites, .calculator-card, .service-card,
      .price-group, .contact-card, .contact-details, .partnership-line) {
    background: linear-gradient(135deg, #ffffffed 0%, #ffffffd9 48%, #f3f7fce8 100%);
    border-color: #ffffffd9;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.08);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.08);
    box-shadow: inset 0 1px 0 #ffffff, inset 0 0 0 1px #aabbd21c, 0 12px 34px #1c35540a;
  }
  .hero-note {
    background: linear-gradient(125deg, #fffdf4f5 0%, #fff7dfe6 60%, #fffaf0f0 100%);
    border-color: #ffffffd9;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    box-shadow: inset 0 1px 0 #ffffff, inset 0 0 0 1px #b5953a24, 0 10px 30px #9e79100a;
  }
  .service-card:hover {
    box-shadow: inset 0 1px 0 #ffffff, inset 0 0 0 1px #aabbd22b, 0 18px 38px #1c355414;
  }
}

/* Blur the modal backdrop, not the dialog containing the fixed beacon cursor. */
dialog {
  background: linear-gradient(145deg, #fffffff7, #f7f9fcf5);
  border-color: #ffffffe6;
  box-shadow: inset 0 1px 0 #ffffff, 0 24px 80px #1423372e;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
dialog::backdrop {
  background: #18253638;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  dialog { background: #ffffff; }
}

@media (max-width: 820px), (pointer: coarse) {
  :root { --glass-blur: 12px; }
  @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    :is(.hero-contact-brief, .hero-requisites, .calculator-card, .service-card,
        .price-group, .contact-card, .contact-details, .partnership-line) {
      background: linear-gradient(135deg, #fffffff5, #f7f9fcf0);
    }
    .hero-note { background: linear-gradient(125deg, #fffdf5f7, #fff8e6f2); }
  }
}

@media (prefers-reduced-transparency: reduce) {
  :is(.hero-contact-brief, .hero-requisites, .calculator-card, .service-card,
      .price-group, .contact-card, .contact-details, .partnership-line, dialog) {
    background: #ffffff;
    border-color: #d8dfe8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 3px 12px #1c355408;
  }
  .hero-note {
    background: #fff9e9;
    border-color: #e9dfbc;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  dialog::backdrop {
    background: #17212e99;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  :is(.hero-contact-brief, .hero-requisites, .calculator-card, .service-card,
      .price-group, .contact-card, .contact-details, .hero-note, .partnership-line, dialog) {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .calc-fields, .calc-summary, .estimate-content, input, select, textarea, .request-draft {
    background: Canvas;
    color: CanvasText;
  }
  .service-card:hover { box-shadow: none; }
  dialog::backdrop {
    background: Canvas;
    opacity: .75;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
