/* ==========================================================================
   Aaron's Memorial Works — stylesheet
   Palette: charcoal / near-black, natural stone gray, warm off-white, earth tones
   ========================================================================== */

:root {
  /* Color palette */
  --charcoal: #21201d;
  --stone-800: #35332f;
  --stone-600: #5c584f;
  --stone-400: #8a8577;
  --stone-300: #b7b1a2;
  --stone-200: #ded8c9;
  --off-white: #f3efe5;
  --paper: #faf7f0;
  --earth: #7c6a52;
  --earth-dark: #5a4c3a;
  --line: #ddd6c6;

  /* Body copy uses a softened near-black rather than pure charcoal —
     easier on the eyes over long paragraphs, still plenty of contrast. */
  --text: #3a342c;
  --text-soft: #5f5a4f;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 1140px;
  --radius: 4px;

  --shadow-sm: 0 1px 3px rgba(33, 32, 29, 0.08);
  --shadow-md: 0 8px 24px rgba(33, 32, 29, 0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  font-size: 106.25%; /* ~17px baseline: a touch larger and easier to read */
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  /* Warm, softly-varied backdrop instead of flat white — a faint stone-like
     wash rather than a texture that would fight with the copy. */
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 900px 500px at 12% -10%, rgba(124, 106, 82, 0.05), transparent 60%),
    radial-gradient(ellipse 1000px 600px at 100% 10%, rgba(93, 88, 74, 0.045), transparent 55%);
  background-attachment: fixed;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; color: var(--charcoal); }
p { margin: 0 0 1.1em; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

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

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--earth);
  outline-offset: 3px;
}

.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;
}

/* Honeypot field for the contact form — positioned off-screen rather than
   display:none, since some spam bots skip fields hidden that way. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--charcoal);
  color: var(--off-white);
  padding: 0.75em 1.25em;
  z-index: 1000;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.narrow { max-width: 720px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.section {
  padding: 5rem 0;
}
.section.alt {
  background-color: var(--off-white);
  background-image:
    radial-gradient(ellipse 800px 500px at 90% 0%, rgba(124, 106, 82, 0.06), transparent 55%);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--earth);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  max-width: 32ch;
}

.lead {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--text-soft);
  max-width: 62ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.8em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--charcoal);
  color: var(--off-white);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--earth-dark);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--stone-400);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--charcoal);
  background: rgba(33,32,29,0.04);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(251, 249, 244, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--charcoal);
}
.logo span {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-600);
  margin-left: 0.4em;
}

.site-nav { display: flex; align-items: center; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text);
  transition: color 0.15s ease;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--charcoal); }
.nav-cta {
  border: 1px solid var(--charcoal);
  padding: 0.5em 1.1em;
  border-radius: var(--radius);
}
.nav-cta:hover, .nav-cta:focus-visible {
  background: var(--charcoal);
  color: var(--off-white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 86vh;
  overflow: hidden;
  color: var(--off-white);
}
.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,19,17,0.55) 0%, rgba(20,19,17,0.72) 60%, rgba(20,19,17,0.86) 100%),
    url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?auto=format&fit=crop&w=1800&q=70') center/cover no-repeat;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 6rem;
  padding-bottom: 6rem;
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--stone-200);
  margin-bottom: 1rem;
}
.hero h1 {
  color: var(--off-white);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 18ch;
  margin-bottom: 1.1rem;
}
.hero-sub {
  font-size: 1.15rem;
  max-width: 52ch;
  color: var(--stone-200);
  margin-bottom: 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-note {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--stone-200);
  max-width: 46ch;
}
.hero .btn-ghost { color: var(--off-white); border-color: rgba(246,242,234,0.5); }
.hero .btn-ghost:hover, .hero .btn-ghost:focus-visible {
  border-color: var(--off-white);
  background: rgba(246,242,234,0.1);
}
.hide-mobile { display: inline; }

/* ---------- Grids / cards ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.path-card, .size-card {
  background: rgba(255, 253, 248, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.path-card:hover, .size-card:hover {
  background: rgba(255, 253, 248, 0.95);
}
.path-card:hover, .size-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.path-card h3, .size-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.path-card p, .size-card p {
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.6;
  margin: 0;
}

.sizes .size-card h3 { color: var(--earth-dark); margin-bottom: 0; }

.size-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.size-price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--earth);
  white-space: nowrap;
}
.size-dim {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0.3rem 0 0.9rem !important;
}

.sizes-note {
  margin-top: 1rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.pill-list li {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.55em 1.1em;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}
.gallery-item {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(160deg, var(--stone-400), var(--stone-800));
}
.gallery-item.ph-4 { background: linear-gradient(160deg, #9c9284, #423c33); }
.gallery-item.ph-5 { background: linear-gradient(160deg, #8a8577, #35332f); }
.gallery-item.ph-6 { background: linear-gradient(160deg, #ada08a, #4d4336); }

/* Illustrated placeholder tiles — original line art standing in for real
   product photography until finished pieces can be photographed. */
.gallery-item.ph-1,
.gallery-item.ph-2,
.gallery-item.ph-3 {
  background: linear-gradient(160deg, var(--stone-200), var(--stone-300));
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
}
.gallery-illustration {
  width: 62%;
  height: auto;
  flex: 1 1 auto;
}
.gallery-illustration .ill-fill {
  fill: var(--stone-200);
  stroke: none;
}
.gallery-illustration .ill-fill.soft {
  fill: #cfc6b0;
}
.gallery-illustration .ill-line {
  fill: none;
  stroke: var(--earth-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery-illustration .ill-line.thin {
  stroke-width: 1.6;
  stroke: var(--earth);
}
.gallery-illustration .ill-line.stem {
  stroke-width: 1.8;
  stroke: var(--earth);
}
.gallery-illustration .ill-line.leaf {
  stroke-width: 1.8;
  fill: var(--stone-300);
}
.gallery-item.ph-1 figcaption,
.gallery-item.ph-2 figcaption,
.gallery-item.ph-3 figcaption {
  position: static;
  background: none;
  color: var(--text-soft);
  text-align: center;
}

.gallery-item figcaption {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--off-white);
  background: linear-gradient(0deg, rgba(20,19,17,0.72), rgba(20,19,17,0));
}
.gallery-item.photo {
  align-items: flex-end;
}
.gallery-item.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.gallery-item.photo figcaption {
  position: relative;
  z-index: 1;
}

/* ---------- Steps ---------- */
.steps {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.steps li {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.step-num {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.steps h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.steps p {
  color: var(--text-soft);
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
}

/* ---------- Form ---------- */
.memorial-form {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1px solid var(--stone-300);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.7);
  color: var(--text);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--earth);
}
.form-row textarea.autoexpand {
  resize: none;
  overflow: hidden;
  min-height: 7.5em; /* roughly a paragraph's worth of space to start */
}
.form-row textarea.autoexpand-compact {
  min-height: 3.5em; /* a line or two — for a short inscription, not a paragraph */
}
.form-row input:invalid:not(:placeholder-shown) {
  border-color: #a55b4b;
}

/* Photo upload control — the native file input is visually hidden and
   triggered via its label so it matches the rest of the form styling. */
.file-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.file-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7em 1.4em;
  border: 1px solid var(--stone-300);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.file-upload-btn:hover {
  border-color: var(--earth);
  background: rgba(255, 253, 248, 0.95);
}
.file-upload input[type="file"]:focus-visible + .file-upload-btn {
  outline: 2px solid var(--earth);
  outline-offset: 3px;
}
.file-upload-name {
  font-size: 0.88rem;
  color: var(--text-soft);
  word-break: break-all;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0.15rem 0 0;
}

.form-disclaimer {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-soft);
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  margin: 0.25rem 0 0;
}

.payment-note {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-soft);
  background: rgba(107, 143, 113, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.9rem 0 0;
}
.payment-note strong {
  color: var(--text);
}

.memorial-form .btn {
  justify-self: start;
  border: none;
}
.form-status {
  min-height: 1.5em;
  font-size: 0.95rem;
  color: var(--earth-dark);
}
.form-status.is-error { color: #a5473a; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: var(--stone-300);
  padding: 2.25rem 0;
}
.footer-inner {
  font-size: 0.85rem;
  text-align: center;
}
.footer-contact {
  margin-top: 0.5rem;
  color: var(--stone-400);
}
.footer-contact a {
  color: var(--stone-300);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--off-white);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .hide-mobile { display: none; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open { max-height: 24rem; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-cta { border: none; margin: 0.5rem 1.5rem; text-align: center; }

  .section { padding: 3.5rem 0; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }

  .hero { min-height: 78vh; }
}

@media (max-width: 460px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
