/* Squatch Snacks' stylesheet: plain CSS, no build step. The design's named values are the custom
   properties on :root, and the dark look sets the colors again (the visitor's setting picks).
   The palette is Ranger Station '76: pine, burnt orange, harvest gold, avocado and map paper. */

:root {
	color-scheme: light dark;

	--pine: #233b2b;
	--burnt-orange: #a23e20;
	--gold: #e8af43;
	--avocado: #a9b66a;
	--map-paper: #fff3d6;

	--page: #fafaf7;
	--raised: #f1f1eb;
	--text: #29332c;
	--muted: #5a655d;
	--heading: var(--pine);
	--link: var(--burnt-orange);
	--accent: var(--burnt-orange);
	--on-accent: #ffffff;
	--line: #dcddd4;

	--font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: ui-serif, Georgia, "Times New Roman", serif;
	--text-hero: clamp(2.5rem, 6vw + 1rem, 4.5rem);
	--space-section: clamp(3rem, 8vw, 5.5rem);
	--width-page: 72rem;
	--width-text: 44rem;
	--radius: 1rem;
	--stripe-pine: var(--pine);
	--stripe: linear-gradient(to right, var(--stripe-pine) 0 25%, var(--burnt-orange) 25% 50%, var(--gold) 50% 75%, var(--avocado) 75%);
}

@media (prefers-color-scheme: dark) {
	:root {
		--page: #1b201d;
		--raised: #222924;
		--text: #e5e9e1;
		--muted: #a2aca3;
		--heading: #d6e4c8;
		--link: #f0a17d;
		--accent: #f0a17d;
		--on-accent: #1b201d;
		--line: #3a413b;
		--stripe-pine: #2e5a3c;
	}
}

/* The page */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); color: var(--text); font: 1.0625rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; }
main { flex: 1; }
h1, h2, h3 { margin: 0; color: var(--heading); font-family: var(--font-display); line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3rem); }
h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--link); text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--width-page); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: var(--width-text); }
.page-top { padding-top: 3rem; }
.muted { color: var(--muted); }
.wide { display: block; width: 100%; margin: 2rem 0; border-radius: var(--radius); }
.prose { max-width: var(--width-text); font-size: 1.125rem; }
.prose h2 { margin: 2rem 0 0.75rem; font-size: 1.5rem; }
.prose ul { padding-left: 1.5rem; }

.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; top: 1rem; left: 1rem; z-index: 10; padding: 0.75rem; background: var(--raised); }

/* The header and the footer */

.notice { padding: 0.5rem 1.25rem; background: var(--pine); color: var(--map-paper); font-size: 0.875rem; text-align: center; }
.notice a { color: var(--gold); font-weight: 600; }

.site-header { border-bottom: 5px solid; border-image: var(--stripe) 1; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--heading); font: 700 1.25rem var(--font-display); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 0.5rem; }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; font-weight: 600; }
.site-header nav a { color: var(--heading); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--avocado); text-decoration-thickness: 3px; }

.site-footer { margin-top: var(--space-section); border-top: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem; padding-block: 2.5rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; line-height: 2; }

/* Sections, grids and cards */

.section { padding-block: var(--space-section) 0; }
.section.raised { margin-top: var(--space-section); padding-block: var(--space-section); background: var(--raised); }
.section.raised + .section.raised { margin-top: 0; }
.intro { max-width: var(--width-text); margin-top: 0.75rem; color: var(--muted); font-size: 1.125rem; }
.section-body { margin-top: 2.5rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); }
.card > img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 0.75rem; padding: 1.5rem; }
.card-body p, .card-body ul { margin: 0; }
.card-body h2 { font-size: 1.5rem; }
.card-body h2 a, .card-body h3 a { color: var(--heading); text-decoration: none; }
.card-body h2 a:hover, .card-body h3 a:hover { text-decoration: underline; }
.card-action { margin-top: auto; padding-top: 0.5rem; }
.eyebrow { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.testimonial { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; max-width: var(--width-text); margin: 0; padding: 1.5rem; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); background: var(--page); }
.testimonial blockquote { margin: 0; font-size: 1.125rem; }
.testimonial figcaption { color: var(--muted); font-size: 0.875rem; }
.testimonial strong { color: var(--text); }

/* Buttons and forms */

.button { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; border: 2px solid var(--accent); border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.1); }
.button-secondary { background: transparent; color: var(--accent); }
.button-inverse { border-color: var(--map-paper); background: transparent; color: var(--map-paper); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.form { display: grid; gap: 0.25rem; max-width: var(--width-text); }
.form label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--page); color: var(--text); font: inherit; }
.signup { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 36rem; }
.signup input { flex: 1 1 16rem; width: auto; border-radius: 999px; }

/* The home page */

.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--pine); }
.hero img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.hero .wrap { display: flex; flex-direction: column; justify-content: flex-end; gap: 1.5rem; min-height: 70vh; padding-block: 4rem; }
.hero h1 { max-width: 48rem; color: var(--map-paper); font-size: var(--text-hero); line-height: 1.05; }
.hero p { max-width: 36rem; margin: 0; color: var(--map-paper); font-size: 1.125rem; }

.faq { max-width: var(--width-text); border-top: 1px solid var(--line); }
.faq details { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 1rem; color: var(--heading); font-size: 1.125rem; font-weight: 600; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); transition: rotate 0.2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0.75rem 0 0; color: var(--muted); }

/* A snack's page and the prices */

.product { display: grid; gap: 2.5rem; padding-block: 3rem 0; }
.product img { width: 100%; aspect-ratio: 1; border-radius: var(--radius); object-fit: cover; }
.product h1 { margin: 0.5rem 0 1rem; }
.lede { color: var(--muted); font-size: 1.25rem; }
@media (min-width: 48rem) { .product { grid-template-columns: 1fr 1fr; align-items: center; } }

.price { color: var(--heading); font-size: 1.875rem; font-weight: 700; }
.price span { color: var(--muted); font-size: 1rem; font-weight: 400; }
