/* Orchard site — deliberately plain baseline. Restyle to taste:
   colors, fonts, spacing, and the hero background are yours to drive.
   The green accent (--accent) is a placeholder; swap for the real brand color. */

:root {
  --bg: #ffffff;
  --text: #323336;         /* Carrd text color */
  --muted: #6b7c73;
  --accent: #d2f73b;       /* Orchard lime (from Carrd) */
  --accent-ink: #2a3a0e;   /* readable text on the lime accent */
  --border: #e4eae6;
  --maxw: 44rem;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: 'Bakbak One', var(--font);
  /* Ken Burns timing: each slide is visible for --kb-hold, full cycle = slides × --kb-hold */
  --kb-hold: 7s;
}

* { box-sizing: border-box; }

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

main { min-height: 60vh; }

/* Home page: full-height flex column so the footer sticks to the viewport
   bottom when content is short (no scrollbar), and the page grows + scrolls
   only when content is too tall (e.g. landscape phones) — no overlap. */
body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
body.home main { flex: 1 0 auto; min-height: 0; display: flex; }
body.home main > .hero { flex: 1; }

/* ---- Header (shared across landing + every blog post) ---- */
.site-header {
  padding: 1rem 1.5rem;
}
/* On the home page the header sits in flow at the top of the flex column,
   above the fixed Ken Burns background. */
.site-header--overlay {
  position: relative;
  z-index: 10;
  padding-top: 1.25rem;
}

/* Rounded translucent pill holding brand (home link) + nav. */
.header-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Off the home page (no photo behind), use a light, legible pill. */
.site-header:not(.site-header--overlay) .header-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: #fff;
}
.site-brand .brand-icon {
  width: 28px; height: 28px;
  display: block;
}
.site-brand .brand-name {
  font-family: var(--display);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);  /* match the hero title */
}

.site-nav a {
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;                                /* white reads on any photo frame */
  /* Inter's thinner strokes need a stronger, layered shadow to read as
     prominently as the heavy Bakbak One "Orchard" brand. */
  text-shadow: 0 2px 6px rgba(0,0,0,0.7), 0 2px 20px rgba(0,0,0,0.6);
}
.site-nav a:hover { color: var(--accent); }

/* Off-home (light pill): readable dark text instead of white. */
.site-header:not(.site-header--overlay) .site-brand { color: var(--text); }
.site-header:not(.site-header--overlay) .site-brand .brand-name { text-shadow: none; }
.site-header:not(.site-header--overlay) .site-nav a { color: var(--accent-ink); text-shadow: none; }
.site-header:not(.site-header--overlay) .site-nav a:hover { color: var(--text); filter: none; }

/* ---- Hero / landing (full-bleed) ---- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;           /* header/footer are in flow now, so no clearance padding needed */
  text-align: center;
  color: #fff;
}
.hero > *:not(.kenburns) { position: relative; z-index: 2; }
.hero-inner-width { max-width: var(--maxw); margin: 0 auto; }

.hero-icon {
  width: 120px; height: 120px;
  margin: 0 auto 1rem;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35));
}
.hero-title {
  font-family: var(--display);
  font-size: 4rem;
  margin: 0 0 0.25rem;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);
}
.hero-tagline { font-size: 1.2rem; margin: 0 0 2rem; text-shadow: 0 1px 8px rgba(0,0,0,0.5); }
.hero-copy {
  font-size: 1.4rem;
  max-width: 32rem;
  margin: 0 auto 2.5rem;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.hero-copy strong { color: var(--accent); }

/* Centered container for the injected Beehiiv form. The form is set to 100%
   of its container in Beehiiv's designer, so its width is driven by the
   container width here. min() caps it to the viewport so it never overflows
   on small phones. */
.signup {
  margin: 2rem auto 0;
  display: flex;
  justify-content: center;
  width: min(32rem, 100%);
}
.signup > * { width: 100%; }
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  padding: 0.8rem 1.75rem;
  border-radius: 8px;
  font-weight: 700;
}
.cta:hover { filter: brightness(1.05); }
.signup-note { font-size: 0.85rem; margin-top: 0.75rem; opacity: 0.85; }
.attribution { font-size: 0.95rem; margin-top: 2.5rem; text-shadow: 0 1px 8px rgba(0,0,0,0.55); }
.attribution strong { color: var(--accent); }

/* ---- Ken Burns slideshow background ---- */
.kenburns {
  position: fixed;
  inset: 0;
  z-index: 0;            /* behind header, hero content, and footer (all z-index 2–10) */
  overflow: hidden;
}
.kb-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  will-change: opacity, transform;
  animation-duration: calc(var(--kb-hold) * 4);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
/* Each slide owns ~25% of the cycle but stays on a little longer so its fade-out
   overlaps the next slide's fade-in — a true cross-fade with no gap and no dark
   dip. A slide fades IN over 0%–7% and OUT over 25%–32%; because each slide is
   delayed by exactly 25%, slide N's fade-out (25%–32%) lines up in real time with
   slide N+1's fade-in (0%–7%). Motion (zoom/pan) runs across the visible window,
   then resets while hidden. Each slide has its own motion; #2 is a strong pan. */
.kb-slide:nth-child(1) { animation-name: kb1; animation-delay: 0s; }
.kb-slide:nth-child(2) { animation-name: kb2; animation-delay: var(--kb-hold); }
.kb-slide:nth-child(3) { animation-name: kb3; animation-delay: calc(var(--kb-hold) * 2); }
.kb-slide:nth-child(4) { animation-name: kb4; animation-delay: calc(var(--kb-hold) * 3); }

/* #1 — straight zoom in */
@keyframes kb1 {
  0%   { opacity: 0; transform: scale(1.00); }
  7%   { opacity: 1; }
  25%  { opacity: 1; }
  32%  { opacity: 0; transform: scale(1.15); }
  90%  { opacity: 0; transform: scale(1.00); }   /* reset while hidden */
  100% { opacity: 0; transform: scale(1.00); }
}
/* #2 — strong horizontal pan, left → right (scale 1.18 keeps edges off-screen) */
@keyframes kb2 {
  0%   { opacity: 0; transform: scale(1.18) translateX(-6%); }
  7%   { opacity: 1; }
  25%  { opacity: 1; }
  32%  { opacity: 0; transform: scale(1.18) translateX(6%); }
  90%  { opacity: 0; transform: scale(1.18) translateX(-6%); }
  100% { opacity: 0; transform: scale(1.18) translateX(-6%); }
}
/* #3 — zoom out while panning up */
@keyframes kb3 {
  0%   { opacity: 0; transform: scale(1.20) translateY(4%); }
  7%   { opacity: 1; }
  25%  { opacity: 1; }
  32%  { opacity: 0; transform: scale(1.12) translateY(-4%); }
  90%  { opacity: 0; transform: scale(1.20) translateY(4%); }
  100% { opacity: 0; transform: scale(1.20) translateY(4%); }
}
/* #4 — zoom in on a diagonal drift */
@keyframes kb4 {
  0%   { opacity: 0; transform: scale(1.08) translate(3%, 3%); }
  7%   { opacity: 1; }
  25%  { opacity: 1; }
  32%  { opacity: 0; transform: scale(1.18) translate(-3%, -3%); }
  90%  { opacity: 0; transform: scale(1.08) translate(3%, 3%); }
  100% { opacity: 0; transform: scale(1.08) translate(3%, 3%); }
}

/* Respect users who ask for less motion: hold a single static image. */
@media (prefers-reduced-motion: reduce) {
  .kb-slide { animation: none; opacity: 0; transform: none; }
  .kb-slide:nth-child(1) { opacity: 1; }
}

/* ---- Latest posts on the landing page ---- */
.latest-posts {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ---- Blog index + posts ---- */
.post-index, .post {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.post-list a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.post-list a:hover { color: var(--accent); }
.post-list time { display: block; color: var(--muted); font-size: 0.85rem; }
.post-summary { color: var(--muted); margin: 0.35rem 0 0; }

.post-header h1 { font-size: 2.1rem; margin-bottom: 0.25rem; letter-spacing: -0.01em; }
.post-header time { color: var(--muted); font-size: 0.9rem; }
.post-body { margin-top: 2rem; font-size: 1.08rem; }
.post-body h2 { margin-top: 2.25rem; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre {
  background: #f4f7f5;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}
.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ---- Footer ---- */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
/* On the home page the footer sits in flow at the bottom of the flex column,
   above the fixed Ken Burns background. */
.site-footer--overlay {
  position: relative;
  z-index: 10;
  padding-bottom: 1.5rem;
}
/* Rounded pill mirroring the header. */
.footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.55rem 1.1rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
}
/* Over the hero photos, use the frosted translucent style like the header pill. */
.site-footer--overlay .footer-pill {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.social-link svg { width: 20px; height: 20px; display: block; }
.social-link:hover { color: var(--accent); }
.footer-email {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-email:hover { color: var(--accent); }
/* White text/icons on the translucent over-photo footer. */
.site-footer--overlay .social-link,
.site-footer--overlay .footer-email { color: #fff; }
.site-footer--overlay .social-link:hover,
.site-footer--overlay .footer-email:hover { color: var(--accent); }
.muted { color: var(--muted); }
