@layer reset, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  img, svg { display: block; max-width: 100%; height: auto; }
  input, select, textarea, button { font: inherit; color: inherit; }
  table { border-collapse: collapse; }
}

@layer base {
  :root {
    --ngg-text: #DCEFF8;
    --ngg-bg: #0E1315;
    --ngg-primary: #15D8FB;
    --ngg-secondary: #162326;
    --ngg-accent: #E6A0DC;
    --ngg-on-primary: #0E1315;
    --ngg-muted: #A9C2CC;
    --ngg-line: #2A3C41;
    --ngg-tint: #1B2C30;
    --ngg-radius: 18px;
    --ngg-max: 1240px;
    --ngg-head: "Fraunces", Georgia, "Times New Roman", serif;
    --ngg-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: dark;
  }
  html { scroll-behavior: smooth; scroll-padding-top: 110px; }
  body {
    background: var(--ngg-bg);
    color: var(--ngg-text);
    font-family: var(--ngg-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    overflow-wrap: break-word;
  }
  h1, h2, h3 { font-family: var(--ngg-head); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
  h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
  h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
  h3 { font-size: 1.2rem; }
  p + p { margin-top: 0.9em; }
  a { color: var(--ngg-primary); text-underline-offset: 3px; }
  a:hover { color: var(--ngg-accent); }
  :focus-visible { outline: 3px solid var(--ngg-accent); outline-offset: 3px; }
  strong { color: #fff; font-weight: 700; }
}

@layer layout {
  .ngg-frame { width: 100%; max-width: var(--ngg-max); margin-inline: auto; padding-inline: 16px; }
  main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-bottom: 40px; }
  .ngg-board > .ngg-frame {
    background: var(--ngg-secondary);
    border-radius: var(--ngg-radius);
    padding: clamp(22px, 4vw, 48px);
    max-width: calc(var(--ngg-max) - 32px);
    width: calc(100% - 32px);
  }
  .ngg-board--narrow > .ngg-frame > p,
  .ngg-board--narrow > .ngg-frame > ul,
  .ngg-board--narrow > .ngg-frame > ol,
  .ngg-board--narrow > .ngg-frame > h2 { max-width: 72ch; }
  .ngg-studs { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 24px; }
  .ngg-studs--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (max-width: 700px) { .ngg-studs--two { grid-template-columns: minmax(0, 1fr); } }
  .ngg-mud { columns: 2 300px; column-gap: 22px; margin-top: 22px; }
  .ngg-mud > * { break-inside: avoid; margin-bottom: 18px; }
  .ngg-mud--list { columns: 2 260px; padding-left: 1.2em; list-style: disc; }
  .ngg-mud--list > li { margin-bottom: 8px; }
  .ngg-mud--tips { columns: 3 240px; }
  .ngg-quote { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); margin-top: 26px; align-items: start; }
  .ngg-quote__side { display: grid; gap: 18px; }
  .ngg-intro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
  .ngg-guide__top { display: grid !important; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
  .ngg-intro p, .ngg-guide__top p { max-width: 70ch; }
  @media (max-width: 820px) {
    .ngg-quote, .ngg-guide__top { grid-template-columns: minmax(0, 1fr); }
    .ngg-intro { grid-template-columns: minmax(0, 1fr); }
  }
}

@layer components {
  .ngg-skip { position: absolute; left: -9999px; top: 8px; background: var(--ngg-primary); color: var(--ngg-on-primary); padding: 8px 14px; border-radius: 8px; z-index: 50; }
  .ngg-skip:focus { left: 16px; }

  /* floating header */
  .ngg-corner {
    position: sticky; top: 12px; z-index: 40;
    margin: 12px auto 0; width: calc(100% - 24px); max-width: var(--ngg-max);
    background: rgba(22, 35, 38, 0.94); backdrop-filter: blur(8px);
    border: 1px solid var(--ngg-line); border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
  .ngg-corner__row { display: flex; align-items: center; gap: 18px; padding: 10px 16px; flex-wrap: wrap; }
  .ngg-corner__brand { display: flex; align-items: center; gap: 8px; color: var(--ngg-text); text-decoration: none; font-family: var(--ngg-head); font-weight: 600; font-size: 1.05rem; line-height: 1.2; max-width: 15em; }
  .ngg-corner__nav { flex: 1 1 auto; }
  .ngg-corner__nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: center; }
  .ngg-corner__nav a { color: var(--ngg-text); text-decoration: none; font-weight: 500; font-size: 0.97rem; }
  .ngg-corner__nav a:hover, .ngg-corner__nav a[aria-current] { color: var(--ngg-primary); }
  .ngg-corner__call { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
  .ngg-corner__phone { display: flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; color: var(--ngg-primary); white-space: nowrap; }
  .ngg-corner__hours { font-size: 0.8rem; color: var(--ngg-muted); }
  @media (max-width: 1080px) {
    .ngg-corner__nav { order: 5; flex-basis: 100%; }
    .ngg-corner__nav ul { justify-content: flex-start; }
    .ngg-corner__call { margin-left: auto; }
  }
  @media (max-width: 767px) {
    .ngg-corner { top: 6px; width: calc(100% - 12px); border-radius: 16px; }
    .ngg-corner__row { gap: 8px 12px; padding: 8px 12px; }
    .ngg-corner__brand { font-size: 0.95rem; max-width: 11em; }
    .ngg-corner__brand .ngg-icon { display: none; }
    .ngg-corner__cta, .ngg-corner__hours { display: none; }
    .ngg-corner__nav ul { gap: 2px 14px; }
    .ngg-corner__nav a { font-size: 0.9rem; }
  }

  .ngg-icon { width: 22px; height: 22px; stroke: currentColor; flex: none; }
  .ngg-icon--card { width: 34px; height: 34px; color: var(--ngg-accent); margin-bottom: 10px; }
  .ngg-icon--big { width: 56px; height: 56px; color: var(--ngg-accent); }
  .ngg-icon--brand { color: var(--ngg-accent); }

  /* buttons */
  .ngg-bead {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 20px; border-radius: 999px;
    font-weight: 700; text-decoration: none; border: 2px solid transparent; text-align: center;
  }
  .ngg-bead--fill { background: var(--ngg-primary); color: var(--ngg-on-primary); }
  .ngg-bead--fill:hover { background: #fff; color: var(--ngg-on-primary); }
  .ngg-bead--line { border-color: var(--ngg-accent); color: var(--ngg-accent); }
  .ngg-bead--line:hover { background: var(--ngg-accent); color: var(--ngg-on-primary); }
  .ngg-bead--text { padding-inline: 4px; color: var(--ngg-text); text-decoration: underline; text-decoration-color: var(--ngg-accent); }
  .ngg-bead--big { font-size: 1.15rem; padding: 12px 26px; }
  .ngg-corner__cta { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }

  /* hero */
  .ngg-hero { position: relative; min-height: min(82vh, 720px); display: grid; align-items: end; overflow: hidden; margin-top: -86px; padding-top: 120px; }
  .ngg-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .ngg-hero__veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 10, 12, 0.75) 0%, rgba(6, 10, 12, 0.66) 60%, rgba(6, 10, 12, 0.6) 100%); }
  .ngg-hero__copy { position: relative; color: #fff; padding-block: 40px 56px; }
  .ngg-hero__copy h1 { max-width: 15ch; color: #fff; }
  .ngg-hero__lead { max-width: 56ch; font-size: 1.15rem; margin-top: 16px; color: #F1F8FB; }
  .ngg-hero__btns { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; margin-top: 24px; }
  .ngg-hero__copy .ngg-bead--text { color: #fff; }
  .ngg-hero__hours { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 500; }
  .ngg-hero__sms { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ngg-accent); font-weight: 600; }
  .ngg-hero .ngg-skim { color: #E4F1F6; }

  .ngg-seam { margin-bottom: 14px; position: relative; padding-left: 18px; }
  .ngg-seam::before { content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em; width: 5px; border-radius: 3px; background: var(--ngg-primary); }
  .ngg-lede { color: var(--ngg-muted); font-size: 1.08rem; max-width: 70ch; }
  .ngg-board--intro h1 { margin-bottom: 16px; }
  main > .ngg-board--intro:first-child { margin-top: 18px; }
  .ngg-board--accent > .ngg-frame { background: linear-gradient(135deg, #17303A, var(--ngg-secondary)); border: 1px solid #23505C; }
  .ngg-board--close > .ngg-frame { border: 2px solid var(--ngg-primary); }

  /* left-border cards */
  .ngg-tape {
    background: var(--ngg-tint);
    border-left: 6px solid var(--ngg-accent);
    border-radius: 6px 14px 14px 6px;
    padding: 18px 20px;
  }
  .ngg-tape h3 { margin-bottom: 6px; }
  .ngg-tape h2 { font-size: 1.3rem; margin-bottom: 8px; }
  .ngg-tape__link { display: inline-block; margin-top: 10px; font-weight: 700; }
  .ngg-tape--faq summary { cursor: pointer; font-weight: 700; font-family: var(--ngg-head); font-size: 1.08rem; }
  .ngg-tape--faq p { margin-top: 8px; }
  .ngg-tape--warn { border-left-color: var(--ngg-primary); }
  .ngg-tape--warn p { display: flex; gap: 10px; align-items: flex-start; }
  .ngg-mud--towns { list-style: none; padding: 0; }
  .ngg-mud--towns > li { margin-bottom: 12px; }
  .ngg-mud--areas > li h2 { font-size: 1.25rem; }

  /* steps */
  .ngg-steps { counter-reset: ngg-step; display: grid; gap: 14px; margin-top: 20px; }
  .ngg-steps > li { counter-increment: ngg-step; position: relative; padding-left: 52px; }
  .ngg-steps > li::before {
    content: counter(ngg-step); position: absolute; left: 0; top: 0;
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ngg-primary); color: var(--ngg-on-primary); font-weight: 700;
  }
  .ngg-steps > li h3 { margin-bottom: 4px; padding-top: 4px; }
  .ngg-steps--cols { display: block; columns: 2 320px; column-gap: 28px; }
  .ngg-steps--cols > li { break-inside: avoid; margin-bottom: 16px; min-height: 36px; }

  /* picker */
  .ngg-picks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
  .ngg-pick {
    display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px;
    border: 2px solid var(--ngg-primary); border-radius: 12px; color: var(--ngg-text);
    text-decoration: none; font-weight: 600; background: rgba(21, 216, 251, 0.06);
  }
  .ngg-pick:hover { background: var(--ngg-primary); color: var(--ngg-on-primary); }

  /* tables */
  .ngg-scroll { overflow-x: auto; margin-top: 18px; -webkit-overflow-scrolling: touch; }
  .ngg-table { width: 100%; min-width: 560px; font-size: 0.98rem; }
  .ngg-table th, .ngg-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ngg-line); vertical-align: top; }
  .ngg-table th { color: var(--ngg-accent); font-weight: 700; }

  /* figures */
  .ngg-figure { margin: 24px 0; background: var(--ngg-bg); border-radius: 14px; padding: 18px; }
  .ngg-figure figcaption { margin-top: 10px; color: var(--ngg-muted); font-size: 0.92rem; }
  .ngg-tl__rail { stroke: var(--ngg-line); stroke-width: 6; }
  .ngg-tl__node { fill: var(--ngg-primary); }
  .ngg-tl__num { fill: var(--ngg-on-primary); font: 700 22px var(--ngg-body); }
  .ngg-tl__label { fill: var(--ngg-text); font: 600 19px var(--ngg-body); }
  .ngg-tl__dry rect { fill: none; stroke: var(--ngg-accent); stroke-width: 2; stroke-dasharray: 5 4; }
  .ngg-tl__dry text { fill: var(--ngg-accent); font: 500 14px var(--ngg-body); }
  .ngg-wa__plate, .ngg-wa__stud { fill: #B48A5A; }
  .ngg-wa__board { fill: #D9DEE0; opacity: 0.92; }
  .ngg-wa__seam { fill: #F4F6F7; stroke: #9DB0B6; stroke-dasharray: 4 3; }
  .ngg-wa__screw { fill: #3B4A50; }
  .ngg-wa__box { fill: #5B8CA0; stroke: #0E1315; }
  .ngg-wa__lead { stroke: var(--ngg-accent); stroke-width: 1.5; }
  .ngg-wa__dim { stroke: var(--ngg-primary); stroke-width: 2; }
  .ngg-wa__txt { fill: var(--ngg-text); font: 600 15px var(--ngg-body); paint-order: stroke; stroke: var(--ngg-bg); stroke-width: 3px; }

  /* offset image block */
  .ngg-shim { margin: 26px 0 30px; }
  .ngg-shim__block { position: relative; margin-right: 14px; }
  .ngg-shim__block::before { content: ""; position: absolute; inset: 0; transform: translate(14px, 14px); background: var(--ngg-primary); border-radius: 14px; }
  .ngg-shim__img { position: relative; width: 100%; border-radius: 14px; }
  .ngg-shim figcaption { margin-top: 26px; color: var(--ngg-muted); font-size: 0.92rem; }

  /* form */
  .ngg-sheet { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .ngg-sheet label { display: grid; gap: 6px; font-weight: 600; font-size: 0.96rem; }
  .ngg-sheet__wide { grid-column: 1 / -1; }
  .ngg-sheet input, .ngg-sheet select, .ngg-sheet textarea {
    width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #3A5158; background: var(--ngg-bg);
  }
  .ngg-sheet input:focus, .ngg-sheet select:focus, .ngg-sheet textarea:focus { border-color: var(--ngg-primary); outline: none; box-shadow: 0 0 0 3px rgba(21, 216, 251, 0.3); }
  .ngg-opt { color: var(--ngg-muted); font-weight: 400; }
  .ngg-sheet button { border: 0; cursor: pointer; }
  .ngg-consent { margin-top: 14px; font-size: 0.9rem; color: var(--ngg-muted); }
  .ngg-quote__label { font-weight: 700; }
  .ngg-quote__phone { display: inline-flex; gap: 8px; align-items: center; font-size: 1.35rem; font-weight: 700; text-decoration: none; }
  .ngg-quote__side .ngg-tape p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

  /* footer with raised contact card */
  .ngg-joist { background: #091012; border-top: 1px solid var(--ngg-line); margin-top: 100px; padding-bottom: 28px; font-size: 0.92rem; color: var(--ngg-muted); }
  .ngg-joist__card {
    position: relative; margin-top: -70px; margin-bottom: 36px;
    background: var(--ngg-tint); border: 2px solid var(--ngg-primary); border-radius: 20px;
    padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); color: var(--ngg-text);
  }
  .ngg-joist__label { flex-basis: 100%; font-family: var(--ngg-head); font-size: 1.2rem; }
  .ngg-joist__phone { display: inline-flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
  .ngg-joist__hours, .ngg-joist__sms { display: inline-flex; align-items: center; gap: 8px; }
  .ngg-joist__sms { color: var(--ngg-accent); }
  .ngg-joist__cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
  .ngg-joist__cols ul { list-style: none; padding: 0; display: grid; gap: 4px; }
  .ngg-joist__cols a { color: var(--ngg-text); }
  .ngg-joist__name { font-family: var(--ngg-head); color: var(--ngg-text); font-size: 1.1rem; }
  .ngg-joist__head { font-weight: 700; color: var(--ngg-text); margin-bottom: 6px; }
  .ngg-joist__fine { margin-top: 8px; }

  /* mobile call bar */
  .ngg-plate { display: none; }
  @media (max-width: 767px) {
    .ngg-plate {
      display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; gap: 8px;
      padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(14, 19, 21, 0.97); border-top: 1px solid var(--ngg-line);
    }
    .ngg-plate a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 12px; font-weight: 700; text-decoration: none; font-size: 0.95rem; }
    .ngg-plate__call { background: var(--ngg-primary); color: var(--ngg-on-primary); flex: 1.5 !important; }
    .ngg-plate__sms { border: 2px solid var(--ngg-accent); color: var(--ngg-accent); }
    body { padding-bottom: 76px; }
    .ngg-hero { margin-top: -110px; padding-top: 130px; }
  }
}

@layer utilities {
  .ngg-skim { font-size: 0.92rem; color: var(--ngg-muted); margin-top: 10px; max-width: 60ch; }
}
