/* ============================================================
   Open Set Solutions — styles.css
   Warm minimal · light with dark bands · open-set identity
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --paper:      #FBF8F2;   /* warm off-white                  */
  --paper-2:    #F4EEE2;   /* card / inset surface            */
  --ink:        #1C1A16;   /* warm near-black                 */
  --ink-soft:   #5B544B;   /* muted body                      */
  --ink-faint:  #8C857A;   /* captions, meta                  */
  --line:       rgba(28, 26, 22, 0.12);
  --line-soft:  rgba(28, 26, 22, 0.07);
  --accent:     #CF6A43;   /* terracotta                      */
  --accent-ink: #B4552F;   /* accent on light, for text       */
  --accent-soft:rgba(207, 106, 67, 0.12);
  --dark:       #1A1813;   /* dark band background            */
  --dark-2:     #232017;
  --on-dark:    #F4EFE6;   /* text on dark                    */
  --on-dark-soft: #B9B1A2;

  --maxw: 1160px;
  --pad: clamp(20px, 5vw, 56px);
  --radius: 14px;

  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(16px, 1.05vw + 13px, 18px);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(72px, 11vw, 140px); }
.band { padding-block: clamp(64px, 9vw, 120px); }

/* ---------- Focus / a11y ---------- */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.band--dark :focus-visible { outline-color: #E89B79; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- Typographic atoms ---------- */
.eyebrow,
.label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.label { color: var(--ink-faint); }
.label--invert { color: var(--on-dark-soft); }
.eyebrow__mark { color: var(--accent); margin-right: 0.3em; }

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw + 0.5rem, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.wordmark__glyph {
  display: inline-flex;
  color: var(--ink);
}
.wordmark__glyph .g-ring { transition: transform 0.8s var(--ease); transform-origin: center; }
.wordmark:hover .g-ring { transform: rotate(36deg); }
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  line-height: 1;
}
.wordmark__text span { font-weight: 500; color: var(--ink-soft); }

/* nav */
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 38px);
}
.nav__list a {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav__list a:hover { color: var(--ink); }
.nav__cta {
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper) !important;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600 !important;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav__cta:hover { background: var(--accent-ink); transform: translateY(-1px); }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.32s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(92vh, 860px);
  padding-block: clamp(80px, 14vh, 160px) clamp(60px, 10vh, 120px);
  overflow: hidden;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; max-width: 860px; }

.hero__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.7rem, 8vw + 0.5rem, 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-top: 22px;
  text-wrap: balance;
}
.hero__lede {
  margin-top: 26px;
  max-width: 38ch;
  font-size: clamp(1.06rem, 1.4vw + 0.6rem, 1.32rem);
  color: var(--ink-soft);
  line-height: 1.55;
  text-wrap: pretty;
}
.hero__actions {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 1;
}
.hero__scroll-line {
  display: block;
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: scrollPulse 2.4s var(--ease) infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: 1;   transform-origin: top; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-ink); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn--lg {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.4vw, 1.18rem);
  padding: 18px 34px;
  letter-spacing: -0.01em;
}

/* ============================================================
   DARK BANDS
   ============================================================ */
.band--dark {
  background: var(--dark);
  color: var(--on-dark);
  position: relative;
}
.band--dark::before {
  /* faint dashed-ring motif */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 88% 18%, rgba(207,106,67,0.10), transparent 42%);
  pointer-events: none;
}

/* Definition band */
.definition__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
  position: relative;
}
.definition__term {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.definition__term em {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-soft);
  text-transform: uppercase;
}
.definition__body {
  font-size: clamp(1.15rem, 2.1vw + 0.4rem, 1.7rem);
  line-height: 1.45;
  color: var(--on-dark);
  text-wrap: pretty;
}
.definition__body .hl { color: #fff; }
.definition__body .hl {
  background-image: linear-gradient(transparent 62%, rgba(207,106,67,0.32) 0);
}

/* ============================================================
   SERVICES
   ============================================================ */
.section__head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section__head .section__title { margin-top: 16px; }
.section__intro {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.2vw + 0.6rem, 1.2rem);
  max-width: 56ch;
  text-wrap: pretty;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
}
.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 38px);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.card::after {
  /* open dashed-ring corner accent that "opens up" on hover */
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 96px;
  height: 96px;
  border: 1.5px dashed var(--line);
  border-radius: 50%;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 18px 40px -24px rgba(28,26,22,0.35);
}
.card:hover::after { transform: scale(1.35) rotate(24deg); border-color: var(--accent); }
.card__no {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-ink);
  letter-spacing: 0.05em;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.34rem;
  letter-spacing: -0.015em;
  margin-top: 18px;
}
.card__body {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}
.about__intro .section__title { margin-top: 16px; }
.about__intro { position: sticky; top: 100px; }
.about__body p { color: var(--ink-soft); text-wrap: pretty; }
.about__body p + p { margin-top: 18px; }
.about__body .lead-in { color: var(--ink); font-weight: 600; }
.about__body em { font-style: italic; color: var(--accent-ink); }

.principles {
  margin-top: 34px;
  border-top: 1px solid var(--line);
}
.principles li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.principles__k {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.principles__v { color: var(--ink-soft); font-size: 0.98rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact__inner { max-width: 760px; }
.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw + 0.5rem, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-top: 18px;
  text-wrap: balance;
}
.contact__body {
  margin-top: 22px;
  color: var(--on-dark-soft);
  font-size: clamp(1.05rem, 1.4vw + 0.6rem, 1.28rem);
  max-width: 52ch;
  text-wrap: pretty;
}
.contact .btn--primary { margin-top: 36px; }
.contact .btn--lg { font-family: "JetBrains Mono", ui-monospace, monospace; }
.contact .btn--lg:hover { transform: translateY(-2px) scale(1.01); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark-2);
  color: var(--on-dark-soft);
  padding-block: clamp(40px, 6vw, 64px);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}
.site-footer .wordmark { color: var(--on-dark); }
.site-footer .wordmark__glyph { color: var(--on-dark); }
.wordmark--sm .wordmark__text { font-size: 1rem; }
.site-footer .wordmark__text span { color: var(--on-dark-soft); }
.footer-note {
  font-size: 0.92rem;
  color: var(--on-dark-soft);
}
.footer-legal {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--on-dark-soft);
  opacity: 0.8;
}

/* ============================================================
   RESPONSIVE — mobile nav + stacking
   ============================================================ */
@media (max-width: 800px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
    box-shadow: 0 24px 40px -28px rgba(28,26,22,0.5);
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--pad) 24px;
  }
  .nav__list li { border-bottom: 1px solid var(--line-soft); }
  .nav__list li:last-child { border-bottom: 0; }
  .nav__list a {
    display: block;
    padding: 16px 0;
    font-size: 1.12rem;
  }
  .nav__cta {
    justify-content: center;
    margin-top: 14px;
    padding: 15px 18px;
    font-size: 1.05rem !important;
  }

  .definition__inner { grid-template-columns: 1fr; gap: 22px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__intro { position: static; }
}

@media (max-width: 520px) {
  .header-inner { height: 64px; }
  .nav { inset-block-start: 64px; }
  .wordmark__text { font-size: 1rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  .principles li { grid-template-columns: 1fr; gap: 4px; }
  .footer-legal { margin-left: 0; width: 100%; }
}

/* ---------- Reveal-on-scroll (progressive enhancement) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll-line { animation: none; }
  .wordmark .g-ring { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ============================================================
   BLOG — listing + article (blog.html, posts/*.html)
   ============================================================ */
.page-hero {
  padding-block: clamp(116px, 17vh, 210px) clamp(38px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw + 0.5rem, 4.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-top: 16px;
  text-wrap: balance;
}
.page-hero__lede {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.3vw + 0.6rem, 1.28rem);
  text-wrap: pretty;
}

/* listing */
.post-list { border-top: 1px solid var(--line); }
.post-row { border-bottom: 1px solid var(--line); }
.post-row__link {
  display: block;
  padding: clamp(28px, 4vw, 46px) 0;
}
.post-row__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.post-row__tag { color: var(--accent-ink); }
.post-row__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 10px;
  max-width: 26ch;
  text-wrap: balance;
  transition: color 0.2s var(--ease);
}
.post-row__excerpt {
  margin-top: 12px;
  color: var(--ink-soft);
  max-width: 64ch;
  text-wrap: pretty;
}
.post-row__more {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  font-weight: 600;
  color: var(--accent-ink);
}
.post-row__more span { transition: transform 0.2s var(--ease); }
.post-row__link:hover .post-row__title { color: var(--accent-ink); }
.post-row__link:hover .post-row__more span { transform: translateX(5px); }

/* article */
.article { padding-block: clamp(110px, 15vh, 200px) clamp(60px, 9vw, 110px); }
.article__inner { max-width: 760px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--ink); }
.back-link span { transition: transform 0.2s var(--ease); }
.back-link:hover span { transform: translateX(-4px); }
.article__meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-top: 30px;
}
.article__meta .tag { color: var(--accent-ink); }
.article__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw + 0.5rem, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-top: 14px;
  text-wrap: balance;
}
.article__lede {
  margin-top: 20px;
  font-size: clamp(1.14rem, 1.6vw + 0.6rem, 1.42rem);
  color: var(--ink-soft);
  line-height: 1.5;
  text-wrap: pretty;
}

.prose { margin-top: 42px; line-height: 1.75; }
.prose > * + * { margin-top: 22px; }
.prose p { color: var(--ink); text-wrap: pretty; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin-top: 44px;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  margin-top: 32px;
}
.prose ul { padding-left: 0; }
.prose li {
  position: relative;
  padding-left: 26px;
  margin-top: 10px;
  color: var(--ink);
}
.prose li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose figure {
  margin: 32px 0;
}
.prose figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 48px rgba(28, 26, 22, 0.08);
}
.prose figcaption {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 0.86rem;
  line-height: 1.5;
}
.prose .case-study-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.prose .case-study-grid > figure {
  margin: 0;
}
.prose .case-study-grid--phone {
  align-items: start;
}
.prose .case-study-grid--phone figure {
  justify-self: center;
  max-width: 320px;
}
.prose .case-study-grid--phone img {
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top;
}
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 22px;
  margin-top: 30px;
  font-size: 1.22rem;
  font-style: italic;
  color: var(--ink-soft);
}
.prose strong { font-weight: 600; }
.article__foot {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.article__foot .back-link { color: var(--accent-ink); }

@media (max-width: 720px) {
  .prose .case-study-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   EFFECTS — quiet details that extend the open-set motif
   (scroll-progress ring, hero entrance, ε-neighborhood figure,
   highlight sweep, card spotlight, section thread)
   ============================================================ */

/* ---------- Wordmark ring as scroll progress ---------- */
.g-ring--progress { opacity: 0.95; }

/* ---------- Hero entrance (one-time, on load) ---------- */
.hero__line {
  display: block;
  overflow: hidden;
  /* keep descenders un-clipped at line-height 0.98 */
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.hero__line-inner {
  display: block;
  transform: translateY(112%);
  animation: heroRise 0.85s var(--ease) forwards;
}
.hero__line:nth-child(2) .hero__line-inner { animation-delay: 0.12s; }

.hero .eyebrow,
.hero__lede,
.hero__actions {
  opacity: 0;
  animation: heroFade 0.7s var(--ease) forwards;
}
.hero .eyebrow  { animation-delay: 0.05s; }
.hero__lede     { animation-delay: 0.45s; }
.hero__actions  { animation-delay: 0.6s; }

@keyframes heroRise {
  to { transform: none; }
}
@keyframes heroFade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Definition: highlight sweep on reveal ---------- */
.definition__inner.reveal .hl {
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition: background-size 1.1s var(--ease) 0.35s;
}
.definition__inner.reveal.is-in .hl { background-size: 100% 100%; }

/* ---------- Definition: ε-neighborhood figure ---------- */
.definition__figure {
  margin: clamp(28px, 4vw, 44px) 0 0;
  max-width: 240px;
}
.definition__figure svg { width: 100%; height: auto; overflow: visible; }
.definition__figure figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

.figure-region {
  fill: rgba(207, 106, 67, 0.05);
  stroke: rgba(244, 239, 230, 0.32);
  stroke-width: 1.3;
  stroke-dasharray: 3 6;
  stroke-linecap: round;
  animation: dashCrawl 60s linear infinite;
}
@keyframes dashCrawl {
  to { stroke-dashoffset: -180; }
}

.figure-drift { animation: pointDrift 18s ease-in-out infinite; }
@keyframes pointDrift {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(36px, 30px); }
  66%      { transform: translate(-4px, 44px); }
}

.figure-nbhd--a {
  fill: rgba(207, 106, 67, 0.06);
  stroke: rgba(207, 106, 67, 0.7);
  stroke-width: 1.2;
  stroke-dasharray: 2.5 5;
  stroke-linecap: round;
}
.figure-radius {
  stroke: rgba(207, 106, 67, 0.5);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.figure-eps {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #E89B79;
}
.figure-pt--a { fill: var(--accent); }

.figure-nbhd--b {
  fill: none;
  stroke: rgba(244, 239, 230, 0.45);
  stroke-width: 1.1;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  animation: nbhdBreathe 6s ease-in-out infinite;
}
@keyframes nbhdBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
.figure-pt--b { fill: rgba(244, 239, 230, 0.75); }

@media (max-width: 800px) {
  .definition__figure { max-width: 190px; margin-top: 24px; }
}

/* ---------- Card spotlight: cursor-tracked border glow ---------- */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(207, 106, 67, 0.55),
    transparent 70%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* ---------- Section thread (01 → 02 → 03) ---------- */
.section-thread {
  position: absolute;
  width: 1px;
  background-image: repeating-linear-gradient(
    to bottom, var(--line) 0 4px, transparent 4px 10px
  );
  pointer-events: none;
  z-index: 1;
}
.section-thread__fill {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, var(--accent) 0 4px, transparent 4px 10px
  );
  clip-path: inset(0 0 calc(100% - var(--thread-p, 0%)) 0);
}
.section-thread__dot {
  position: absolute;
  left: 50%;
  top: var(--thread-p, 0%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

/* ============================================================
   BLOG — listing improvements
   (featured post, generative glyphs, tag filter, row hover,
   prev/next article nav, page-hero entrance)
   ============================================================ */

/* ---------- Page-hero entrance (matches the home hero) ---------- */
.page-hero .label,
.page-hero__title,
.page-hero__lede {
  opacity: 0;
  animation: heroFade 0.7s var(--ease) forwards;
}
.page-hero .label       { animation-delay: 0.05s; }
.page-hero__title       { animation-delay: 0.16s; }
.page-hero__lede        { animation-delay: 0.3s; }

/* ---------- Tag filter chips ---------- */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(26px, 4vw, 40px);
}
.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease);
}
.tag-chip:hover { border-color: var(--ink); color: var(--ink); }
.tag-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- Post rows: glyph + hover wash ---------- */
.post-row__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  position: relative;
  padding-inline: 18px;
  margin-inline: -18px;
  border-radius: 10px;
  transition: background 0.25s var(--ease);
}
.post-row__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.post-row__link:hover { background: rgba(244, 238, 226, 0.55); }
.post-row__link:hover::before { transform: scaleY(1); }

.post-glyph {
  display: block;
  width: clamp(64px, 9vw, 92px);
  color: var(--ink);
}
.post-glyph__svg {
  width: 100%;
  height: auto;
  overflow: visible;
  transition: transform 0.5s var(--ease);
  transform-origin: center;
}
.post-row__link:hover .post-glyph__svg { transform: rotate(9deg); }
.glyph-region {
  fill: rgba(207, 106, 67, 0.05);
  stroke: rgba(28, 26, 22, 0.32);
  stroke-width: 1.3;
  stroke-dasharray: 3 5;
  stroke-linecap: round;
  transition: stroke 0.3s var(--ease);
}
.post-row__link:hover .glyph-region { stroke: var(--accent); }
.glyph-nbhd {
  fill: rgba(207, 106, 67, 0.07);
  stroke: rgba(207, 106, 67, 0.55);
  stroke-width: 1.1;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}
.glyph-dot { fill: rgba(28, 26, 22, 0.5); }
.glyph-dot--accent { fill: var(--accent); }

/* ---------- Featured (newest) post ---------- */
.post-feature { border-bottom: 0; }
.post-list .post-feature + .post-row { border-top: 1px solid var(--line); }
.post-feature__link {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 46px);
  margin-inline: 0;
  margin-block: clamp(22px, 4vw, 40px) clamp(26px, 4vw, 44px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.post-feature__link::before { display: none; }
.post-feature__link:hover {
  background: var(--paper-2);
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 18px 40px -24px rgba(28, 26, 22, 0.35);
}
.post-feature__badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.post-feature__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.post-feature .post-glyph { width: clamp(120px, 16vw, 180px); }

@media (max-width: 560px) {
  .post-row__link { grid-template-columns: 1fr; }
  .post-glyph { display: none; }
  .post-feature .post-glyph {
    display: block;
    width: 104px;
    order: -1;
  }
}

/* ---------- Article prev/next ---------- */
.post-nav {
  margin-top: 56px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0;
}
.post-nav__item--next {
  grid-column: 2;
  text-align: right;
  align-items: flex-end;
}
.post-nav__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.post-nav__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: balance;
  transition: color 0.2s var(--ease);
}
.post-nav__item:hover .post-nav__title { color: var(--accent-ink); }
.post-nav + .article__foot { border-top: 0; margin-top: 8px; }

@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { grid-column: 1; text-align: left; align-items: flex-start; }
}

/* ---------- Reduced motion: settle everything instantly ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__line-inner,
  .hero .eyebrow,
  .hero__lede,
  .hero__actions,
  .page-hero .label,
  .page-hero__title,
  .page-hero__lede {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .post-glyph__svg,
  .post-row__link::before { transition: none; }
  .figure-region,
  .figure-drift,
  .figure-nbhd--b { animation: none; }
  .definition__inner.reveal .hl {
    transition: none;
    background-size: 100% 100%;
  }
  .card::before { transition: none; }
}
