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 — Willow & Wren

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-stylist.jpg` | Anna Avilova | https://www.pexels.com/photo/3993324/ | Pexels License (free for commercial use) |
| `images/consultation.jpg` | Anna Avilova | https://www.pexels.com/photo/3993320/ | Pexels License (free for commercial use) |
| `images/blowout.jpg` | engin akyurt | https://www.pexels.com/photo/3065171/ | Pexels License (free for commercial use) |
| `images/cut.jpg` | engin akyurt | https://www.pexels.com/photo/3065209/ | Pexels License (free for commercial use) |
| `images/detail.jpg` | Anna Avilova | https://www.pexels.com/photo/3738087/ | Pexels License (free for commercial use) |
| `images/wash.jpg` | Anna Avilova | https://www.pexels.com/photo/3993449/ | Pexels License (free for commercial use) |
| `images/tools.jpg` | Anna Avilova | https://www.pexels.com/photo/3992874/ | Pexels License (free for commercial use) |
| `images/scissors.jpg` | Anna Avilova | https://www.pexels.com/photo/3992866/ | Pexels License (free for commercial use) |
| `images/barber.jpg` | Alex Staudinger | https://www.pexels.com/photo/1732414/ | Pexels License (free for commercial use) |
| `images/fade.jpg` | ZVOLSKIY DMITRY | https://www.pexels.com/photo/1805600/ | Pexels License (free for commercial use) |
| `images/shears-wall.jpg` | NICK DEMOU | https://www.pexels.com/photo/1319460/ | Pexels License (free for commercial use) |
| `images/portrait.jpg` | Anna Avilova | https://www.pexels.com/photo/3993445/ | Pexels 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-02-salon",
  "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.

# Willow & Wren

Example **Salon / barber** 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 gallery opens in a lightbox. Booking is a request form, not a live calendar.

## 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": "02-salon",
  "kind": "Salon / barber",
  "name": "Willow & Wren",
  "shortName": "Willow & Wren",
  "monogram": "WW",
  "tagline": "Hair, color, and a calm chair",
  "description": "Example salon website with services, a gallery lightbox, and a booking request form.",
  "phone": "(555) 010-1402",
  "phoneHref": "tel:+15550101402",
  "email": "desk@willowandwren.example",
  "address": {
    "street": "44 Lark Street",
    "city": "Example Bay",
    "state": "CA",
    "zip": "00000",
    "osm": "https://www.openstreetmap.org/search?query=Example%20Bay"
  },
  "hours": [
    {
      "days": "Tuesday \u2013 Friday",
      "time": "10:00 am \u2013 7:00 pm"
    },
    {
      "days": "Saturday",
      "time": "9:00 am \u2013 5:00 pm"
    },
    {
      "days": "Sunday \u2013 Monday",
      "time": "Closed"
    }
  ],
  "theme": {
    "bg": "#faf7f5",
    "fg": "#2a2422",
    "primary": "#7a4052",
    "primaryText": "#ffffff",
    "accent": "#a67c52",
    "muted": "#6b615c",
    "card": "#ffffff",
    "border": "#eadfd8",
    "headerBg": "#fffdfc",
    "fontDisplay": "Palatino, 'Palatino Linotype', Georgia, serif",
    "fontBody": "'Segoe UI', system-ui, sans-serif",
    "radius": "20px",
    "colorScheme": "light"
  },
  "nav": [
    {
      "label": "Home",
      "page": "index"
    },
    {
      "label": "Services",
      "page": "services"
    },
    {
      "label": "Gallery",
      "page": "gallery"
    },
    {
      "label": "Book",
      "page": "book"
    },
    {
      "label": "Source",
      "page": "source"
    }
  ],
  "headerCta": {
    "label": "Book a chair",
    "page": "book"
  },
  "hero": {
    "variant": "split",
    "flip": false,
    "image": "images/hero-stylist.jpg",
    "imageAlt": "Stylist in an apron working in a salon",
    "eyebrow": "Example salon starter",
    "title": "A quieter kind of appointment.",
    "lead": "Cuts, color, and barbering in a small fictional studio on Lark Street.",
    "primaryCta": {
      "label": "Book now",
      "page": "book"
    },
    "secondaryCta": {
      "label": "See services",
      "page": "services"
    }
  },
  "intro": {
    "title": "Two chairs, plenty of time",
    "text": "Willow & Wren is a starter for salons and barbershops. The booking form is a request, not a live calendar, so you can show a client how the site will feel before paying for scheduling software.",
    "image": "images/consultation.jpg",
    "imageAlt": "Stylist consulting with a client"
  },
  "servicesEyebrow": "The menu",
  "servicesTitle": "Services and example prices",
  "servicesLead": "Replace these with the real list and you have a services page ready to print or share.",
  "services": [
    {
      "name": "Cut and style",
      "blurb": "A consult, a cut, and a finish that lasts past the front door.",
      "price": "from $65"
    },
    {
      "name": "Color",
      "blurb": "Gloss, lived-in color, or a full reset \u2014 noted on the request form.",
      "price": "from $120"
    },
    {
      "name": "Barbering",
      "blurb": "Precise cuts and beard work in the same calm room.",
      "price": "from $45"
    },
    {
      "name": "Blowout",
      "blurb": "A wash and a style when you already like your cut.",
      "price": "from $45"
    },
    {
      "name": "Treatment",
      "blurb": "A deep condition or gloss midweek.",
      "price": "from $40"
    },
    {
      "name": "First visit",
      "blurb": "A longer first appointment so we can talk before the scissors come out.",
      "price": "+15 min"
    }
  ],
  "galleryEyebrow": "Work",
  "galleryTitle": "In the chair",
  "galleryLead": "Example photos only. A client gallery should use photos you have permission to publish.",
  "gallery": [
    {
      "file": "images/blowout.jpg",
      "alt": "Stylist blow-drying a client\u2019s hair"
    },
    {
      "file": "images/cut.jpg",
      "alt": "Haircut in progress at a salon chair"
    },
    {
      "file": "images/detail.jpg",
      "alt": "Close work on a client\u2019s hair"
    },
    {
      "file": "images/wash.jpg",
      "alt": "Hair washing at a salon basin"
    },
    {
      "file": "images/barber.jpg",
      "alt": "Barber giving a precise haircut"
    },
    {
      "file": "images/fade.jpg",
      "alt": "Barber refining a short cut"
    },
    {
      "file": "images/tools.jpg",
      "alt": "Professional shears on a dark surface"
    },
    {
      "file": "images/portrait.jpg",
      "alt": "Portrait of a stylist in the salon"
    }
  ],
  "testimonials": [
    {
      "name": "Elena Ruiz",
      "role": "Color client (example)",
      "quote": "They talked through the color like it was a plan, not a surprise."
    },
    {
      "name": "Jordan Blake",
      "role": "Barbering client (example)",
      "quote": "A quiet chair, a sharp fade, and I was out in time for lunch."
    },
    {
      "name": "Samita Rao",
      "role": "First visit (example)",
      "quote": "The longer first appointment made the rest of the year easy."
    }
  ],
  "cta": {
    "title": "Ready for a chair?",
    "lead": "Request a time. A live salon can later add a calendar tool if they want self-booking.",
    "label": "Book a chair",
    "page": "book"
  },
  "about": {
    "title": "A small studio on Lark Street",
    "pageDescription": "About the fictional Willow & Wren salon.",
    "paragraphs": [
      "This starter is for hair salons, color studios, and barbershops that need a calm site with a clear next step.",
      "The people below are invented. When you use this for a client, use their names, their bios, and photos they have approved."
    ],
    "image": "images/shears-wall.jpg",
    "imageAlt": "Row of professional shears hanging in a studio",
    "id": "about"
  },
  "stats": [
    {
      "value": "3",
      "label": "Example stylists"
    },
    {
      "value": "2",
      "label": "Chairs in the room"
    },
    {
      "value": "Tue\u2013Sat",
      "label": "Open days"
    }
  ],
  "teamTitle": "The chair team",
  "teamLead": "Fictional stylists so the layout has faces. Replace before any client use.",
  "team": [
    {
      "name": "Wren Alden",
      "role": "Cut and color",
      "bio": "Leads the color work and the longer first visits.",
      "image": "images/portrait.jpg",
      "imageAlt": "Portrait of a stylist in the salon"
    },
    {
      "name": "Miles Calder",
      "role": "Barbering",
      "bio": "Handles short cuts, fades, and beard work.",
      "image": "images/barber.jpg",
      "imageAlt": "Barber giving a precise haircut"
    },
    {
      "name": "Ivy Cho",
      "role": "Style and treatments",
      "bio": "Blowouts, glosses, and midweek maintenance.",
      "image": "images/consultation.jpg",
      "imageAlt": "Stylist consulting with a client"
    }
  ],
  "contactPage": {
    "id": "book",
    "eyebrow": "Booking",
    "title": "Request an appointment",
    "lead": "Demo form only. Nothing is booked until you connect a real endpoint or calendar.",
    "formHeading": "Appointment request",
    "formIntro": "Prefer a stylist, or leave it open and we will match the service.",
    "submitLabel": "Request a time",
    "showService": true,
    "serviceLabel": "Service",
    "serviceOptions": [
      "Cut and style",
      "Color",
      "Barbering",
      "Blowout",
      "Treatment",
      "First visit"
    ],
    "showDate": true,
    "extraNote": "A live shop might use Square Appointments, Vagaro, or a self-hosted calendar later.",
    "warning": ""
  },
  "faqTitle": "FAQ",
  "faqLead": "",
  "faqs": [],
  "images": [
    {
      "file": "images/hero-stylist.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3993324/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Stylist in an apron working in a salon"
    },
    {
      "file": "images/consultation.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3993320/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Stylist consulting with a client"
    },
    {
      "file": "images/blowout.jpg",
      "photographer": "engin akyurt",
      "source": "https://www.pexels.com/photo/3065171/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Stylist blow-drying a client\u2019s hair"
    },
    {
      "file": "images/cut.jpg",
      "photographer": "engin akyurt",
      "source": "https://www.pexels.com/photo/3065209/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Haircut in progress at a salon chair"
    },
    {
      "file": "images/detail.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3738087/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Close work on a client\u2019s hair"
    },
    {
      "file": "images/wash.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3993449/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Hair washing at a salon basin"
    },
    {
      "file": "images/tools.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3992874/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Professional shears on a dark surface"
    },
    {
      "file": "images/scissors.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3992866/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Salon shears and styling tools"
    },
    {
      "file": "images/barber.jpg",
      "photographer": "Alex Staudinger",
      "source": "https://www.pexels.com/photo/1732414/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Barber giving a precise haircut"
    },
    {
      "file": "images/fade.jpg",
      "photographer": "ZVOLSKIY DMITRY",
      "source": "https://www.pexels.com/photo/1805600/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Barber refining a short cut"
    },
    {
      "file": "images/shears-wall.jpg",
      "photographer": "NICK DEMOU",
      "source": "https://www.pexels.com/photo/1319460/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Row of professional shears hanging in a studio"
    },
    {
      "file": "images/portrait.jpg",
      "photographer": "Anna Avilova",
      "source": "https://www.pexels.com/photo/3993445/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Portrait of a stylist in the salon"
    }
  ]
}

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/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/book.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import ContactForm from '../components/ContactForm.astro';
import site from '../data/site.json';
---
<BaseLayout page={site.contactPage.id} title={site.contactPage.title} description={site.contactPage.lead}>
  <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>
        <p>
          <a href={site.address.osm} rel="noopener noreferrer">View map on OpenStreetMap</a>
        </p>
        <h2>Hours</h2>
        <ul class="hours">
          {site.hours.map((row) => (
            <li><span>{row.days}</span><span>{row.time}</span></li>
          ))}
        </ul>
        {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';
---
<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 />


  {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.

/**
 * Site-specific interactivity lives here.
 * Shared behavior (navigation, forms, accordion, lightbox, filters)
 * is already handled in site.js.
 *
 * This starter does not need extra scripts. Add your own below.
 */
(function () {
  "use strict";
})();

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.