Example website for demonstration only. Not a real business.

Source

How this site is built

Everything below is the live project source, captured when the site was built. After you edit a file, run npm run dev or npm run build to see the change. Compiled HTML (the files in dist/) is also loaded below when you are viewing this page over http:// or https://.

Config and data

The knobs you will turn first: business details, package scripts, and Astro settings.

astro.config.mjs

Astro is set to a static build with one HTML file per page.

// @ts-check
import { defineConfig } from 'astro/config';

// Static HTML, CSS, and JS only — no server, no paid services, no trackers.
export default defineConfig({
  output: 'static',
  // One HTML file per page (index.html, menu.html, …) so the built
  // site can be opened from the dist/ folder or served by any static host.
  build: {
    format: 'file',
  },
});

IMAGES.md

Photographer credits and source URLs for every image.

# Photo credits — Summit Auto Care

Every image is from Unsplash or Pexels and may be used commercially. Attribution is also listed in the site footer.

| File | Photographer | Source | License |
| --- | --- | --- | --- |
| `images/hero-headlights.jpg` | Mike Bird | https://www.pexels.com/photo/120049/ | Pexels License (free for commercial use) |
| `images/shop.jpg` | Katya Alagich | https://www.pexels.com/photo/3807333/ | Pexels License (free for commercial use) |
| `images/bay.jpg` | Dietmar Becker | https://unsplash.com/photos/8Zt0xOOK4nI | Unsplash License (free for commercial use) |
| `images/silver-car.jpg` | Zugr | https://unsplash.com/photos/yZf1quatKCA | Unsplash License (free for commercial use) |
| `images/classic.jpg` | Eric Micheal | https://unsplash.com/photos/C4FV77ovIBM | Unsplash License (free for commercial use) |
| `images/green-car.jpg` | Sean Stratton | https://unsplash.com/photos/3I5j50pIXvU | Unsplash License (free for commercial use) |
| `images/dashboard.jpg` | Nick Turner | https://unsplash.com/photos/0EjvnhOkPLM | Unsplash License (free for commercial use) |
| `images/truck.jpg` | jamie mink | https://unsplash.com/photos/5Qwz2KyfIBE | Unsplash License (free for commercial use) |

Images were resized and compressed for the web (generally under 300 KB each).
To swap a photo, replace the file in `public/images/`, then update this table, the footer credits in `src/data/site.json`, and any `alt` text.

package.json

npm scripts: dev, build, preview. The only runtime dependency is Astro.

{
  "name": "example-04-auto-repair",
  "type": "module",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "astro dev",
    "build": "astro build && node scripts/relative-paths.mjs",
    "preview": "astro preview"
  },
  "dependencies": {
    "astro": "^7.4.7"
  }
}

public/_headers

Sample Content-Security-Policy for hosts like Netlify.

# Sample HTTPS security headers for hosts that understand this file (e.g. Netlify).
# Safe to leave in place on any static host that ignores it.
/*
  Content-Security-Policy: default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; font-src 'self'; connect-src 'self'; form-action 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  X-Frame-Options: DENY

README.md

How to run, customize, and hook up a real form or payment provider.

# Summit Auto Care

Example **Auto repair** website, built with [Astro](https://astro.build) 7 as a starting point you can hand to a client or reshape for a pitch.

**This is not a real business.** Names, people, reviews, prices, and the Example Bay address are fictional. The site is set to `noindex` so it will not wander into search results if you deploy it by accident. Remove that meta tag in `src/layouts/BaseLayout.astro` when a real client site should be indexed.

The service estimator totals example list prices. It is not an invoice.

## How to run

You need Node.js 18 or newer (Node 22+ is fine). In this folder:

```bash
npm install
npm run dev
```

Then open the URL Astro prints (usually http://localhost:4321/).

To make a static build:

```bash
npm run build
npm run preview
```

`npm run build` writes to `dist/` and then rewrites root-absolute paths (`/images/...`) to document-relative ones (`./images/...`). After a build you can also serve the folder with any static server:

```bash
python3 -m http.server --directory dist 8080
```

Opening `dist/index.html` directly from the file system (double-click) usually shows the layout and images. Some browsers restrict JavaScript on `file://` URLs, so interactive features (filters, forms, the lightbox) are more reliable from `npm run preview` or another local server. There are no ES modules required for those features; they live in classic scripts under `public/js/`.

## How to customize

Start with **`src/data/site.json`**. It holds the business name, colors, fonts, hours, contact details, copy, and image credits. Colors are applied as CSS variables by `src/layouts/BaseLayout.astro`.

| Want to change… | Edit |
| --- | --- |
| Name, phone, hours, colors | `src/data/site.json` |
| Page layout and sections | `src/pages/*.astro` |
| Header, footer, hero, forms | `src/components/` |
| Spacing, typography, components | `src/styles/global.css` |
| Shared JS (menu, forms, filters) | `public/js/site.js` |
| This site’s unique JS | `public/js/features.js` |
| Photos | `public/images/` plus `IMAGES.md` and the `images` list in `site.json` |

All copy is written so a beginner can swap it without touching the logic.

## Forms

Every form is a **demo**. Submitting it does not send an email. `public/js/site.js` validates the fields, ignores a hidden honeypot, and writes a thank-you note with `textContent` (never `innerHTML`).

To accept real inquiries:

1. Create a [Formspree](https://formspree.io) form, or a small HTTPS endpoint you host yourself (better if you want to stay off third-party SaaS).
2. Set the form’s `action` to that URL and `method="POST"` in `src/components/ContactForm.astro`.
3. Adjust or remove the `data-demo-form` handler in `public/js/site.js`.
4. Serve the site over HTTPS.

Do not put API keys or secrets in this project. Do not collect passwords, payment details, or (for the dental starter) health information through these forms.

## Security

- No secrets in the frontend.
- User input is never written with `innerHTML`.
- Links to the built assets are relative, so the site is ready for HTTPS and will not mix in third-party scripts.
- `public/_headers` holds a sample Content-Security-Policy for hosts that understand that file (for example Netlify). There is also a commented CSP in the layout.
- Prefer a privacy-respecting map link (OpenStreetMap is used here) over a live Google Maps embed unless the client asks for one.

## Photos

See [IMAGES.md](IMAGES.md). All photos are from Unsplash or Pexels and are free for commercial use, with photographer credits in the footer.

## License of this example

This folder is an example you can copy and modify for client work. The photographs remain under their original Unsplash or Pexels licenses. Astro is MIT licensed.

src/data/site.json

Start here. Business name, colors, hours, copy, and image credits.

{
  "folder": "04-auto-repair",
  "kind": "Auto repair",
  "name": "Summit Auto Care",
  "shortName": "Summit Auto",
  "monogram": "SA",
  "tagline": "Honest work on everyday cars",
  "description": "Example auto-repair website with a service estimator and an appointment request form.",
  "phone": "(555) 010-1404",
  "phoneHref": "tel:+15550101404",
  "email": "service@summitautocare.example",
  "address": {
    "street": "220 Ridge Highway",
    "city": "Example Bay",
    "state": "CA",
    "zip": "00000",
    "osm": "https://www.openstreetmap.org/search?query=Example%20Bay"
  },
  "hours": [
    {
      "days": "Monday \u2013 Friday",
      "time": "8:00 am \u2013 6:00 pm"
    },
    {
      "days": "Saturday",
      "time": "8:00 am \u2013 2:00 pm"
    },
    {
      "days": "Sunday",
      "time": "Closed"
    }
  ],
  "theme": {
    "bg": "#121417",
    "fg": "#f3f4f6",
    "primary": "#c81e1e",
    "primaryText": "#ffffff",
    "accent": "#f5b301",
    "muted": "#b0b6be",
    "card": "#1b1f24",
    "border": "#2c3239",
    "headerBg": "#0e1012",
    "fontDisplay": "'Segoe UI', system-ui, sans-serif",
    "fontBody": "'Segoe UI', system-ui, sans-serif",
    "radius": "8px",
    "colorScheme": "dark"
  },
  "nav": [
    {
      "label": "Home",
      "page": "index"
    },
    {
      "label": "Services",
      "page": "services"
    },
    {
      "label": "Estimator",
      "page": "estimator"
    },
    {
      "label": "About",
      "page": "about"
    },
    {
      "label": "Source",
      "page": "source"
    }
  ],
  "headerCta": {
    "label": "Book service",
    "page": "estimator"
  },
  "hero": {
    "variant": "full",
    "flip": false,
    "image": "images/hero-headlights.jpg",
    "imageAlt": "Close view of a car\u2019s headlights and grille",
    "eyebrow": "Example auto shop starter",
    "title": "Fix it once. Explain it plainly.",
    "lead": "A fictional independent shop for maintenance, brakes, tires, and diagnostics.",
    "primaryCta": {
      "label": "Estimate a service",
      "page": "estimator"
    },
    "secondaryCta": {
      "label": "See services",
      "page": "services"
    }
  },
  "intro": {
    "title": "A bay you can actually reach",
    "text": "Auto shops convert when a visitor can tell what you do, what it might cost, and how to get on the schedule. The estimator is labeled as an example so it never looks like an invoice.",
    "image": "images/shop.jpg",
    "imageAlt": "Work in progress in an auto shop"
  },
  "servicesEyebrow": "In the bays",
  "servicesTitle": "Common services",
  "servicesLead": "Keep these short on the home page. The estimator page is where the numbers live.",
  "services": [
    {
      "name": "Oil and filter",
      "blurb": "Regular oil service, fluid checks, and a quick walk-around.",
      "price": "Example from $69"
    },
    {
      "name": "Brakes",
      "blurb": "Pads, rotors, and a straight conversation about what can wait.",
      "price": "By vehicle"
    },
    {
      "name": "Tires",
      "blurb": "Mount, balance, rotation, and puncture repair.",
      "price": "By tire"
    },
    {
      "name": "Diagnostics",
      "blurb": "When a light is on and the guesswork should stop.",
      "price": "Flat fee"
    },
    {
      "name": "Inspection",
      "blurb": "A listed pre-trip or annual once-over.",
      "price": "Flat fee"
    },
    {
      "name": "Scheduled maintenance",
      "blurb": "The factory interval, without the dealership wait.",
      "price": "By vehicle"
    }
  ],
  "estimator": {
    "title": "Build an example total",
    "lead": "Select a vehicle type and the work you think you need. This is a list-price demo, not a quote.",
    "disclaimer": "Parts, taxes, shop fees, and surprise findings are not included. A written estimate comes after we see the car.",
    "vehicles": [
      {
        "id": "compact",
        "label": "Compact or sedan",
        "multiplier": 1
      },
      {
        "id": "suv",
        "label": "SUV or crossover",
        "multiplier": 1.15
      },
      {
        "id": "truck",
        "label": "Truck or van",
        "multiplier": 1.25
      }
    ],
    "services": [
      {
        "label": "Oil and filter",
        "cost": 69,
        "priceLabel": "$69"
      },
      {
        "label": "Brake pads (axle)",
        "cost": 249,
        "priceLabel": "$249"
      },
      {
        "label": "Tire rotation",
        "cost": 40,
        "priceLabel": "$40"
      },
      {
        "label": "Alignment",
        "cost": 129,
        "priceLabel": "$129"
      },
      {
        "label": "Diagnostic hour",
        "cost": 149,
        "priceLabel": "$149"
      },
      {
        "label": "Vehicle inspection",
        "cost": 89,
        "priceLabel": "$89"
      }
    ]
  },
  "galleryEyebrow": "The shop",
  "galleryTitle": "Around the bays",
  "galleryLead": "Example vehicles and shop scenes. Replace with the client\u2019s own space if they want it shown.",
  "gallery": [
    {
      "file": "images/shop.jpg",
      "alt": "Work in progress in an auto shop"
    },
    {
      "file": "images/bay.jpg",
      "alt": "Two cars parked in a garage with yellow doors"
    },
    {
      "file": "images/silver-car.jpg",
      "alt": "Silver car in motion on a wet road"
    },
    {
      "file": "images/classic.jpg",
      "alt": "Vintage car photographed up close"
    },
    {
      "file": "images/green-car.jpg",
      "alt": "Classic green car at the curb"
    },
    {
      "file": "images/dashboard.jpg",
      "alt": "View from a vehicle dashboard on the road"
    },
    {
      "file": "images/truck.jpg",
      "alt": "Yellow work truck in an open lot"
    }
  ],
  "testimonials": [
    {
      "name": "Leo Grant",
      "role": "Sedan owner (example)",
      "quote": "They called before they replaced anything I had not already approved."
    },
    {
      "name": "Nora Kim",
      "role": "Fleet manager (example)",
      "quote": "Two vans in the morning, both back before lunch, notes on the invoice."
    },
    {
      "name": "Hassan Ali",
      "role": "Pickup owner (example)",
      "quote": "The estimator was close enough that I was not bracing for a surprise."
    }
  ],
  "cta": {
    "title": "Get the car on the schedule",
    "lead": "Request a drop-off window. The form is a demo until you connect an endpoint.",
    "label": "Request an appointment",
    "page": "estimator"
  },
  "about": {
    "title": "Independent on purpose",
    "pageDescription": "About the fictional Summit Auto Care shop.",
    "paragraphs": [
      "This starter is for independent repair shops that want to look as steady as they are \u2014 dark, clear, and easy to call from a phone.",
      "Certifications and warranties should be the shop\u2019s real ones. Leave them off until you have the wording they stand behind."
    ],
    "image": "images/bay.jpg",
    "imageAlt": "Two cars parked in a garage with yellow doors",
    "id": "about"
  },
  "stats": [
    {
      "value": "4",
      "label": "Example service bays"
    },
    {
      "value": "Same day",
      "label": "Many maintenance visits"
    },
    {
      "value": "ASE",
      "label": "Add real credentials later"
    }
  ],
  "teamTitle": "People",
  "teamLead": "",
  "team": [],
  "contactPage": {
    "id": "estimator",
    "eyebrow": "Appointments",
    "title": "Request a drop-off",
    "lead": "Use the estimator for a ballpark, then ask for a time. Nothing is booked by this demo form.",
    "formHeading": "Service appointment",
    "formIntro": "Year, make, and a short description of the concern are enough.",
    "submitLabel": "Request appointment",
    "showService": true,
    "serviceLabel": "Main need",
    "serviceOptions": [
      "Oil and filter",
      "Brakes",
      "Tires",
      "Diagnostics",
      "Inspection",
      "Scheduled maintenance"
    ],
    "showDate": true,
    "extraNote": "Estimator totals are examples, not invoices.",
    "warning": ""
  },
  "faqTitle": "FAQ",
  "faqLead": "",
  "faqs": [],
  "images": [
    {
      "file": "images/hero-headlights.jpg",
      "photographer": "Mike Bird",
      "source": "https://www.pexels.com/photo/120049/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Close view of a car\u2019s headlights and grille"
    },
    {
      "file": "images/shop.jpg",
      "photographer": "Katya Alagich",
      "source": "https://www.pexels.com/photo/3807333/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Work in progress in an auto shop"
    },
    {
      "file": "images/bay.jpg",
      "photographer": "Dietmar Becker",
      "source": "https://unsplash.com/photos/8Zt0xOOK4nI",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Two cars parked in a garage with yellow doors"
    },
    {
      "file": "images/silver-car.jpg",
      "photographer": "Zugr",
      "source": "https://unsplash.com/photos/yZf1quatKCA",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Silver car in motion on a wet road"
    },
    {
      "file": "images/classic.jpg",
      "photographer": "Eric Micheal",
      "source": "https://unsplash.com/photos/C4FV77ovIBM",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Vintage car photographed up close"
    },
    {
      "file": "images/green-car.jpg",
      "photographer": "Sean Stratton",
      "source": "https://unsplash.com/photos/3I5j50pIXvU",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Classic green car at the curb"
    },
    {
      "file": "images/dashboard.jpg",
      "photographer": "Nick Turner",
      "source": "https://unsplash.com/photos/0EjvnhOkPLM",
      "license": "Unsplash License (free for commercial use)",
      "alt": "View from a vehicle dashboard on the road"
    },
    {
      "file": "images/truck.jpg",
      "photographer": "jamie mink",
      "source": "https://unsplash.com/photos/5Qwz2KyfIBE",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Yellow work truck in an open lot"
    }
  ]
}

src/utils/paths.ts

Helpers so links work in dev and in the built dist/ folder.

/**
 * Helpers so links work both in `npm run dev` and in the built `dist/` folder.
 * After the post-build rewrite, production links are document-relative (./menu.html).
 */
export function pageHref(page: string): string {
  const name = page.replace(/^\//, "").replace(/\.html$/, "");
  const file = !name || name === "index" ? "index.html" : `${name}.html`;
  return import.meta.env.DEV ? `/${file}` : `./${file}`;
}

export function asset(path: string): string {
  const clean = path.replace(/^\//, "");
  return import.meta.env.DEV ? `/${clean}` : `./${clean}`;
}

Astro layouts and components

Reusable pieces. Each file has a front-matter comment describing what to edit.

src/components/ContactForm.astro

Demo form. Does not send data until you add an endpoint.

---
/**
 * Demo contact / booking / inquiry form.
 *
 * Nothing is sent. The submit handler in public/js/site.js only validates
 * and shows a thank-you message (via textContent, never innerHTML).
 *
 * To accept real messages:
 *  1. Create a Formspree form (https://formspree.io) or a small HTTPS
 *     endpoint you host yourself (recommended if you want to stay off
 *     third-party SaaS).
 *  2. Set this form's action to that URL and method="POST".
 *  3. Remove data-demo-form, or keep it and adjust the JS so a successful
 *     native submit can proceed.
 *  4. Serve the site over HTTPS.
 * Do not put API keys in this file or any other frontend file.
 */
interface Props {
  heading?: string;
  intro?: string;
  submitLabel?: string;
  showService?: boolean;
  serviceLabel?: string;
  serviceOptions?: string[];
  showDate?: boolean;
  extraNote?: string;
}
const {
  heading = 'Get in touch',
  intro = 'This is a demo form. Submissions stay in your browser until you connect an endpoint.',
  submitLabel = 'Send message',
  showService = false,
  serviceLabel = 'Interested in',
  serviceOptions = [],
  showDate = false,
  extraNote,
} = Astro.props;
---
<form class="card" data-demo-form novalidate>
  <h2>{heading}</h2>
  <p class="form-note">{intro}</p>

  <!-- Honeypot: hidden from people, filled by some bots. Must stay empty. -->
  <div class="hp" aria-hidden="true">
    <label>
      Company website
      <input type="text" name="company_website" tabindex="-1" autocomplete="off" />
    </label>
  </div>

  <label>
    Name
    <input type="text" name="name" required maxlength="80" autocomplete="name" />
  </label>
  <label>
    Email
    <input type="email" name="email" required maxlength="120" autocomplete="email" />
  </label>
  <label>
    Phone
    <input type="tel" name="phone" maxlength="40" autocomplete="tel" />
  </label>
  {showService && serviceOptions.length > 0 && (
    <label>
      {serviceLabel}
      <select name="service">
        {serviceOptions.map((opt) => <option value={opt}>{opt}</option>)}
      </select>
    </label>
  )}
  {showDate && (
    <label>
      Preferred date
      <input type="date" name="preferred_date" />
    </label>
  )}
  <label>
    Message
    <textarea name="message" required maxlength="2000"></textarea>
  </label>
  {extraNote && <p class="form-note">{extraNote}</p>}
  <button type="submit" class="btn">{submitLabel}</button>
  <p class="form-status" data-form-status role="status"></p>
</form>

src/components/CtaBand.astro

Full-width closing call to action.

---
/** Full-width call to action. Copy comes from site.cta. */
import site from '../data/site.json';
import { pageHref } from '../utils/paths';
const cta = site.cta;
---
<section class="section section--primary" id="cta">
  <div class="wrap split">
    <div>
      <h2>{cta.title}</h2>
      <p>{cta.lead}</p>
    </div>
    <div class="btn-row">
      <a class="btn btn--light" href={pageHref(cta.page)}>{cta.label}</a>
      <a class="btn btn--ghost" href={site.phoneHref} style="color:inherit;border-color:currentColor">
        Call {site.phone}
      </a>
    </div>
  </div>
</section>

src/components/Header.astro

Logo, navigation, and the mobile menu button.

---
/**
 * Site header: logo, navigation from site.json, phone/booking CTA, mobile menu.
 * Mark the current page with the `current` prop so aria-current is set.
 */
import site from '../data/site.json';
import { pageHref } from '../utils/paths';

interface Props { current?: string; }
const { current = 'index' } = Astro.props;
---
<header class="site-header" data-header>
  <div class="wrap header-inner">
    <a class="logo" href={pageHref('index')}>
      <span class="logo-mark" aria-hidden="true">{site.monogram}</span>
      <span>{site.shortName}</span>
    </a>
    <button
      type="button"
      class="nav-toggle"
      data-nav-toggle
      aria-expanded="false"
      aria-controls="site-nav"
    >
      <span class="sr-only">Menu</span>
      <span class="nav-toggle-bar"></span>
      <span class="nav-toggle-bar"></span>
      <span class="nav-toggle-bar"></span>
    </button>
    <nav class="site-nav" id="site-nav" aria-label="Primary">
      <ul class="nav-list">
        {site.nav.map((item) => (
          <li>
            <a
              href={pageHref(item.page)}
              aria-current={item.page === current ? 'page' : undefined}
            >
              {item.label}
            </a>
          </li>
        ))}
        <li>
          <a class="btn header-cta" href={pageHref(site.headerCta.page)}>
            {site.headerCta.label}
          </a>
        </li>
      </ul>
    </nav>
  </div>
</header>

src/components/Hero.astro

Top-of-page band. Layout variant is set in site.json.

---
/**
 * Hero band. The variant (full, split, or stack) and all copy live in site.json.
 */
import site from '../data/site.json';
import { pageHref, asset } from '../utils/paths';

const hero = site.hero;
const variant = hero.variant || 'split';
---
<section class={`hero hero--${variant}`} aria-label="Introduction">
  {variant === 'full' && (
    <div class="hero-media" aria-hidden="true">
      <img src={asset(hero.image)} alt="" />
    </div>
  )}
  <div class="wrap">
    {variant !== 'full' ? (
      <div class={`split ${variant === 'split' && hero.flip ? 'split--flip' : ''}`}>
        <div class="hero-copy">
          {hero.eyebrow && <p class="eyebrow">{hero.eyebrow}</p>}
          <h1>{hero.title}</h1>
          <p class="lead">{hero.lead}</p>
          <div class="btn-row">
            <a class="btn" href={pageHref(hero.primaryCta.page)}>{hero.primaryCta.label}</a>
            {hero.secondaryCta && (
              <a class="btn btn--ghost" href={pageHref(hero.secondaryCta.page)}>
                {hero.secondaryCta.label}
              </a>
            )}
          </div>
        </div>
        <div class="hero-media media">
          <img src={asset(hero.image)} alt={hero.imageAlt} />
        </div>
      </div>
    ) : (
      <div class="hero-copy">
        {hero.eyebrow && <p class="eyebrow">{hero.eyebrow}</p>}
        <h1>{hero.title}</h1>
        <p class="lead">{hero.lead}</p>
        <div class="btn-row">
          <a class="btn btn--light" href={pageHref(hero.primaryCta.page)}>{hero.primaryCta.label}</a>
          {hero.secondaryCta && (
            <a class="btn btn--ghost" href={pageHref(hero.secondaryCta.page)} style="color:#fff;border-color:rgba(255,255,255,.5)">
              {hero.secondaryCta.label}
            </a>
          )}
        </div>
      </div>
    )}
  </div>
</section>

src/components/ServiceEstimator.astro

Project file included so the source page stays complete.

---
/** Auto shop service estimator. Totals are example list prices from site.estimator. */
import site from '../data/site.json';
---
<section class="section section--alt" id="estimator">
  <div class="wrap split">
    <div>
      <p class="eyebrow">Example estimate</p>
      <h2>{site.estimator.title}</h2>
      <p class="lead">{site.estimator.lead}</p>
      <p class="form-note">{site.estimator.disclaimer}</p>
    </div>
    <form class="card" data-estimator onsubmit="return false;">
      <label>
        Vehicle type
        <select name="vehicle">
          {site.estimator.vehicles.map((v) => (
            <option value={v.id} data-multiplier={v.multiplier}>{v.label}</option>
          ))}
        </select>
      </label>
      <fieldset>
        <legend>Services</legend>
        {site.estimator.services.map((s) => (
          <label style="font-weight:500;display:flex;gap:0.5rem;align-items:center;">
            <input type="checkbox" data-cost={s.cost} />
            {s.label} ({s.priceLabel})
          </label>
        ))}
      </fieldset>
      <p class="meta">Example total</p>
      <p class="estimate" data-estimate>—</p>
      <p class="form-note">Parts, taxes, and shop fees are not included. This is not an invoice.</p>
    </form>
  </div>
</section>

src/components/Services.astro

Project file included so the source page stays complete.

---
/** Service / offer cards from site.services. Swap the copy in site.json. */
import site from '../data/site.json';
---
<section class="section" id="services">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">{site.servicesEyebrow}</p>
      <h2>{site.servicesTitle}</h2>
      <p class="lead">{site.servicesLead}</p>
    </div>
    <div class="grid grid-3">
      {site.services.map((s) => (
        <article class="card">
          <h3>{s.name}</h3>
          <p>{s.blurb}</p>
          {s.price && <p class="price">{s.price}</p>}
        </article>
      ))}
    </div>
  </div>
</section>

src/components/Testimonials.astro

Quote cards fed by site.testimonials.

---
/** Pull quotes from site.testimonials. Easy to add, edit, or remove. */
import site from '../data/site.json';
---
<section class="section section--alt" id="testimonials">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">Kind words</p>
      <h2>What clients say</h2>
      <p class="lead">Fictional reviews for this example site — replace them with real permissioned testimonials.</p>
    </div>
    <div class="grid grid-3">
      {site.testimonials.map((t) => (
        <figure class="card">
          <blockquote>
            <p>“{t.quote}”</p>
          </blockquote>
          <figcaption>
            <strong>{t.name}</strong>
            <div class="meta">{t.role}</div>
          </figcaption>
        </figure>
      ))}
    </div>
  </div>
</section>

src/layouts/BaseLayout.astro

HTML shell, meta tags, theme variables, and script tags.

---
/**
 * HTML shell for every page.
 * Theme colors and fonts are read from src/data/site.json and applied
 * as CSS variables. Change that file to re-skin the site.
 */
import '../styles/global.css';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';

interface Props {
  title?: string;
  description?: string;
  page?: string;
}

const { title, description, page = 'index' } = Astro.props;
const pageTitle = title
  ? `${title} · ${site.name}`
  : `${site.name} · ${site.tagline}`;

/** Only allow safe theme values through to the style attribute. */
function themeStyle(theme: Record<string, string>): string {
  const map: Record<string, string> = {
    bg: '--bg',
    fg: '--fg',
    primary: '--primary',
    primaryText: '--primary-text',
    accent: '--accent',
    muted: '--muted',
    card: '--card',
    border: '--border',
    headerBg: '--header-bg',
    fontDisplay: '--font-display',
    fontBody: '--font-body',
    radius: '--radius',
  };
  const parts: string[] = [];
  for (const [key, cssVar] of Object.entries(map)) {
    const value = theme[key];
    if (!value) continue;
    if (key.startsWith('font')) {
      if (!/^[A-Za-z0-9"'\s,\-]+$/.test(value)) continue;
    } else if (key === 'radius') {
      if (!/^\d+(\.\d+)?(px|rem)$/.test(value)) continue;
    } else if (!/^#([0-9a-fA-F]{3,8})$/.test(value)) {
      continue;
    }
    parts.push(`${cssVar}: ${value}`);
  }
  return parts.join('; ');
}

const scheme = site.theme.colorScheme === 'dark' ? 'dark' : 'light';
---
<!doctype html>
<html lang="en" data-theme={scheme} style={themeStyle(site.theme as Record<string, string>)}>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content={description ?? site.description} />
    <meta name="color-scheme" content={scheme} />
    <!-- Fictional example: hide from search engines until you replace the copy. -->
    <meta name="robots" content="noindex, nofollow" />
    <title>{pageTitle}</title>
    <link rel="icon" href={asset('favicon.svg')} type="image/svg+xml" />
    <!--
      Sample Content-Security-Policy for an HTTPS deploy.
      Uncomment the meta tag, or use public/_headers on Netlify / similar.
      style-src includes 'unsafe-inline' because theme variables are set on <html>
      and small critical CSS may be inlined by Astro.

      default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline';
      script-src 'self'; font-src 'self'; connect-src 'self'; form-action 'self';
      base-uri 'self'; object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests
    -->
  </head>
  <body>
    <a class="skip-link" href="#main">Skip to content</a>
    <div class="example-banner">
      Example website for demonstration only. Not a real business.
    </div>
    <Header current={page} />
    <main id="main">
      <slot />
    </main>
    <Footer />
    <script src={asset('js/site.js')} defer></script>
    <script src={asset('js/features.js')} defer></script>
  </body>
</html>

Pages

One file per URL. After `npm run build` these compile to HTML in dist/.

src/pages/about.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';

const aboutId = site.about.id || 'about';
---
<BaseLayout page={aboutId} title={site.about.title} description={site.about.pageDescription}>
  <section class="section">
    <div class="wrap split">
      <div>
        <p class="eyebrow">About</p>
        <h1>{site.about.title}</h1>
        {site.about.paragraphs.map((text) => <p>{text}</p>)}
        {site.stats && site.stats.length > 0 && (
          <div class="stat-row">
            {site.stats.map((s) => (
              <div>
                <strong>{s.value}</strong>
                <span class="meta">{s.label}</span>
              </div>
            ))}
          </div>
        )}
      </div>
      <div class="media">
        <img src={asset(site.about.image)} alt={site.about.imageAlt} />
      </div>
    </div>
  </section>
  {site.team && site.team.length > 0 && (
    <section class="section section--alt" id="team">
      <div class="wrap">
        <div class="section-head">
          <p class="eyebrow">People</p>
          <h2>{site.teamTitle}</h2>
          <p class="lead">{site.teamLead}</p>
        </div>
        <div class="grid grid-3">
          {site.team.map((person) => (
            <article class="card">
              {person.image && (
                <div class="media" style="margin: -1.25rem -1.25rem 1rem; border: 0; border-radius: var(--radius) var(--radius) 0 0;">
                  <img src={asset(person.image)} alt={person.imageAlt || person.name} style="height: 16rem;" />
                </div>
              )}
              <h3>{person.name}</h3>
              <p class="meta">{person.role}</p>
              <p>{person.bio}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  )}
  <CtaBand />
</BaseLayout>

src/pages/estimator.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import ContactForm from '../components/ContactForm.astro';
import ServiceEstimator from '../components/ServiceEstimator.astro';
import site from '../data/site.json';
---
<BaseLayout page="estimator" title={site.contactPage.title} description={site.contactPage.lead}>
  <ServiceEstimator />
  <section class="section">
    <div class="wrap split">
      <div>
        <p class="eyebrow">{site.contactPage.eyebrow}</p>
        <h1>{site.contactPage.title}</h1>
        <p class="lead">{site.contactPage.lead}</p>
        <p>
          <a href={site.phoneHref}>{site.phone}</a><br />
          <a href={`mailto:${site.email}`}>{site.email}</a>
        </p>
        <p>
          {site.address.street}<br />
          {site.address.city}, {site.address.state} {site.address.zip}
        </p>
        {site.contactPage.warning && <p class="form-note">{site.contactPage.warning}</p>}
      </div>
      <ContactForm
        heading={site.contactPage.formHeading}
        intro={site.contactPage.formIntro}
        submitLabel={site.contactPage.submitLabel}
        showService={site.contactPage.showService}
        serviceLabel={site.contactPage.serviceLabel}
        serviceOptions={site.contactPage.serviceOptions}
        showDate={site.contactPage.showDate}
        extraNote={site.contactPage.extraNote}
      />
    </div>
  </section>
</BaseLayout>

src/pages/index.astro

Home page. Compose or rearrange sections here.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import Hero from '../components/Hero.astro';
import Services from '../components/Services.astro';
import Gallery from '../components/Gallery.astro';
import Testimonials from '../components/Testimonials.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
import { asset } from '../utils/paths';
import ServiceEstimator from '../components/ServiceEstimator.astro';
---
<BaseLayout page="index">
  <Hero />

  <section class="section" id="intro">
    <div class="wrap split">
      <div>
        <p class="eyebrow">Welcome</p>
        <h2>{site.intro.title}</h2>
        <p>{site.intro.text}</p>
      </div>
      <div class="media">
        <img src={asset(site.intro.image)} alt={site.intro.imageAlt} />
      </div>
    </div>
  </section>

  <Services />

  <ServiceEstimator />

  {site.team && site.team.length > 0 && (
    <section class="section" id="people">
      <div class="wrap">
        <div class="section-head">
          <p class="eyebrow">People</p>
          <h2>{site.teamTitle}</h2>
          <p class="lead">{site.teamLead}</p>
        </div>
        <div class="grid grid-3">
          {site.team.slice(0, 3).map((person) => (
            <article class="card">
              <h3>{person.name}</h3>
              <p class="meta">{person.role}</p>
              <p>{person.bio}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  )}

  <Gallery />
  <Testimonials />
  <CtaBand />
</BaseLayout>

src/pages/services.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import Services from '../components/Services.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
---
<BaseLayout page="services" title="Services" description={site.servicesLead}>
  <Services />
  <CtaBand />
</BaseLayout>

src/pages/source.astro

This page. Built at compile time from the files on disk.

---
/**
 * /source — shows this site's code, grouped by type, generated at build time.
 * Short notes explain what each major file is for. Edit the map below if you
 * add files. The contents themselves come from import.meta.glob(?raw), so
 * they stay in sync with the project.
 */
import BaseLayout from '../layouts/BaseLayout.astro';
import site from '../data/site.json';
import sourcePage from './source.astro?raw';

const discovered = import.meta.glob(
  [
    '../**/*.{astro,css,js,ts,json}',
    '../../public/js/site.js',
    '../../public/js/features.js',
    '../../public/_headers',
    '../../astro.config.mjs',
    '../../package.json',
    '../../README.md',
    '../../IMAGES.md',
  ],
  { query: '?raw', import: 'default', eager: true }
);

type Entry = { path: string; code: string; note: string };

const notes: Record<string, string> = {
  'src/data/site.json': 'Start here. Business name, colors, hours, copy, and image credits.',
  'src/layouts/BaseLayout.astro': 'HTML shell, meta tags, theme variables, and script tags.',
  'src/components/Header.astro': 'Logo, navigation, and the mobile menu button.',
  'src/components/Footer.astro': 'Contact, hours, and required photo attribution.',
  'src/components/Hero.astro': 'Top-of-page band. Layout variant is set in site.json.',
  'src/components/Testimonials.astro': 'Quote cards fed by site.testimonials.',
  'src/components/CtaBand.astro': 'Full-width closing call to action.',
  'src/components/ContactForm.astro': 'Demo form. Does not send data until you add an endpoint.',
  'src/styles/global.css': 'Shared typography, layout, forms, gallery, and components.',
  'src/utils/paths.ts': 'Helpers so links work in dev and in the built dist/ folder.',
  'src/pages/index.astro': 'Home page. Compose or rearrange sections here.',
  'src/pages/source.astro': 'This page. Built at compile time from the files on disk.',
  'public/js/site.js': 'Shared vanilla JS: menu, forms, accordion, lightbox, filters.',
  'public/js/features.js': 'Interactive features unique to this starter.',
  'public/_headers': 'Sample Content-Security-Policy for hosts like Netlify.',
  'astro.config.mjs': 'Astro is set to a static build with one HTML file per page.',
  'package.json': 'npm scripts: dev, build, preview. The only runtime dependency is Astro.',
  'README.md': 'How to run, customize, and hook up a real form or payment provider.',
  'IMAGES.md': 'Photographer credits and source URLs for every image.',
};

function normalize(raw: string): string {
  if (raw.startsWith('../../public/')) return raw.slice(6); // public/...
  if (raw.startsWith('../../')) return raw.slice(6);
  if (raw.startsWith('../')) return 'src/' + raw.slice(3);
  if (raw.startsWith('./')) return 'src/pages/' + raw.slice(2);
  return raw;
}

const files: Entry[] = Object.entries(discovered).map(([rawPath, code]) => {
  const path = normalize(rawPath);
  return {
    path,
    code: String(code),
    note: notes[path] || 'Project file included so the source page stays complete.',
  };
});

// import.meta.glob often skips the file that contains the glob. Add it by hand.
if (!files.some((f) => f.path.endsWith('pages/source.astro'))) {
  files.push({
    path: 'src/pages/source.astro',
    code: String(sourcePage),
    note: notes['src/pages/source.astro'],
  });
}

files.sort((a, b) => a.path.localeCompare(b.path));

const groups: { id: string; title: string; blurb: string; match: (p: string) => boolean }[] = [
  {
    id: 'config',
    title: 'Config and data',
    blurb: 'The knobs you will turn first: business details, package scripts, and Astro settings.',
    match: (p) =>
      p.endsWith('site.json') ||
      p.endsWith('package.json') ||
      p.endsWith('astro.config.mjs') ||
      p.endsWith('README.md') ||
      p.endsWith('IMAGES.md') ||
      p.endsWith('_headers') ||
      p.endsWith('paths.ts'),
  },
  {
    id: 'astro-components',
    title: 'Astro layouts and components',
    blurb: 'Reusable pieces. Each file has a front-matter comment describing what to edit.',
    match: (p) => p.endsWith('.astro') && !p.includes('/pages/'),
  },
  {
    id: 'pages',
    title: 'Pages',
    blurb: 'One file per URL. After `npm run build` these compile to HTML in dist/.',
    match: (p) => p.includes('/pages/') && p.endsWith('.astro'),
  },
  {
    id: 'css',
    title: 'CSS',
    blurb: 'One global stylesheet, themed with CSS variables from site.json.',
    match: (p) => p.endsWith('.css'),
  },
  {
    id: 'js',
    title: 'JavaScript',
    blurb: 'Classic scripts (not modules) so built pages can also run from a simple static server.',
    match: (p) => p.endsWith('.js') && p.startsWith('public/'),
  },
];

function groupFiles(g: (typeof groups)[number]): Entry[] {
  return files.filter((f) => g.match(f.path));
}
---
<BaseLayout
  page="source"
  title="Source"
  description={`Browse the full source for the ${site.name} example site.`}
>
  <section class="section">
    <div class="wrap">
      <p class="eyebrow">Source</p>
      <h1>How this site is built</h1>
      <p class="lead">
        Everything below is the live project source, captured when the site was built.
        After you edit a file, run <code>npm run dev</code> or <code>npm run build</code> to see the change.
        Compiled HTML (the files in <code>dist/</code>) is also loaded below when you are viewing this
        page over http:// or https://.
      </p>
    </div>
  </section>

  <section class="section section--alt">
    <div class="wrap source-layout">
      <nav class="source-nav" aria-label="Source sections">
        {groups.map((g) => (
          <a href={`#${g.id}`}>{g.title}</a>
        ))}
        <a href="#compiled-html">Compiled HTML</a>
      </nav>
      <div>
        {groups.map((g) => (
          <div id={g.id}>
            <h2>{g.title}</h2>
            <p class="lead">{g.blurb}</p>
            {groupFiles(g).map((f) => (
              <article class="source-file" id={f.path.replace(/[^\w]+/g, '-')}>
                <header>
                  <h3><code>{f.path}</code></h3>
                  <p class="meta">{f.note}</p>
                </header>
                <pre><code>{f.code}</code></pre>
              </article>
            ))}
          </div>
        ))}

        <div id="compiled-html">
          <h2>Compiled HTML</h2>
          <p class="lead">
            Astro turns the <code>.astro</code> pages into static HTML at build time.
            If you are viewing this page from a local static server (not a raw file:// URL),
            the built homepage is fetched and shown below. You can also open
            <code>dist/index.html</code> in a text editor after <code>npm run build</code>.
          </p>
          <article class="source-file">
            <header>
              <h3><code>dist/index.html</code></h3>
              <p class="meta">Loaded in the browser when possible. This is output, not the file you edit.</p>
            </header>
            <pre><code data-compiled-html>Open this page via npm run preview (or another static server) to load compiled HTML here.</code></pre>
          </article>
        </div>
      </div>
    </div>
  </section>
</BaseLayout>

CSS

One global stylesheet, themed with CSS variables from site.json.

src/styles/global.css

Shared typography, layout, forms, gallery, and components.

/* ========================================================================
   Shared starter styles
   -----------------------------------------------------------------------
   Colors, fonts, and radius come from src/data/site.json, injected as
   CSS variables on <html> by BaseLayout.astro. Edit that file first.
   You can still override anything below.

   No webfonts are loaded (privacy and performance). Display and body
   stacks use system fonts defined in the theme.
   ======================================================================== */

/* --- Reset-ish base --------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Fallbacks in case a theme variable is missing */
  --bg: #f6f3ee;
  --fg: #1c1917;
  --primary: #9a3412;
  --primary-text: #fff;
  --accent: #b45309;
  --muted: #57534e;
  --card: #ffffff;
  --border: #e7e0d6;
  --header-bg: #fffdf9;
  --font-display: Georgia, "Iowan Old Style", Palatino, "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
  --max: 70rem;
  --gutter: clamp(1rem, 3vw, 1.75rem);
  background: var(--bg);
  color: var(--fg);
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

/* Skip link appears on keyboard focus */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.5rem 0.8rem;
  border-radius: 0.4rem;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

/* Demo notice so nobody mistakes these for real businesses */
.example-banner {
  background: var(--fg);
  color: var(--bg);
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.45rem var(--gutter);
}
.example-banner a { color: inherit; }

/* --- Layout ----------------------------------------------------------- */
.wrap {
  width: min(var(--max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

main { flex: 1 0 auto; }

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.section--alt { background: color-mix(in srgb, var(--card) 80%, var(--bg)); }
.section--primary {
  background: var(--primary);
  color: var(--primary-text);
}
.section--primary a { color: var(--primary-text); }

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.lead { font-size: 1.15rem; color: var(--muted); }

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.split {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 800px) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
  .split--flip { grid-template-columns: 0.9fr 1.1fr; }
  .split--flip > :first-child { order: 2; }
}

/* --- Header / nav ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--header-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.logo:hover { color: var(--primary); }
.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 700;
}

.nav-list {
  display: flex;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-list a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.15rem;
}
.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--primary); }
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }

.header-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.4rem 0.55rem;
  color: var(--fg);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  margin: 0.25rem 0;
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 0.75rem var(--gutter) 1rem;
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list a { display: block; padding: 0.55rem 0; }
  .header-cta { margin: 0.5rem 0 0; display: block; text-align: center; }
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-text);
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); color: var(--primary-text); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn--light {
  background: var(--card);
  color: var(--fg);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* --- Cards, chips, media ---------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card h3 { margin-bottom: 0.35em; }

.media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.media img { width: 100%; height: 100%; object-fit: cover; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip, .filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.filter-btn.is-active,
.chip--on {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.price {
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.muted, .meta { color: var(--muted); font-size: 0.92rem; }

/* --- Hero variants ---------------------------------------------------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  align-items: center;
}
.hero--full {
  min-height: 80vh;
  color: #fff;
}
.hero--full .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero--full .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero--full .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55)),
    linear-gradient(90deg, rgba(0,0,0,0.45), rgba(0,0,0,0.15));
}
.hero--full .hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 10vw, 8rem) 0;
  max-width: 38rem;
}
.hero--full .eyebrow,
.hero--full .lead { color: rgba(255,255,255,0.86); }
.hero--full h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); color: #fff; }

.hero--split { padding: clamp(2rem, 5vw, 4rem) 0; }
.hero--split h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero--stack { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.hero--stack .hero-media { margin-top: 1.5rem; max-height: 28rem; }

/* --- Forms ------------------------------------------------------------ */
form { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  font: inherit;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  min-height: 1.4em;
  font-weight: 600;
  color: var(--primary);
}
.form-note { font-size: 0.85rem; color: var(--muted); }

/* --- FAQ accordion ---------------------------------------------------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  color: var(--fg);
  padding: 1rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item button::after {
  content: "+";
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
}
.faq-item button[aria-expanded="true"]::after { content: "–"; }
.faq-panel { padding: 0 0 1rem; color: var(--muted); }

/* --- Gallery + lightbox ----------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}
.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
}
.gallery img { width: 100%; height: 14rem; object-fit: cover; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: none;
  place-items: center;
  z-index: 80;
  padding: 1.5rem;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.5rem;
}
.lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 0.75rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1.2rem;
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; }
.lightbox-next { right: 1rem; top: 50%; }

/* --- Tables, hours, lists --------------------------------------------- */
.hours { list-style: none; padding: 0; margin: 0; }
.hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* --- Footer ----------------------------------------------------------- */
.site-footer {
  background: color-mix(in srgb, var(--fg) 94%, var(--primary));
  color: color-mix(in srgb, var(--bg) 90%, white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
[data-theme="dark"] .site-footer {
  background: color-mix(in srgb, var(--card) 40%, #000);
}
.site-footer a { color: inherit; }
.footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-bottom: 2rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}
.credits { font-size: 0.82rem; opacity: 0.9; }
.credits ul { padding-left: 1.1rem; margin: 0.4rem 0 0; }

/* --- Source page ------------------------------------------------------ */
.source-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .source-layout { grid-template-columns: 16rem 1fr; align-items: start; }
}
.source-nav {
  position: sticky;
  top: 5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.source-nav a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}
.source-file {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.source-file header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--card));
}
.source-file h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.source-file pre {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.45;
  background: #161311;
  color: #f3ece6;
  max-height: 32rem;
}
[data-theme="dark"] .source-file pre { background: #0b0b0c; }
.copy-btn { margin-top: 0.4rem; }

/* --- Feature-specific bits -------------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
}
.menu-item, .listing-card, .product-card, .class-row { transition: opacity 0.2s; }
.is-hidden { display: none !important; }

.estimate {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0.4rem 0;
}
.sandbox-flag {
  display: inline-block;
  background: var(--accent);
  color: #111;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
}

.cart-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--card);
}
.metronome {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}
.metronome-pulse {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.metronome-pulse.is-on { background: var(--primary); color: var(--primary-text); }

.membership-card.is-featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

JavaScript

Classic scripts (not modules) so built pages can also run from a simple static server.

public/js/features.js

Interactive features unique to this starter.

/**
 * Example auto-service total. Costs come from data-cost attributes.
 * Written to the page with textContent only.
 */
(function () {
  "use strict";

  var form = document.querySelector("[data-estimator]");
  if (!form) return;

  function selectedOption(select) {
    var i = select.selectedIndex;
    return i >= 0 ? select.options[i] : null;
  }

  function run() {
    var vehicle = form.querySelector("[name='vehicle']");
    var out = form.querySelector("[data-estimate]");
    if (!vehicle || !out) return;
    var opt = selectedOption(vehicle);
    var multiplier = opt ? Number(opt.getAttribute("data-multiplier") || 1) : 1;
    var total = 0;
    var any = false;
    form.querySelectorAll("[data-cost]:checked").forEach(function (cb) {
      any = true;
      total += Number(cb.getAttribute("data-cost") || 0) * multiplier;
    });
    if (!any) {
      out.textContent = "Select one or more services.";
      return;
    }
    out.textContent = "$" + Math.round(total).toLocaleString("en-US");
  }

  form.addEventListener("input", run);
  form.addEventListener("change", run);
  run();
})();

public/js/site.js

Shared vanilla JS: menu, forms, accordion, lightbox, filters.

/**
 * Shared front-end behavior for the starter sites.
 *
 * Security notes:
 * - Never assign user input to innerHTML. Status messages use textContent.
 * - Forms do not send data anywhere until you hook up an endpoint
 *   (see the form's comments and the README).
 * - No API keys or secrets belong in this file.
 */
(function () {
  "use strict";

  function ready(fn) {
    if (document.readyState === "loading") {
      document.addEventListener("DOMContentLoaded", fn);
    } else {
      fn();
    }
  }

  ready(function () {
    initYear();
    initHeader();
    initMobileNav();
    initForms();
    initAccordion();
    initLightbox();
    initFilters();
    initCompiledHtml();
  });

  function initYear() {
    var nodes = document.querySelectorAll("[data-year]");
    var year = String(new Date().getFullYear());
    nodes.forEach(function (el) {
      el.textContent = year;
    });
  }

  function initHeader() {
    var header = document.querySelector("[data-header]");
    if (!header) return;
    var onScroll = function () {
      header.classList.toggle("is-scrolled", window.scrollY > 8);
    };
    onScroll();
    window.addEventListener("scroll", onScroll, { passive: true });
  }

  function initMobileNav() {
    var toggle = document.querySelector("[data-nav-toggle]");
    var nav = document.querySelector("#site-nav");
    if (!toggle || !nav) return;

    var close = function () {
      nav.classList.remove("is-open");
      toggle.setAttribute("aria-expanded", "false");
    };
    var open = function () {
      nav.classList.add("is-open");
      toggle.setAttribute("aria-expanded", "true");
    };

    toggle.addEventListener("click", function () {
      if (nav.classList.contains("is-open")) close();
      else open();
    });
    document.addEventListener("keydown", function (e) {
      if (e.key === "Escape") close();
    });
    nav.querySelectorAll("a").forEach(function (link) {
      link.addEventListener("click", close);
    });
  }

  /**
   * Demo forms: validate, ignore honeypot spam, and show a thank-you
   * message without submitting anywhere.
   *
   * To go live, set the form's action to a Formspree (or similar) URL
   * or to your own HTTPS endpoint, remove the preventDefault submit
   * handler below (or only preventDefault when the honeypot is filled),
   * and serve the site over HTTPS.
   */
  function initForms() {
    document.querySelectorAll("form[data-demo-form]").forEach(function (form) {
      form.addEventListener("submit", function (e) {
        e.preventDefault();

        var honeypot = form.querySelector("[name='company_website']");
        if (honeypot && honeypot.value) {
          return;
        }

        if (typeof form.reportValidity === "function" && !form.checkValidity()) {
          form.reportValidity();
          return;
        }

        var status = form.querySelector("[data-form-status]");
        var rawName = "";
        var nameField = form.querySelector("[name='name']");
        if (nameField && nameField.value) {
          rawName = String(nameField.value).slice(0, 80);
        }
        var message =
          "Thanks" +
          (rawName ? ", " + rawName : "") +
          ". This is a demo form — nothing was sent. Connect Formspree or your own endpoint to accept real inquiries. See the README.";
        if (status) {
          status.textContent = message;
        }
        form.reset();
      });
    });
  }

  function initAccordion() {
    document.querySelectorAll("[data-accordion]").forEach(function (root) {
      root.querySelectorAll("button[aria-controls]").forEach(function (btn) {
        var panel = document.getElementById(btn.getAttribute("aria-controls"));
        if (!panel) return;
        btn.addEventListener("click", function () {
          var open = btn.getAttribute("aria-expanded") === "true";
          btn.setAttribute("aria-expanded", open ? "false" : "true");
          if (open) {
            panel.setAttribute("hidden", "");
          } else {
            panel.removeAttribute("hidden");
          }
        });
      });
    });
  }

  function initLightbox() {
    var buttons = Array.prototype.slice.call(
      document.querySelectorAll("[data-lightbox]")
    );
    if (!buttons.length) return;

    var dialog = document.createElement("div");
    dialog.className = "lightbox";
    dialog.setAttribute("role", "dialog");
    dialog.setAttribute("aria-modal", "true");
    dialog.setAttribute("hidden", "");

    var img = document.createElement("img");
    img.alt = "";
    var caption = document.createElement("p");
    caption.className = "lightbox-caption";
    var closeBtn = document.createElement("button");
    closeBtn.type = "button";
    closeBtn.className = "lightbox-close";
    closeBtn.setAttribute("aria-label", "Close image");
    closeBtn.textContent = "×";
    var prevBtn = document.createElement("button");
    prevBtn.type = "button";
    prevBtn.className = "lightbox-prev";
    prevBtn.setAttribute("aria-label", "Previous image");
    prevBtn.textContent = "‹";
    var nextBtn = document.createElement("button");
    nextBtn.type = "button";
    nextBtn.className = "lightbox-next";
    nextBtn.setAttribute("aria-label", "Next image");
    nextBtn.textContent = "›";

    var frame = document.createElement("div");
    frame.appendChild(img);
    frame.appendChild(caption);
    dialog.appendChild(closeBtn);
    dialog.appendChild(prevBtn);
    dialog.appendChild(nextBtn);
    dialog.appendChild(frame);
    document.body.appendChild(dialog);

    var index = 0;

    function show(i) {
      index = (i + buttons.length) % buttons.length;
      var btn = buttons[index];
      var src = btn.getAttribute("data-src") || "";
      var alt = btn.getAttribute("data-alt") || "";
      img.src = src;
      img.alt = alt;
      caption.textContent = alt;
      dialog.classList.add("is-open");
      dialog.removeAttribute("hidden");
      closeBtn.focus();
    }

    function hide() {
      dialog.classList.remove("is-open");
      dialog.setAttribute("hidden", "");
      img.removeAttribute("src");
    }

    buttons.forEach(function (btn, i) {
      btn.addEventListener("click", function () {
        show(i);
      });
    });
    closeBtn.addEventListener("click", hide);
    prevBtn.addEventListener("click", function () { show(index - 1); });
    nextBtn.addEventListener("click", function () { show(index + 1); });
    dialog.addEventListener("click", function (e) {
      if (e.target === dialog) hide();
    });
    document.addEventListener("keydown", function (e) {
      if (!dialog.classList.contains("is-open")) return;
      if (e.key === "Escape") hide();
      if (e.key === "ArrowLeft") show(index - 1);
      if (e.key === "ArrowRight") show(index + 1);
    });
  }

  /**
   * Generic filter: buttons with [data-filter] and [data-filter-group]
   * hide siblings of the group that don't match a data-* attribute.
   * Used by menus, class lists, product grids, and listings.
   */
  function initFilters() {
    document.querySelectorAll("[data-filter-group]").forEach(function (group) {
      var targetSel = group.getAttribute("data-filter-target");
      if (!targetSel) return;
      var items = document.querySelectorAll(targetSel);
      var buttons = group.querySelectorAll("[data-filter]");

      buttons.forEach(function (btn) {
        btn.addEventListener("click", function () {
          buttons.forEach(function (b) {
            b.classList.remove("is-active");
            b.setAttribute("aria-pressed", "false");
          });
          btn.classList.add("is-active");
          btn.setAttribute("aria-pressed", "true");
          var key = btn.getAttribute("data-filter-key") || "category";
          var value = btn.getAttribute("data-filter") || "all";
          items.forEach(function (item) {
            var hay = (item.getAttribute("data-" + key) || "").toLowerCase();
            var show = value === "all" || hay.indexOf(value.toLowerCase()) !== -1;
            item.classList.toggle("is-hidden", !show);
          });
        });
      });
    });
  }
  /**
   * On the source page, try to fetch the compiled homepage HTML when we are
   * served over HTTP(S). The result is shown with textContent only.
   */
  function initCompiledHtml() {
    var slot = document.querySelector("[data-compiled-html]");
    if (!slot) return;
    if (location.protocol !== "http:" && location.protocol !== "https:") return;
    fetch("index.html")
      .then(function (res) {
        if (!res.ok) throw new Error("Could not load index.html");
        return res.text();
      })
      .then(function (text) {
        slot.textContent = text;
      })
      .catch(function () {
        slot.textContent =
          "Compiled HTML could not be loaded. Open dist/index.html after npm run build.";
      });
  }

})();

Compiled HTML

Astro turns the .astro pages into static HTML at build time. If you are viewing this page from a local static server (not a raw file:// URL), the built homepage is fetched and shown below. You can also opendist/index.html in a text editor after npm run build.

dist/index.html

Loaded in the browser when possible. This is output, not the file you edit.

Open this page via npm run preview (or another static server) to load compiled HTML here.