/* ==========================================================================
   _advance_farm — website styles
   Layout inspired by anduril.com — zinc palette, full-screen hero with an
   animated flock canvas, full-width sections sharing one side gutter,
   newsroom-style blog. Pages are plain HTML; no build step.   ========================================================================== */

:root {
  /* Palette — neutral zinc */
  --color-bg:             #ffffff;
  --color-hero-bg:        #e8e8e6;   /* warm-cool grey, anduril-adjacent */
  --color-border:         #d4d4d8;
  --color-text:           #18181b;
  --color-text-secondary: #52525b;
  /* Muted olive green behind the home blog cards (alternatives: soil #54402f, clay #6b4c3a) */
  --color-card:           #444b3a;  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout — every section uses the same side gutter */
  --gutter: clamp(1.5rem, 2.5vw, 2.5rem);
  --header-h: 64px;
  /* Vertical padding of the home page sections: the same above and below */
  --section-pad: 6rem;
}

/* ----------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* -------------------------------------------------------------- Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  /* glass background is added on scroll via .is-scrolled (script.js) */
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* header logo from brand/advance_farm_sygnet.svg, drawn in the link colour */
.site-logo {
  display: inline-flex;
  color: var(--color-text);
  line-height: 0;
  transition: opacity 0.2s ease;
}

.site-logo:hover { opacity: 0.55; }

.site-logo:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

.site-logo__mark {
  display: block;
  /* visually matches the 20px GitHub icon on the right */
  height: 16px;
  width: auto;
  fill: currentColor;
}

.github-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
  line-height: 0;
  transition: opacity 0.2s ease;
}
.github-link:hover { opacity: 0.55; }

.github-icon { width: 20px; height: 20px; display: block; }

/* main navigation: sits to the left of the GitHub icon, same mono as the labels */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
  margin-right: 1.75rem;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.site-nav a:hover { opacity: 0.55; }
.site-nav a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
.site-nav a:focus-visible { outline: 2px solid var(--color-text); outline-offset: 4px; }
/* Home page: the menu appears once the header turns into the white bar on
   scroll. visibility keeps the hidden links out of the tab order. */.site-header--home .site-nav {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.site-header--home:not(.is-scrolled) .site-nav {
  opacity: 0;
  visibility: hidden;
}
/* ---------------------------------------------------------------- Hero */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  background: linear-gradient(to bottom, #d4d4d2, var(--color-hero-bg));
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* animated canvas fills the whole hero */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* text sits bottom-left, above the canvas */
.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) clamp(3rem, 7vh, 6rem);
  width: 100%;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
  margin: 0 0 clamp(1rem, 2vw, 1.75rem);
}

/* page title: the same on the home hero, the blog index and every subpage */
.hero__title,
.news-head__title,
.post-head__title {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
}

/* Shared side gutter for content sections (about, join) */
.inner {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* -------------------------------------------------------------- About */
.about {
  display: grid;
  /* text column starts at the middle of the screen, like on the subpages */
  grid-template-columns: 1fr calc(50vw - var(--gutter));
  gap: 4rem;
  padding-block: var(--section-pad);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0;
  padding-top: 0.25rem;
}
/* the home blog label is an h2: reset the heading weight */
h2.section-label { font-weight: 400; }
.about__text p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  text-align: justify;
  hyphens: auto;
  margin: 0 0 1.5rem;
}
.about__text .read-more { margin-top: 0.5rem; }

/* --------------------------------------------------------- Home blog */
.blog-wrapper { background: var(--color-hero-bg); }
.home-blog { padding-block: var(--section-pad); }
.home-blog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.home-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* four slots; two columns on tablets, one on phones */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  color: #ffffff;
  padding: 1.5rem 1.5rem 1.75rem;
}
.home-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  margin-bottom: 2rem;
}
.home-card__title {
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 1.75rem;
}
/* the whole card is the link */
.home-card__title a { color: #ffffff; text-decoration: none; }
.home-card__title a::after { content: ""; position: absolute; inset: 0; }
.home-card__title a:focus-visible { outline: none; }
.home-card__title a:focus-visible::after { outline: 2px solid #ffffff; outline-offset: -4px; }
.home-card__desc {
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 1.75rem;
}
.home-card__more {
  margin-top: auto;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  transition: text-decoration-color 0.2s ease;
  align-self: flex-start;
}
.home-card:hover .home-card__more { text-decoration-color: #ffffff; }
/* free slots, shown until the next posts are published */
.home-card__img--empty { background: rgba(255, 255, 255, 0.08); }
.home-card--empty .home-card__title { color: rgba(255, 255, 255, 0.55); }
.home-card--empty .home-card__desc { color: rgba(255, 255, 255, 0.45); margin-bottom: 0; }
/* -------------------------------------------------------------- Join */
/* Same layout as About: label on the left, text from the middle of the screen */
.join-wrapper { background: #27272a; }
.join {
  display: grid;
  grid-template-columns: 1fr calc(50vw - var(--gutter));
  gap: 4rem;
  padding-block: var(--section-pad);
}
.join .section-label { color: #71717a; }
.join__text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.join__text p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #a1a1aa;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}
.join .read-more {
  align-self: flex-start;
  color: #ffffff;
  text-decoration-color: #52525b;
}
.join .read-more:hover { text-decoration-color: #ffffff; }
/* -------------------------------------------------------------- Footer */
.site-footer {
  background: #000000;
  color: #ffffff;
  padding: 7rem var(--gutter) 5rem;
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.footer__brand {
  color: #ffffff;
  font-size: 1.05rem;
  align-self: start;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

/* push the columns to the right, like anduril */
.footer__col:first-child { grid-column: 2; }

.footer__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #71717a;
  margin: 0 0 2rem;
}

.footer__col ul,
.footer__legal {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__col li + li { margin-top: 0.4rem; }

.footer__col a {
  color: #ffffff;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__col a:hover { color: #a1a1aa; }

.footer__bottom {
  margin-top: 6rem;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 1rem;
}

.footer__legal li + li { margin-top: 0.25rem; }

.footer__legal a {
  font-size: 0.8rem;
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__legal a:hover { color: #ffffff; }

/* offset in-page anchors so the fixed header doesn't cover them */
[id] { scroll-margin-top: var(--header-h); }

/* ----------------------------------------------------------- Blog */
/* Newsroom-style structure, with the typography and colours of the home page */
.news-date,
.post-head__meta time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}
.news-date { margin-bottom: 1rem; }
/* "Read more ↗": same underlined link as the Join section, in dark ink */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border);
  transition: text-decoration-color 0.2s ease;
}
.read-more:hover { text-decoration-color: var(--color-text); }
.news-img, .post-cover__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-hero-bg);
}
/* breadcrumb above the title: _advance_farm / blog / post */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  color: var(--color-text-secondary);
}
.breadcrumb li + li::before {
  content: "/";
  margin: 0 0.6em;
  color: var(--color-border);
}
.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current] { color: var(--color-text); }
/* plain text links on content pages */
.post-head__meta a,
.post-share a,
.post__body a,
.post__back a {
  color: var(--color-text);
  text-underline-offset: 3px;
}
.post-head__meta a:hover,
.post-share a:hover { opacity: 0.6; }
/* index header */
.news-head { padding-top: calc(var(--header-h) + clamp(4rem, 10vh, 7rem)); }
.news-head__title { margin-top: 1.25rem; }
/* newest post: text left, image right */
.news-featured {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding-top: clamp(3rem, 7vh, 5rem);
}
.news-featured__title,
.about__title {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}
.news-featured__title a,
.news-list__title a { color: var(--color-text); text-decoration: none; }
.news-featured__title a:hover,
.news-list__title a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.news-featured__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 26rem;
  margin: 0 0 2rem;
}
.news-featured__img { display: block; }
/* all articles: rows with a small image on the right */
.news-all { padding-top: clamp(4rem, 9vh, 6rem); padding-bottom: 9rem; }
.news-all__title {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}
.news-list__item {
  display: grid;
  grid-template-columns: 1fr clamp(150px, 18vw, 260px);
  gap: 2rem;
  align-items: start;
  padding: 1.75rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
}
.news-list__item .news-date { margin-bottom: 0.75rem; }
.news-list__title {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  max-width: 30rem;
  margin: 0 0 1.25rem;
}
/* post header, full-width cover, then side + text */
.post-head { padding-top: calc(var(--header-h) + clamp(4rem, 10vh, 7rem)); }
.post-head__title {
  text-wrap: balance;
  max-width: 16ch;
  margin: 1.25rem 0 2rem;
}
.post-head__meta { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--color-text-secondary); }


.post-cover { margin: 2.5rem 0 0; }
.post-cover__img { max-height: 75vh; }
.post-rule {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 3rem var(--gutter) 0;
}
.post-layout {
  display: grid;
  grid-template-columns: 1fr calc(50vw - var(--gutter));
  gap: 4rem;
  padding-top: 2.5rem;
  padding-bottom: 9rem;
}
.post-layout__side {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  align-self: start;
}
.post-side__title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 24rem;
  margin: 0 0 1.5rem;
}
.post-share {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0;
}


/* the text column starts at the middle of the screen and ends at the right
   edge of the cover image */
.post-layout__main { min-width: 0; }
.post__body p,
.post__body li {
  font-size: 1.0625rem;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}
.post__body p {
  color: var(--color-text);
  margin: 0 0 1.5rem;
}
.post__body h2 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
}
.post__body h2:first-child { margin-top: 0; }
.post__body ul { padding-left: 1.25rem; margin: 0 0 1.5rem; }

.post__back { margin: 3rem 0 0; font-size: 0.95rem; }

/* short pages (404) keep the footer below the fold */
.main--tall { min-height: 100vh; }
/* -------------------------------------------------- Scroll reveal */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-up.is-visible {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .hero__title { letter-spacing: -0.025em; }
  :root { --section-pad: 4rem; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .join { grid-template-columns: 1fr; gap: 2rem; }
  .site-footer { padding: 4rem var(--gutter) 3rem; }
  .footer__top { grid-template-columns: 1fr; gap: 3rem; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col:first-child { grid-column: auto; }
  .footer__bottom { margin-top: 4rem; }
  .news-featured { grid-template-columns: 1fr; gap: 2rem; }
  .news-featured__img { order: -1; }
  .news-list__item { grid-template-columns: 1fr 110px; gap: 1rem; }
  .post-head__title { max-width: none; letter-spacing: -0.025em; }
  .post-layout { grid-template-columns: 1fr; gap: 2.5rem; padding-bottom: 6rem; }
  .post-layout__side { position: static; order: 2; }
}
@media (max-width: 560px) {
  .home-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .site-nav { gap: 1.1rem; margin-right: 1.1rem; }
  .site-nav a { font-size: 0.75rem; }
}
/* ------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}
