/* brandongalang.com — Dan Koe-style landing */

:root {
  --bg: #ffffff;
  --text: #333333;
  --heading: #000000;
  --accent: #3a9aad;
  --accent-dim: rgba(58, 154, 173, 0.35);
  --border: #eeeeee;
  --product-bg: #fafafa;
  --font-body: "Poppins", system-ui, sans-serif;
  --font-eyebrow: "Montserrat", system-ui, sans-serif;
  --editorial-max: 820px;
  --soft-text: #555555;
  --hero-max: 640px;
  --page-pad: clamp(1.25rem, 4vw, 3rem);
  --section-gap: clamp(4rem, 10vw, 7rem);
}

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

html {
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* —— Header (Welsh-style) —— */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--editorial-max);
  margin: 0 auto;
  min-height: 4.5rem;
  padding: 0 var(--page-pad);
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--heading);
  text-decoration: none;
}

.nav-brand:hover,
.nav-brand:focus-visible {
  color: var(--heading);
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f5f5f5;
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--soft-text);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--heading);
}

/* —— Eyebrows —— */
.eyebrow {
  font-family: var(--font-eyebrow);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

/* —— Hero (Welsh editorial, above the fold) —— */
.hero {
  max-width: var(--editorial-max);
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 4.5rem) var(--page-pad) var(--section-gap);
  text-align: center;
}

.hero-headline {
  font-family: var(--font-body);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0 auto 1.25rem;
  max-width: 22ch;
}

.hero-lede {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--soft-text);
  margin: 0 auto 2rem;
  max-width: 42ch;
}

.text-cta {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--accent);
  transition: color 0.15s ease;
}

.text-cta:hover,
.text-cta:focus-visible {
  color: var(--accent);
}

.text-cta--footer {
  margin-top: 0.5rem;
}

.text-link {
  font-weight: 600;
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
}

.archive-link-wrap {
  margin: 2rem 0 0;
}

.archive-link-wrap--center {
  text-align: center;
}

.subscribe-block {
  margin: 0 auto;
  max-width: 480px;
}

.substack-embed {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 320px;
  border: 0;
  background: #ffffff;
}

/* —— Section shared —— */
.section-intro {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.section-lede {
  margin: 0 auto;
  max-width: 36rem;
  opacity: 0.9;
}

/* —— Resources / product strip —— */
.resources {
  padding: var(--section-gap) var(--page-pad);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #f7f7f7 0%, var(--bg) 100%);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 72rem;
  margin: 0 auto;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--product-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.product-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
}

.product-thumb--chief {
  background: linear-gradient(135deg, #1a3a4a 0%, #5eb3c8 55%, #0d1f28 100%);
}

.product-thumb--operators {
  background: linear-gradient(135deg, #2d2d3a 0%, #6b7fd7 50%, #1a1a24 100%);
}

.product-thumb--skills {
  background: linear-gradient(135deg, #1f2e1a 0%, #7ab86a 45%, #0f1810 100%);
}

.product-card .product-title,
.product-card .product-meta,
.product-card .product-desc,
.product-card .product-cta {
  padding-left: 1rem;
  padding-right: 1rem;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  margin: 1rem 0 0.25rem;
}

.product-meta {
  font-family: var(--font-eyebrow);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.product-desc {
  font-size: 0.9rem;
  margin: 0 0 1rem;
  flex: 1;
}

.product-cta {
  display: inline-block;
  margin: 0 1rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent);
}

.product-cta--soon {
  color: var(--text);
  opacity: 0.55;
  text-decoration: none;
  cursor: default;
}

/* —— Blog —— */
.blog {
  padding: var(--section-gap) var(--page-pad);
  border-top: 1px solid var(--border);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 1.25rem;
  max-width: 72rem;
  margin: 0 auto;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card[hidden] {
  display: none;
}

.post-thumb-link {
  display: block;
}

.post-thumb-link:hover .post-thumb,
.post-thumb-link:focus-visible .post-thumb {
  opacity: 0.92;
}

.post-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.post-thumb--agents {
  background: linear-gradient(135deg, #1a3a4a 0%, #5eb3c8 55%, #0d1f28 100%);
}

.post-thumb--systems {
  background: linear-gradient(135deg, #2d2d3a 0%, #6b7fd7 50%, #1a1a24 100%);
}

.post-thumb--loops {
  background: linear-gradient(135deg, #3a2d1a 0%, #c8a65e 50%, #1f1810 100%);
}

.post-thumb--operators {
  background: linear-gradient(135deg, #1f2e1a 0%, #7ab86a 45%, #0f1810 100%);
}

.post-thumb--default {
  background: linear-gradient(135deg, #e8e8e8 0%, #c8c8c8 50%, #f0f0f0 100%);
}

.post-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.5rem;
}

.post-title a {
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: transparent;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.post-title a:hover,
.post-title a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.post-excerpt {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  flex: 1;
}

.post-meta {
  font-size: 0.8rem;
  opacity: 0.65;
  margin: 0;
}

.post-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent);
}

.post-link:hover,
.post-link:focus-visible {
  color: var(--accent);
}

.post-error {
  grid-column: 1 / -1;
  text-align: center;
  opacity: 0.7;
}

.load-more {
  display: block;
  margin: 2.5rem auto 0;
  padding: 0.75rem 2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.load-more:hover,
.load-more:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* —— About (centered, Koe-style) —— */
.about {
  padding: var(--section-gap) var(--page-pad);
  border-top: 1px solid var(--border);
}

.about-inner {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}

.about-tagline {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  opacity: 0.85;
}

.about-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin: 0 auto 1.5rem;
}

.about-greeting {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 1rem;
}

.about-bio {
  margin: 0 0 1rem;
  text-align: left;
}

.about-boundary {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  opacity: 0.75;
  font-style: italic;
  text-align: left;
}

.about-links {
  margin: 0;
  font-weight: 500;
}

.about-links a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: transparent;
}

.about-links a:hover,
.about-links a:focus-visible {
  text-decoration-color: var(--accent);
}

.link-sep {
  margin: 0 0.5rem;
  opacity: 0.4;
}

/* —— Footer —— */
.site-footer {
  padding: var(--section-gap) var(--page-pad) 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-title {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.5rem;
}

.footer-lede {
  margin: 0 auto 1rem;
  max-width: 32rem;
  opacity: 0.9;
}

.footer-meta {
  margin: 2.5rem 0 0;
  font-size: 0.8rem;
  opacity: 0.5;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 0.85rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }
}
