/* Stefan Electrical Contractors
   Brand orange is sampled from logo.png (#FF5C38).
   --orange-text is the same hue, darkened to clear WCAG AA for small text on #fafafa.
   Roboto and Roboto Mono are under the SIL Open Font License. See assets/fonts/. */

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --orange: #ff5c38;
  --orange-text: #c44820;
  --orange-hover: #ff734f;
  --border: rgba(26, 26, 26, 0.32);
  --error: #9f1239;
  --font-body: "Roboto", "Segoe UI", sans-serif;
  --font-display: "Roboto Mono", ui-monospace, "Cascadia Mono", monospace;
  --pad: clamp(1.25rem, 4vw, 4.5rem);
  --measure: 38rem;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/roboto-300.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: url("../img/circuit.svg");
  background-size: 280px 280px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

html.circuit-ready body {
  background-image: none;
}

::selection {
  background: #ffd2c6;
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
}

.circuit {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -200%;
  z-index: 3;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.hero,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 2vh, 1.35rem);
  padding: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) clamp(1.5rem, 4vh, 3rem) calc(var(--pad) + env(safe-area-inset-left));
  text-align: center;
}

.hero-copy {
  width: min(100%, 72rem);
  text-align: center;
}

.logo {
  width: 88px;
  max-width: 142px;
  height: auto;
}

.logo-link {
  display: inline-block;
  width: max-content;
  border-radius: 50%;
}

.hero-title {
  margin: 0 auto;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.15rem, calc((100vw - 2.75rem) / 6.9), 9.25rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-align: center;
}

.hero-title .line {
  display: block;
  text-align: left;
}

.title-stack {
  display: inline-block;
  text-align: left;
}

.accent,
.mark {
  color: var(--orange);
}

.lede {
  max-width: 36rem;
  margin: clamp(1.15rem, 2.6vw, 1.7rem) auto 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 300;
  line-height: 1.45;
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: max-content;
  max-width: 100%;
  margin: clamp(1.25rem, 2.8vw, 1.85rem) auto 0;
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(250, 250, 250, 0.46);
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--orange);
}

.btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(26, 26, 26, 0.28);
}

.btn-secondary:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

.btn-icon {
  flex: 0 0 3rem;
  width: 3rem;
  padding-inline: 0;
}

.btn-glyph {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
}

@media (max-width: 47.99rem) {
  .actions {
    flex-wrap: nowrap;
    gap: 0.32rem;
    padding: 0.26rem;
  }

  .actions .btn {
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .actions .btn-icon {
    flex-basis: 2.35rem;
    width: 2.35rem;
    padding: 0;
  }

  .actions .btn-glyph {
    width: 1.05rem;
    height: 1.05rem;
  }
}

.section {
  padding: clamp(2.5rem, 7vh, 5rem) calc(var(--pad) + env(safe-area-inset-right)) clamp(2.5rem, 7vh, 5rem) calc(var(--pad) + env(safe-area-inset-left));
  scroll-margin-top: 1.5rem;
  text-align: center;
}

.bento {
  container-type: inline-size;
  box-sizing: border-box;
  width: min(100%, 50rem);
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 3.25rem);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 16px 40px rgba(26, 26, 26, 0.06);
  text-align: left;
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.section h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 12cqi, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.prose {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
  font-weight: 300;
  line-height: 1.65;
}

.bento .prose,
.bento .contact-form,
.bento .form-success {
  margin-left: 0;
  margin-right: auto;
}

.prose p,
.privacy,
.form-note,
.form-error,
.form-success p,
.site-footer p {
  margin: 0;
}

.prose p + p {
  margin-top: 1.2rem;
}

.prose a,
.site-footer a,
.form-error a {
  color: var(--orange-text);
  text-underline-offset: 0.16em;
}

.prose a:hover,
.site-footer a:hover,
.form-error a:hover {
  color: var(--text);
}

.contact-form,
.form-success {
  max-width: 36rem;
  margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
  text-align: left;
}

.contact-form > .btn {
  display: flex;
  width: fit-content;
  margin-inline: 0;
}

.form-success p {
  margin-inline: auto;
}

.form-note,
.privacy {
  font-size: 0.98rem;
  font-weight: 300;
}

.form-note {
  margin-bottom: 1.35rem;
}

.privacy {
  margin: 0.25rem 0 1.25rem;
}

.field {
  margin: 0 0 1.15rem;
}

.field > label,
.consent {
  font-weight: 400;
  font-size: 0.98rem;
}

.field > label {
  display: block;
  margin-bottom: 0.4rem;
}

.req {
  color: var(--orange-text);
}

.optional {
  font-weight: 300;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

textarea {
  min-height: 10rem;
  border-radius: 1.7rem;
  resize: vertical;
}

label.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.consent input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--orange-text);
  flex: none;
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--error);
}

.field-error,
.form-error {
  color: var(--error);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
}

.field-error {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.form-error {
  margin-bottom: 1rem;
}

.form-success p {
  max-width: 18em;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0 calc(var(--pad) + env(safe-area-inset-right)) calc(2.25rem + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.heart-line {
  margin: 0;
  perspective: 480px;
}

.heart {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--orange);
  transform-style: preserve-3d;
}

.heart:hover {
  animation: coin-flip 0.8s ease;
}

@keyframes coin-flip {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.rise {
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.logo.rise,
.logo-link .rise {
  animation-delay: 0.04s;
}

.line:nth-child(1) {
  animation-delay: 0.14s;
}

.line:nth-child(2) {
  animation-delay: 0.26s;
}

.line:nth-child(3) {
  animation-delay: 0.38s;
}

.lede.rise {
  animation-delay: 0.52s;
}

.actions.rise {
  animation-delay: 0.66s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.15rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

html.js .reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero-missing .hero-title {
  max-width: 10ch;
  margin-inline: auto;
  font-size: clamp(2.4rem, calc((100vw - 8.5rem) / 6.2), 6.5rem);
}

@media (prefers-reduced-transparency: reduce) {
  .actions,
  .bento {
    background: rgba(250, 250, 250, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (min-width: 48rem) {
  .logo {
    width: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rise,
  html.js .reveal {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .btn,
  .btn:hover,
  .btn:active {
    transition: none;
    transform: none;
  }

  .heart,
  .heart:hover {
    animation: none;
  }
}
