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 — Cedar & Cloth

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-shop.jpg` | Artem Beliaikin | https://www.pexels.com/photo/994523/ | Pexels License (free for commercial use) |
| `images/rack.jpg` | Artem Beliaikin | https://www.pexels.com/photo/994517/ | Pexels License (free for commercial use) |
| `images/flatlay.jpg` | Artem Beliaikin | https://www.pexels.com/photo/994521/ | Pexels License (free for commercial use) |
| `images/shoes.jpg` | Terje Sollie | https://www.pexels.com/photo/298863/ | Pexels License (free for commercial use) |
| `images/look.jpg` | CMI | https://www.pexels.com/photo/1926769/ | Pexels License (free for commercial use) |
| `images/heel.jpg` | Alejandro Escamilla | https://unsplash.com/photos/jVb0mSn0LbE | Unsplash License (free for commercial use) |
| `images/studio-rack.jpg` | Clark Street Mercantile | https://unsplash.com/photos/vC-GqGbakJo | Unsplash License (free for commercial use) |
| `images/table.jpg` | Aleks Dorohovich | https://unsplash.com/photos/nJdwUHmaY8A | 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-07-boutique",
  "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.

# Cedar & Cloth

Example **Retail boutique** 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.

Filter the catalog and use the sandbox cart. Checkout will not charge anyone. See “Payments” below before taking real orders.

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

## Payments (placeholders only)

This starter does **not** process payments. The checkout or join buttons show a sandbox message on purpose.

A real integration (for example [Stripe Checkout](https://stripe.com/docs/payments/checkout)) would typically require:

1. A Stripe account and a secret key that lives only on a server (never in this frontend repo).
2. An HTTPS-hosted function or small backend that creates a Checkout Session and returns a URL.
3. A success and cancel page, plus webhook handling for fulfillment.
4. Tax, inventory, and refund rules you have actually agreed with the client.

Until then, keep the sandbox labels visible so nobody thinks a payment went through.

## 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": "07-boutique",
  "kind": "Retail boutique",
  "name": "Cedar & Cloth",
  "shortName": "Cedar & Cloth",
  "monogram": "CC",
  "tagline": "A small shop of clothes and quiet objects",
  "description": "Example boutique website with a filterable catalog and a sandbox cart. No real payments.",
  "phone": "(555) 010-1407",
  "phoneHref": "tel:+15550101407",
  "email": "shop@cedarandcloth.example",
  "address": {
    "street": "8 Orchard Lane",
    "city": "Example Bay",
    "state": "CA",
    "zip": "00000",
    "osm": "https://www.openstreetmap.org/search?query=Example%20Bay"
  },
  "hours": [
    {
      "days": "Wednesday \u2013 Friday",
      "time": "11:00 am \u2013 6:00 pm"
    },
    {
      "days": "Saturday",
      "time": "10:00 am \u2013 5:00 pm"
    },
    {
      "days": "Sunday",
      "time": "11:00 am \u2013 4:00 pm"
    },
    {
      "days": "Monday \u2013 Tuesday",
      "time": "Closed"
    }
  ],
  "theme": {
    "bg": "#f8f4ef",
    "fg": "#2c241c",
    "primary": "#3d4f3f",
    "primaryText": "#ffffff",
    "accent": "#8c5a3c",
    "muted": "#6a5e54",
    "card": "#fffaf5",
    "border": "#e6ddd2",
    "headerBg": "#fffdf9",
    "fontDisplay": "Georgia, Palatino, serif",
    "fontBody": "'Segoe UI', system-ui, sans-serif",
    "radius": "2px",
    "colorScheme": "light"
  },
  "nav": [
    {
      "label": "Home",
      "page": "index"
    },
    {
      "label": "Shop",
      "page": "shop"
    },
    {
      "label": "Lookbook",
      "page": "lookbook"
    },
    {
      "label": "Visit",
      "page": "contact"
    },
    {
      "label": "Source",
      "page": "source"
    }
  ],
  "headerCta": {
    "label": "Shop the floor",
    "page": "shop"
  },
  "hero": {
    "variant": "full",
    "flip": false,
    "image": "images/hero-shop.jpg",
    "imageAlt": "Clothing and accessories arranged in a boutique",
    "eyebrow": "Example boutique starter",
    "title": "Fewer things, chosen slowly.",
    "lead": "A fictional shop of garments, shoes, and small objects. The cart is a sandbox and never takes payment.",
    "primaryCta": {
      "label": "Browse the shop",
      "page": "shop"
    },
    "secondaryCta": {
      "label": "Visit us",
      "page": "contact"
    }
  },
  "intro": {
    "title": "A room you can browse twice",
    "text": "Retail starters need a catalog, not just a mood. The shop page filters by category; the cart stays on the page and is clearly marked as a demo. A real store would later add inventory and a payment provider \u2014 see the README.",
    "image": "images/rack.jpg",
    "imageAlt": "Garments hanging on a retail rack"
  },
  "servicesEyebrow": "In the shop",
  "servicesTitle": "What you\u2019ll find",
  "servicesLead": "Short category stories. Individual pieces live on the Shop page.",
  "services": [
    {
      "name": "Apparel",
      "blurb": "A short rack of coats, knits, and everyday layers.",
      "price": ""
    },
    {
      "name": "Shoes",
      "blurb": "A few pairs at a time, in sizes we actually keep.",
      "price": ""
    },
    {
      "name": "Home objects",
      "blurb": "Small things for a table or a shelf.",
      "price": ""
    }
  ],
  "shopTitle": "The floor",
  "shopLead": "Fictional products and prices. Use the filters, add a piece to the sandbox cart, and try checkout \u2014 nothing is charged.",
  "productFilters": [
    {
      "label": "All",
      "value": "all"
    },
    {
      "label": "Apparel",
      "value": "Apparel"
    },
    {
      "label": "Shoes",
      "value": "Shoes"
    },
    {
      "label": "Home",
      "value": "Home"
    }
  ],
  "products": [
    {
      "sku": "coat-01",
      "name": "Orchard coat",
      "category": "Apparel",
      "price": 248,
      "blurb": "A straight coat with deep pockets.",
      "image": "images/look.jpg",
      "imageAlt": "Model in a long coat, standing in soft light"
    },
    {
      "sku": "knit-01",
      "name": "Harbor knit",
      "category": "Apparel",
      "price": 128,
      "blurb": "A heavy cotton pullover.",
      "image": "images/flatlay.jpg",
      "imageAlt": "Fashion flat lay with clothes and small props"
    },
    {
      "sku": "rack-01",
      "name": "Cedar shirt",
      "category": "Apparel",
      "price": 88,
      "blurb": "A soft shirt meant to be worn often.",
      "image": "images/rack.jpg",
      "imageAlt": "Garments hanging on a retail rack"
    },
    {
      "sku": "shoe-01",
      "name": "Lane oxford",
      "category": "Shoes",
      "price": 210,
      "blurb": "A polished leather pair.",
      "image": "images/shoes.jpg",
      "imageAlt": "Pair of polished leather shoes"
    },
    {
      "sku": "shoe-02",
      "name": "Studio heel",
      "category": "Shoes",
      "price": 176,
      "blurb": "A simple heel for late daylight.",
      "image": "images/heel.jpg",
      "imageAlt": "White high-heeled shoe on a dark surface"
    },
    {
      "sku": "home-01",
      "name": "Table story",
      "category": "Home",
      "price": 42,
      "blurb": "A small object for a tabletop.",
      "image": "images/table.jpg",
      "imageAlt": "Styled tabletop with magazines and small objects"
    },
    {
      "sku": "home-02",
      "name": "Shelf piece",
      "category": "Home",
      "price": 36,
      "blurb": "Something quiet for a shelf.",
      "image": "images/studio-rack.jpg",
      "imageAlt": "Clothing hanging in a studio with a work table"
    },
    {
      "sku": "coat-02",
      "name": "Shop apron",
      "category": "Apparel",
      "price": 54,
      "blurb": "A canvas apron from the workroom.",
      "image": "images/hero-shop.jpg",
      "imageAlt": "Clothing and accessories arranged in a boutique"
    }
  ],
  "galleryEyebrow": "Lookbook",
  "galleryTitle": "How it wears",
  "galleryLead": "Example lookbook photographs. Click to enlarge.",
  "gallery": [
    {
      "file": "images/look.jpg",
      "alt": "Model in a long coat, standing in soft light"
    },
    {
      "file": "images/hero-shop.jpg",
      "alt": "Clothing and accessories arranged in a boutique"
    },
    {
      "file": "images/rack.jpg",
      "alt": "Garments hanging on a retail rack"
    },
    {
      "file": "images/flatlay.jpg",
      "alt": "Fashion flat lay with clothes and small props"
    },
    {
      "file": "images/shoes.jpg",
      "alt": "Pair of polished leather shoes"
    },
    {
      "file": "images/heel.jpg",
      "alt": "White high-heeled shoe on a dark surface"
    },
    {
      "file": "images/studio-rack.jpg",
      "alt": "Clothing hanging in a studio with a work table"
    },
    {
      "file": "images/table.jpg",
      "alt": "Styled tabletop with magazines and small objects"
    }
  ],
  "testimonials": [
    {
      "name": "Adele Moreau",
      "role": "Regular (example)",
      "quote": "I leave with one thing, not a bag of maybes."
    },
    {
      "name": "Tom Esser",
      "role": "Gift buyer (example)",
      "quote": "They wrapped a small object as if it already had a history."
    },
    {
      "name": "Nia Brooks",
      "role": "First visit (example)",
      "quote": "The shop is small on purpose. That is the point."
    }
  ],
  "cta": {
    "title": "Come in and try it on",
    "lead": "Hours are on the visit page. The cart on this site will not charge you.",
    "label": "Plan a visit",
    "page": "contact"
  },
  "about": {
    "title": "A shop the size of a front room",
    "pageDescription": "About the fictional Cedar & Cloth boutique.",
    "paragraphs": [
      "This starter is for independent retailers who want a catalog and a visit page without standing up a full Shopify build on day one.",
      "When you are ready to take money, the README lists what a real Stripe (or similar) integration would require. Do not hide a fake checkout as if it were live."
    ],
    "image": "images/studio-rack.jpg",
    "imageAlt": "Clothing hanging in a studio with a work table",
    "id": "about"
  },
  "stats": [
    {
      "value": "8",
      "label": "Example pieces on the floor"
    },
    {
      "value": "Wed\u2013Sun",
      "label": "Open days"
    },
    {
      "value": "0",
      "label": "Real charges on this demo"
    }
  ],
  "teamTitle": "People",
  "teamLead": "",
  "team": [],
  "contactPage": {
    "id": "contact",
    "eyebrow": "Visit",
    "title": "The shop on Orchard Lane",
    "lead": "Come in during the hours below, or write with a question. The online cart is a sandbox.",
    "formHeading": "A note to the shop",
    "formIntro": "Sizing questions, holds, or a time you plan to visit.",
    "submitLabel": "Send note",
    "showService": true,
    "serviceLabel": "About",
    "serviceOptions": [
      "A piece on the floor",
      "Sizing",
      "A visit",
      "Something else"
    ],
    "showDate": false,
    "extraNote": "Online checkout is a sandbox. In-store payment would be handled at the counter.",
    "warning": ""
  },
  "faqTitle": "FAQ",
  "faqLead": "",
  "faqs": [],
  "images": [
    {
      "file": "images/hero-shop.jpg",
      "photographer": "Artem Beliaikin",
      "source": "https://www.pexels.com/photo/994523/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Clothing and accessories arranged in a boutique"
    },
    {
      "file": "images/rack.jpg",
      "photographer": "Artem Beliaikin",
      "source": "https://www.pexels.com/photo/994517/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Garments hanging on a retail rack"
    },
    {
      "file": "images/flatlay.jpg",
      "photographer": "Artem Beliaikin",
      "source": "https://www.pexels.com/photo/994521/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Fashion flat lay with clothes and small props"
    },
    {
      "file": "images/shoes.jpg",
      "photographer": "Terje Sollie",
      "source": "https://www.pexels.com/photo/298863/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Pair of polished leather shoes"
    },
    {
      "file": "images/look.jpg",
      "photographer": "CMI",
      "source": "https://www.pexels.com/photo/1926769/",
      "license": "Pexels License (free for commercial use)",
      "alt": "Model in a long coat, standing in soft light"
    },
    {
      "file": "images/heel.jpg",
      "photographer": "Alejandro Escamilla",
      "source": "https://unsplash.com/photos/jVb0mSn0LbE",
      "license": "Unsplash License (free for commercial use)",
      "alt": "White high-heeled shoe on a dark surface"
    },
    {
      "file": "images/studio-rack.jpg",
      "photographer": "Clark Street Mercantile",
      "source": "https://unsplash.com/photos/vC-GqGbakJo",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Clothing hanging in a studio with a work table"
    },
    {
      "file": "images/table.jpg",
      "photographer": "Aleks Dorohovich",
      "source": "https://unsplash.com/photos/nJdwUHmaY8A",
      "license": "Unsplash License (free for commercial use)",
      "alt": "Styled tabletop with magazines and small objects"
    }
  ]
}

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

Project file included so the source page stays complete.

---
/** Filterable catalog. Add-to-cart buttons are handled in features.js (sandbox only). */
import site from '../data/site.json';
import { asset } from '../utils/paths';
---
<section class="section" id="shop">
  <div class="wrap">
    <div class="section-head">
      <p class="eyebrow">Shop</p>
      <h2>{site.shopTitle}</h2>
      <p class="lead">{site.shopLead}</p>
      <p><span class="sandbox-flag">Sandbox cart</span> <span class="meta">No real payments are processed.</span></p>
    </div>
    <div class="chip-row" data-filter-group data-filter-target="#product-list .product-card" style="margin-bottom:1rem;">
      {site.productFilters.map((f, i) => (
        <button type="button" class:list={['filter-btn', { 'is-active': i === 0 }]} data-filter={f.value} data-filter-key="category" aria-pressed={i === 0 ? 'true' : 'false'}>
          {f.label}
        </button>
      ))}
    </div>
    <div id="product-list" class="grid grid-3">
      {site.products.map((p) => (
        <article class="product-card card" data-category={p.category}>
          <div class="media" style="margin: -1.25rem -1.25rem 1rem; border:0; border-radius: var(--radius) var(--radius) 0 0;">
            <img src={asset(p.image)} alt={p.imageAlt} style="height: 16rem;" />
          </div>
          <h3>{p.name}</h3>
          <p class="meta">{p.category}</p>
          <p>{p.blurb}</p>
          <p class="price">${p.price.toFixed(2)}</p>
          <button
            type="button"
            class="btn"
            data-add-cart
            data-sku={p.sku}
            data-name={p.name}
            data-price={p.price}
          >
            Add to cart
          </button>
        </article>
      ))}
    </div>
    <aside class="cart-panel" style="margin-top: 2rem;" data-cart>
      <h3>Your cart <span class="sandbox-flag">Demo</span></h3>
      <div data-cart-lines>
        <p class="meta">Your cart is empty.</p>
      </div>
      <p class="estimate" data-cart-total></p>
      <button type="button" class="btn" data-checkout>Checkout (sandbox)</button>
      <p class="form-status" data-cart-status role="status"></p>
    </aside>
  </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/contact.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/lookbook.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import Gallery from '../components/Gallery.astro';
import CtaBand from '../components/CtaBand.astro';
import site from '../data/site.json';
---
<BaseLayout page="lookbook" title="Lookbook" description={site.galleryLead}>
  <Gallery />
  <CtaBand />
</BaseLayout>

src/pages/shop.astro

Project file included so the source page stays complete.

---
import BaseLayout from '../layouts/BaseLayout.astro';
import ProductGrid from '../components/ProductGrid.astro';
import site from '../data/site.json';
---
<BaseLayout page="shop" title="Shop" description={site.shopLead}>
  <ProductGrid />
</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.

/**
 * Sandbox shopping cart. Items are kept in memory only.
 * Lines are drawn with createElement / textContent, never innerHTML.
 * Checkout does not connect to Stripe or any other processor.
 */
(function () {
  "use strict";

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

  var linesBox = root.querySelector("[data-cart-lines]");
  var totalBox = root.querySelector("[data-cart-total]");
  var status = root.querySelector("[data-cart-status]");
  var cart = [];

  function money(n) {
    return "$" + n.toFixed(2);
  }

  function render() {
    while (linesBox.firstChild) linesBox.removeChild(linesBox.firstChild);
    if (!cart.length) {
      var empty = document.createElement("p");
      empty.className = "meta";
      empty.textContent = "Your cart is empty.";
      linesBox.appendChild(empty);
      totalBox.textContent = "";
      return;
    }
    var list = document.createElement("ul");
    var total = 0;
    cart.forEach(function (item) {
      total += item.price * item.qty;
      var li = document.createElement("li");
      li.textContent = item.name + " × " + item.qty + " — " + money(item.price * item.qty);
      list.appendChild(li);
    });
    linesBox.appendChild(list);
    totalBox.textContent = "Subtotal " + money(total);
  }

  document.querySelectorAll("[data-add-cart]").forEach(function (btn) {
    btn.addEventListener("click", function () {
      var sku = btn.getAttribute("data-sku") || "";
      var name = (btn.getAttribute("data-name") || "Item").slice(0, 80);
      var price = Number(btn.getAttribute("data-price") || 0);
      var found = cart.filter(function (i) { return i.sku === sku; })[0];
      if (found) found.qty += 1;
      else cart.push({ sku: sku, name: name, price: price, qty: 1 });
      render();
    });
  });

  var checkout = root.querySelector("[data-checkout]");
  if (checkout) {
    checkout.addEventListener("click", function () {
      if (status) {
        status.textContent =
          "Sandbox checkout only — no payment was processed and no order was placed. See the README for what a real Stripe (or similar) connection would require.";
      }
    });
  }

  render();
})();

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.