:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --ink: #111111;
  --ink-soft: #5c5c5c;
  --accent: #111111;
  --accent-ink: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e2e2;
  --scrim-top: rgba(0, 0, 0, 0);
  --scrim-bottom: rgba(0, 0, 0, 0.82);
  --radius: 0px;
  --max-width: 1080px;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-alt: #151515;
    --ink: #f2f2f2;
    --ink-soft: #a3a3a3;
    --accent: #f2f2f2;
    --accent-ink: #111111;
    --card-bg: #171717;
    --border: #2a2a2a;
    --scrim-top: rgba(0, 0, 0, 0);
    --scrim-bottom: rgba(0, 0, 0, 0.88);
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --ink: #111111;
  --ink-soft: #5c5c5c;
  --accent: #111111;
  --accent-ink: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e2e2;
  --scrim-top: rgba(0, 0, 0, 0);
  --scrim-bottom: rgba(0, 0, 0, 0.82);
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #151515;
  --ink: #f2f2f2;
  --ink-soft: #a3a3a3;
  --accent: #f2f2f2;
  --accent-ink: #111111;
  --card-bg: #171717;
  --border: #2a2a2a;
  --scrim-top: rgba(0, 0, 0, 0);
  --scrim-bottom: rgba(0, 0, 0, 0.88);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}

.header-inner-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.header-inner-split .brand {
  justify-self: center;
  text-align: center;
}

.header-inner-split .nav-right {
  justify-self: end;
}

@media (max-width: 720px) {
  .header-inner {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .header-inner-split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    row-gap: 10px;
    column-gap: 16px;
  }
  .header-inner-split .brand {
    order: -1;
    flex-basis: 100%;
    text-align: center;
    font-size: 0.92rem;
  }
  .header-inner-split .nav,
  .header-inner-split .nav-right {
    justify-self: unset;
    gap: 16px;
  }
  .header-inner-split .nav-right a {
    white-space: nowrap;
  }
}

@media (max-width: 460px) {
  .header-inner-split {
    column-gap: 10px;
  }
  .header-inner-split .nav,
  .header-inner-split .nav-right {
    gap: 10px;
  }
  .header-inner-split .nav a,
  .header-inner-split .nav-right a,
  .header-inner-split .brand {
    font-size: 0.8rem;
  }
  .theme-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.01em;
  text-transform: none;
  font-size: 1.05rem;
}

.brand-lg {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.nav { display: flex; align-items: center; gap: 32px; }
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.nav a:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.theme-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}

.theme-btn:hover { color: var(--ink); }

.theme-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}


.btn {
  display: inline-block;
  padding: 15px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  border: 1px solid var(--ink);
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { border-color: var(--border); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }

.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 800;
}

.substack-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* Featured post — big split layout, like a "NEW VIBES" feature block */
.featured-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 760px) {
  .featured-split {
    grid-template-columns: 1fr;
  }
}

.featured-copy { display: flex; flex-direction: column; gap: 16px; }

.featured-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.featured-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.featured-title a {
  text-decoration: none;
  color: inherit;
}

.featured-title a:hover {
  text-decoration: underline;
}

.featured-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 46ch;
}

.featured-copy .btn { align-self: flex-start; }

.featured-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.featured-byline img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.featured-media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

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

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.post-card:hover {
  border-color: var(--ink);
}

.post-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
}

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

.post-body { padding: 16px 18px 20px; }

.post-date {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  font-weight: 700;
}

.post-excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.posts-status {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.tool-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--ink-soft);
}

.about-grid {
  display: grid;
  align-items: start;
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.about-copy p { margin: 0; text-align: justify; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a,
.footer-contact-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.footer-contact-link {
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  padding-left: 0;
  padding-right: 0;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
