/* ============================================================
   Gracelands Farm — design tokens
   Palette drawn directly from the header photograph: dusk-slate
   sky, muted gold sunset light, sage paddock grass.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Karla:wght@400;500;600&display=swap');

:root {
  --ink: #1e2521;
  --dusk: #3a4152;
  --dusk-deep: #262a35;
  --gold: #d9a24b;
  --gold-soft: #e6bc76;
  --sage: #7c8c6e;
  --parchment: #efede6;
  --parchment-dim: #e4e0d4;

  --display: 'Fraunces', Georgia, serif;
  --body: 'Karla', -apple-system, sans-serif;

  --divider: linear-gradient(90deg, var(--dusk) 0%, var(--gold) 55%, var(--sage) 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------------- Nav ---------------- */

.site-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 2rem 0 0;
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .logo {
  height: 160px;
  width: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--parchment);
  opacity: 0.88;
  transition: opacity 0.2s ease;
}

.site-nav a:hover { opacity: 1; }

.site-nav.on-light a { color: var(--dusk); }
.site-nav.on-light .logo { filter: invert(1) brightness(0.3); }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  height: 92vh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28,38,44,0.15) 0%, rgba(28,38,44,0.05) 40%, rgba(28,38,44,0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--parchment);
  padding-bottom: 5rem;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
  max-width: 14ch;
  color: var(--parchment);
}

.hero p {
  font-size: 1.15rem;
  max-width: 42ch;
  color: var(--parchment);
  opacity: 0.92;
  margin-top: 1rem;
}

/* ---------------- Divider (signature motif) ---------------- */

.divider {
  height: 3px;
  background: var(--divider);
}

/* ---------------- Content sections ---------------- */

.section {
  padding: 5.5rem 0;
}

.section.dim { background: var(--parchment-dim); }

.section.dusk {
  background: var(--dusk-deep);
  color: var(--parchment);
}

.section-label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}

.section.dusk .section-label { color: var(--gold-soft); }

.lede {
  font-size: 1.4rem;
  max-width: 34ch;
  line-height: 1.45;
  font-family: var(--display);
  font-weight: 400;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.two-col p { max-width: 48ch; }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .hero { height: 78vh; }
  .site-nav ul { gap: 1.25rem; }
}

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--ink);
  color: var(--parchment);
  padding: 3rem 0 2.5rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a { text-decoration: none; opacity: 0.75; }
.site-footer a:hover { opacity: 1; }

.site-footer small {
  opacity: 0.55;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------------- Simple page header (About / Mission) ---------------- */

.page-header {
  background: var(--dusk-deep);
  color: var(--parchment);
  padding: 9rem 0 4rem;
}

.page-header h1 {
  color: var(--parchment);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
}

.page-body {
  padding: 4.5rem 0;
}

.page-body .lede {
  max-width: 56ch;
}

/* ---------------- Projects / repo cards ---------------- */

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 3rem;
  padding-bottom: 5rem;
}

.repo-card {
  display: block;
  background: var(--parchment-dim);
  border-radius: 14px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(30, 37, 33, 0.06);
}

.repo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(30, 37, 33, 0.12);
}

.repo-lang {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 0.75rem;
}

.repo-card h3 {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.repo-card p {
  font-size: 0.95rem;
  color: var(--ink);
  opacity: 0.85;
  margin: 0 0 1.25rem;
}

.repo-link {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

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

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

/* ---------------- Gallery ---------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.75rem;
  padding: 0 0 5rem;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-grid a:hover img {
  transform: scale(1.04);
}

.gallery-grid .wide { grid-column: span 2; }
.gallery-grid .tall { grid-row: span 2; }

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }
  .gallery-grid .wide { grid-column: span 2; }
  .gallery-grid .tall { grid-row: span 1; }
}

/* ---------------- Story page (merged About/Mission/Gallery) ---------------- */

body.story-page {
  position: relative;
}

body.story-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/assets/images/gallery-snow-gums.jpeg');
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.story-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 5rem 0;
}

.story-block.reverse .story-image { order: 2; }
.story-block.reverse .story-text { order: 1; }

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(30, 37, 33, 0.16);
  display: block;
}

.story-block .story-image { aspect-ratio: 4 / 3; }
.story-block .story-image.portrait { aspect-ratio: 3 / 4; }

.story-text .section-label { margin-bottom: 1.25rem; }
.story-text p { max-width: 46ch; }

.story-full {
  aspect-ratio: 21 / 9;
  overflow: hidden;
}

.story-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 760px) {
  .story-block, .story-block.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 0;
  }
  .story-block.reverse .story-image,
  .story-block.reverse .story-text { order: unset; }
  .story-full { aspect-ratio: 4 / 3; }
}
