/* Meadow Cottage theme
   Place cottage-meadow.png beside this stylesheet, or update --background-image.
*/

:root {
  color-scheme: dark;

  --background-image: url("./cottage-meadow.png");

  /* Palette drawn from the artwork */
  --sky: #79a7c9;
  --cloud: #f1e8e3;
  --meadow: #777246;
  --forest: #203228;
  --cottage: #aabcc4;
  --path: #aa8c69;

  /* Accessible foreground surfaces */
  --ink: #fffaf0;
  --ink-muted: #d9e1df;
  --surface: rgba(13, 27, 27, 0.88);
  --surface-soft: rgba(19, 35, 34, 0.78);
  --surface-light: rgba(247, 241, 225, 0.92);
  --surface-light-ink: #182622;
  --border: rgba(255, 250, 240, 0.23);
  --accent: #eed58d;
  --accent-hover: #ffe7a4;

  --shadow: 0 18px 55px rgba(3, 12, 12, 0.34);
  --radius: 18px;
  --content-width: 72rem;
  --reading-width: 44rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.65;

  /* The first two layers gently tame both the bright sky/clouds
     and the uneven green foreground without hiding the artwork. */
  background-color: var(--sky);
  background-image:
    linear-gradient(
      to bottom,
      rgba(7, 20, 27, 0.28) 0%,
      rgba(7, 20, 27, 0.10) 38%,
      rgba(9, 21, 17, 0.18) 62%,
      rgba(5, 15, 12, 0.42) 100%
    ),
    radial-gradient(
      circle at 50% 48%,
      rgba(255, 255, 255, 0) 24%,
      rgba(5, 14, 15, 0.12) 100%
    ),
    var(--background-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

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

.site-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /*border-bottom: 1px solid var(--border);*/
  background: rgba(11, 25, 27, 0.00);
  /*box-shadow: 0 8px 28px rgba(5, 14, 14, 0.1);*/
  /*-webkit-backdrop-filter: blur(2px) saturate(115%);
  backdrop-filter: blur(2px) saturate(115%);*/
}

.site-header__inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-nav a {
  color: var(--ink-muted);
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  min-height: min(78vh, 52rem);
  place-items: center;
  padding-block: clamp(5rem, 13vh, 10rem);
}

.hero__panel,
.reading-surface {
  width: min(100%, var(--reading-width));
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  backdrop-filter: blur(12px) saturate(112%);
}

/* Use this for short headings that sit closer to the image.
   The scrim remains part of the heading, so it stays readable over
   white clouds, blue sky, trees, or grass. */
.image-heading {
  display: inline;
  padding: 0.08em 0.22em 0.14em;
  color: var(--ink);
  background: rgba(8, 20, 21, 0.78);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-radius: 0.16em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-block: 0 0.6em;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 8vw, 6rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
}

p {
  max-width: 68ch;
  margin-block: 0 1em;
}

.lede {
  color: var(--ink-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #17231f;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.button:hover {
  color: #17231f;
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 11px 27px rgba(0, 0, 0, 0.26);
}

.button--quiet {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.button--quiet:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.content-section {
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.card {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-soft);
  box-shadow: 0 12px 38px rgba(4, 13, 13, 0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card > :last-child,
.reading-surface > :last-child,
.hero__panel > :last-child {
  margin-bottom: 0;
}

/* Alternate parchment surface for sections placed over the darkest grass. */
.surface-light {
  color: var(--surface-light-ink);
  background: var(--surface-light);
  border-color: rgba(33, 48, 41, 0.18);
}

.surface-light a {
  color: #5b4918;
  font-weight: 750;
}

.site-footer {
  margin-top: auto;
  /*border-top: 1px solid var(--border);*/
  background: rgba(8, 20, 19, 0.0);
  color: var(--ink-muted);
}

.site-footer__inner {
  padding-block: 1.4rem;
}

/* Accessibility helpers */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: #14201c;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

::selection {
  background: var(--accent);
  color: #17231f;
}

@media (max-width: 42rem) {
  body {
    /* Fixed backgrounds are jittery and expensive on many phones. */
    background-attachment: scroll;
    background-position: 50% 42%;
  }

  .site-header {
    position: relative;
  }

  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.85rem;
  }

  .hero {
    min-height: 70vh;
    place-items: end center;
    padding-top: 9rem;
  }

  .hero__panel,
  .reading-surface {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
