:root{
  --bg: #0A0A11;
  --bg-glow: #14141F;
  --ink: #F1EFE8;
  --ink-soft: #A9A59C;
  --ink-faint: #6E6A61;
  --line: #26252E;
  --line-strong: #37363F;
  --accent: #D97A44;

  --chip-1-bg: #2A2340; --chip-1-fg: #C7BBEE;
  --chip-2-bg: #1C3327; --chip-2-fg: #A6D9BF;
  --chip-3-bg: #362316; --chip-3-fg: #EFBFA0;
  --chip-4-bg: #33202A; --chip-4-fg: #EEB4CB;
  --chip-5-bg: #1E2C40; --chip-5-fg: #A9C8EE;
  --chip-6-bg: #362B12; --chip-6-fg: #EDCE8E;

  --field-dot: rgba(241, 239, 232, 0.6);
  --field-line: rgba(241, 239, 232, 0.14);

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; }

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

/* no height:100% here — combined with overflow-x:hidden it makes overflow-y
   compute to auto, turning body into a fixed-height clipped box so the page
   can't scroll at all. .page/.blog-page already own the full-height layout
   via min-height:100dvh. */
html{ overflow-x: hidden; color-scheme: dark; }
body{
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(ellipse at top, var(--bg-glow) 0%, var(--bg) 65%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

#bg-field{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.page{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.nav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
  flex-shrink: 0;
}
.wordmark{ color: var(--ink); }
.nav-links{ display: flex; align-items: center; gap: 18px; }
.nav-link{ text-decoration: none; color: var(--ink-soft); }
.nav-link:hover{ color: var(--ink); }
.nav-link:focus-visible{ outline: 1.5px solid var(--ink); outline-offset: 3px; }

.headline{
  margin-top: 36px;
  max-width: 640px;
  flex-shrink: 0;
}
.headline h1{
  font-family: var(--sans);
  font-weight: 400;
  margin: 0;
  font-size: clamp(34px, 5.8vw, 56px);
  line-height: 1.15;
  letter-spacing: 0;
}
#cycle{
  display: inline-block;
  text-align: left;
  white-space: nowrap;
  color: var(--accent);
  transition: opacity 0.25s ease;
}
.mobile-break{ display: none; }
.sub{
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
  max-width: 440px;
  margin: 18px 0 0;
}

.stage{
  position: relative;
  flex: 1;
  min-height: 320px;
  margin-top: 18px;
}

.console{
  flex-shrink: 0;
  border-top: 0.5px solid var(--line);
  padding: 14px 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.console-prompt{ color: var(--accent); }
#console-text{ color: var(--ink); }
.cursor{
  color: var(--ink-faint);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

.frag{
  position: absolute;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  z-index: 4;
  will-change: transform;
}
.frag:active{ cursor: grabbing; }
.frag:focus-visible{ outline: 1.5px solid var(--ink); outline-offset: 2px; }
.frag.is-active{ box-shadow: 0 0 0 1.5px var(--ink) inset; z-index: 5; }

@media (max-width: 560px){
  .page{ padding: 20px 20px 0; }
  .nav{ flex-wrap: wrap; row-gap: 6px; }
  .nav-links{ flex-wrap: wrap; gap: 12px; }
  .headline{ margin-top: 28px; }
  /* smaller pills + a taller stage on phones: 14 fragments at desktop size
     fill a ~350px-wide stage almost completely, so they end up permanently
     in contact and the collisions cancel all their drift out */
  .stage{ min-height: 420px; }
  .frag{ font-size: 10.5px; padding: 4px 9px; }
  .mobile-break{ display: inline; }
}

@media (max-width: 380px){
  .frag{
    font-size: 10px;
    padding: 4px 8px;
    white-space: normal;
    max-width: 46vw;
    line-height: 1.3;
    text-align: center;
  }
}

.site-footer{
  flex-shrink: 0;
  border-top: 0.5px solid var(--line);
  padding: 18px 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-note{
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}
a.footer-note:hover{ color: var(--ink-soft); }
.footer-note svg{ flex-shrink: 0; }
.coffee-link{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 16px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.coffee-link:hover{ color: var(--ink); border-color: var(--ink-faint); }
.coffee-link svg{ width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- blog page ---------- */
.blog-page{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 0;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}
.blog-hero{ margin-top: 64px; max-width: 640px; }
.blog-hero h1{
  font-family: var(--sans);
  font-weight: 400;
  margin: 0;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.05;
}
.blog-hero p{
  font-family: var(--sans);
  color: var(--ink-soft);
  margin: 18px 0 0;
  max-width: 460px;
  font-size: 16px;
}
/* minmax(0, 1fr), not 1fr: a bare 1fr track has an auto minimum, so the
   horizontal carousel's max-content width (every card side by side) forces
   the column — and the whole page — wider than the viewport */
.blog-sections{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 56px;
  row-gap: 0;
}
.blog-section{ margin-top: 52px; min-width: 0; }

@media (min-width: 860px){
  .blog-sections{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-sections .blog-section:nth-child(3){ grid-column: 1 / -1; }
}
.blog-eyebrow{
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.blog-eyebrow.ai{ color: var(--chip-5-fg); }
.blog-eyebrow.sec{ color: var(--chip-2-fg); }
.blog-eyebrow.pm{ color: var(--chip-6-fg); }
.blog-section-head h2{
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  margin: 0 0 40px;
}

/* horizontal, swipe/scroll carousel — one card at a time, centered, no arrows */
.blog-carousel{ position: relative; }
/* plain native horizontal scroller — no touch-action override, so phones
   handle the swipe themselves (horizontal here, vertical to the page) */
.blog-grid{
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: min(390px, 100%);
  padding: 14px 0 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.blog-grid::-webkit-scrollbar{ display: none; }
.blog-card{
  display: block;
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  text-decoration: none;
  color: inherit;
  /* only opacity is animated while scrolling — transform on a snap target
     shifts its own snap position and fights the browser's snap engine, and
     a per-frame blur is far too heavy for a phone */
  opacity: 1;
  will-change: opacity;
}
.blog-card .blog-thumb{
  transition: box-shadow 0.2s ease;
}

.blog-thumb{
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg-glow);
  margin-bottom: 20px;
  transition: transform 0.35s cubic-bezier(.2,.7,.3,1);
}
.blog-card:hover .blog-thumb{ transform: scale(1.015); }
.blog-thumb.placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-thumb.placeholder svg{ width: 34%; height: 34%; opacity: 0.9; }
.blog-thumb.placeholder.ai{ background: linear-gradient(150deg, var(--chip-5-bg), #101826); color: var(--chip-5-fg); }
.blog-thumb.placeholder.sec{ background: linear-gradient(150deg, var(--chip-2-bg), #0f1a14); color: var(--chip-2-fg); }
.blog-thumb.placeholder.pm{ background: linear-gradient(150deg, var(--chip-6-bg), #1c1608); color: var(--chip-6-fg); }
.blog-card-title{
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  transition: color 0.15s ease;
}
.blog-card:hover .blog-card-title{ color: var(--accent); }
.blog-card-excerpt{
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.blog-card-meta{
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 14px;
}

@media (max-width: 720px){
  .blog-page{ padding: 20px 20px 0; }
  .blog-hero{ margin-top: 36px; }
  .blog-section{ margin-top: 44px; }

  /* more compact cards on phones, and narrower than the scrollport so the
     next card peeks in at the edge — that's what makes it read as a swipeable
     carousel instead of a single stacked card */
  .blog-grid{ padding: 10px 0 6px; gap: 12px; scroll-padding-left: 0; }
  .blog-card{ flex: 0 0 82%; width: 82%; }
  .blog-thumb{ aspect-ratio: 2 / 1; border-radius: 12px; margin-bottom: 12px; }
  .blog-card-title{
    font-size: 14.5px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .blog-card-excerpt{ font-size: 12.5px; margin-top: 7px; }
  .blog-card-meta{ font-size: 10px; margin-top: 9px; }
}
