/* AutoSoft — styles for the home page, research scope and blog.
   Loaded after site.css; keeps the same palette and Fraunces type. */

:root {
  --accent: #3D5A73;
  --rust: #C8553D;
  --paper: #FAFAF8;
  --prose: 1.0625rem;
}

/* Header: a solid, anchored bar at the top of every page */
:root {
  --header-top: 0px;
  --header-h: 4.25rem;
  --header-offset: calc(var(--header-h) + 2.5rem);
}
.site-header {
  top: 0;
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .header-logo { font-size: clamp(1.2rem, 1.8vw, 1.45rem); }
.header-nav { gap: clamp(0.25rem, 1.4vw, 0.9rem); }
.header-nav a {
  position: relative;
  padding: 0.45rem 0.6rem !important;
  border-radius: 4px;
  color: var(--secondary) !important;
}
.header-nav a:hover { color: var(--ink) !important; background: rgba(19, 21, 26, 0.04); }
.header-nav a.active { color: var(--ink) !important; }
.header-nav a.active::after {
  content: '';
  position: absolute;
  left: 0.6rem; right: 0.6rem; bottom: 0.05rem;
  height: 1px;
  background: var(--rust);
}
.header-nav a.nav-contact {
  color: var(--ink) !important;
  border: 1px solid var(--ink);
  margin-left: 0.35rem;
}
.header-nav a.nav-contact:hover { background: var(--ink); color: #fff !important; }

a { color: var(--accent); }

/* ── Home ── */
.home-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--header-offset) 2rem 4rem;
  gap: 1.4rem;
}
.home-hero .artwork {
  width: clamp(300px, 44vw, 520px);
  height: auto;
  mix-blend-mode: multiply;
  opacity: 0.9;
}
.main-statement {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 16ch;
  margin: 0;
}
.hero-sub {
  font-style: normal;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--secondary);
  max-width: 38rem;
  line-height: 1.6;
}
.hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; justify-content: center; margin-top: 0.4rem; }
.btn {
  font-family: 'Fraunces', Georgia, serif;
  font-style: normal;
  font-weight: 400;
  font-size: 0.98rem;
  padding: 0.7rem 1.3rem;
  border-radius: 4px;
  text-decoration: none;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; opacity: 0.85; }
.btn-solid { background: var(--ink); color: #fff; }
.btn-line { border: 1px solid var(--ink); color: var(--ink); }
.status-pill {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--rust);
  border: 1px solid rgba(200, 85, 61, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
}
.tagline { font-size: 0.95rem; color: var(--secondary); letter-spacing: 0.04em; }

.home-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.5rem, 5vw, 3rem) 0;
}
.home-last { padding-bottom: clamp(4rem, 8vw, 6rem); }
.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin-bottom: 1.6rem;
  letter-spacing: -0.01em;
}
.section-body {
  font-style: normal;
  font-size: var(--prose);
  line-height: 1.7;
  max-width: 40rem;
  margin-top: 1.4rem;
}

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.stat {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.stat-num { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 300; line-height: 1; }
.stat-text { font-style: normal; font-size: 0.97rem; line-height: 1.55; color: var(--ink); }
.stat-src { font-size: 0.82rem; color: var(--secondary); margin-top: auto; }

.steps-row { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.steps-row li { display: flex; flex-direction: column; gap: 0.45rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.steps-row b { font-weight: 400; font-style: normal; font-size: 1.15rem; }
.steps-row span:not(.step-n) { font-style: normal; color: var(--secondary); line-height: 1.55; font-size: 0.97rem; }
.step-n { font-size: 0.85rem; color: var(--rust); }

.audience { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.audience div { display: flex; flex-direction: column; gap: 0.45rem; }
.audience b { font-weight: 400; font-style: normal; font-size: 1.1rem; }
.audience span { font-style: normal; color: var(--secondary); line-height: 1.55; font-size: 0.97rem; }

.video { position: relative; aspect-ratio: 16 / 9; margin-top: 1.5rem; max-width: 760px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }

.cta-link {
  font-style: italic;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  text-decoration: none;
  margin-right: 1.2rem;
}
.cta-link:hover { opacity: 0.7; text-decoration: none; }

/* ── Code ── */
.terminal, .code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-style: normal;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}
.terminal { background: var(--ink); color: #E9E7E1; max-width: 760px; }
.code { background: #F2F1EC; color: var(--ink); }
code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-style: normal;
  font-size: 0.88em;
  background: #F2F1EC;
  padding: 0.08em 0.35em;
  border-radius: 3px;
}

/* ── Research scope ── */
.scope { max-width: 760px; margin: clamp(3rem, 6vw, 5rem) auto 3rem; width: 100%; }
.scope .section-title { margin-top: 2.5rem; margin-bottom: 1rem; }
.scope-list { font-style: normal; padding-left: 1.2rem; line-height: 1.7; }
.scope-list li { margin-bottom: 0.8rem; }
.scope-list b, .research-card-desc b { font-weight: 450; }

/* ── Blog ── */
.article-page {
  padding: var(--header-offset) clamp(1.25rem, 5vw, 3rem) clamp(3rem, 6vw, 5rem);
}
.article, .blog-intro, .post-list { max-width: 700px; margin: 0 auto; }
.back-link { font-size: 0.9rem; color: var(--secondary); display: inline-block; margin: 2rem 0 1.5rem; }
.article-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.article-dek { font-style: normal; color: var(--secondary); font-size: 1.12rem; line-height: 1.55; margin-top: 1rem; }
.article-meta { font-style: normal; font-size: 0.85rem; color: var(--secondary); margin-top: 1.2rem; letter-spacing: 0.02em; }

.article p, .article li {
  font-style: normal;
  font-weight: 300;
  font-size: 1.09rem;
  line-height: 1.78;
}
.article p { margin: 0 0 1.3rem; }
.article b { font-weight: 450; }
.article h2 {
  font-weight: 300;
  font-style: italic;
  font-size: 1.65rem;
  margin: 2.8rem 0 1rem;
  letter-spacing: -0.01em;
}
.article ul, .article ol { margin: 0 0 1.4rem 1.3rem; }
.article li { margin-bottom: 0.55rem; }
.article-sign { color: var(--secondary); font-size: 1rem !important; }
.sources-title { font-weight: 400; font-style: normal; font-size: 0.95rem; margin: 2.5rem 0 0.8rem; color: var(--secondary); letter-spacing: 0.04em; text-transform: uppercase; }
.article .sources li { font-size: 0.92rem; line-height: 1.6; color: var(--secondary); }

.rule--broken { border: none; height: 1px; margin: 2.5rem 0; position: relative; background: none; }
.rule--broken::before, .rule--broken::after { content: ''; position: absolute; top: 0; height: 1px; background: var(--rust); width: 44%; }
.rule--broken::before { left: 0; }
.rule--broken::after { right: 0; }
.rule { border: none; height: 1px; background: var(--border); margin: 3rem 0 1.5rem; }

/* Charts */
.chart { margin: 2rem 0 2.2rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { font-style: normal; font-size: 0.88rem; color: var(--secondary); line-height: 1.5; margin-top: 0.6rem; }
.c-ink { fill: var(--ink); }
.c-rust { fill: var(--rust); }
.c-axis { stroke: var(--ink); stroke-width: 1; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.c-rust-line { stroke: var(--rust); stroke-width: 1.5; }
.c-dot { fill: var(--rust); }
.c-dot-ink { fill: var(--accent); }
.c-label { font-family: 'Fraunces', Georgia, serif; font-size: 13px; fill: var(--ink); }
.c-val { font-family: 'JetBrains Mono', monospace; font-size: 12px; fill: var(--ink); }
.c-small { font-family: 'Fraunces', Georgia, serif; font-size: 11.5px; fill: var(--secondary); }
.b-sign { fill: #B9BCC2; }
.b-exp { fill: var(--accent); opacity: 0.8; }
.b-man { fill: #E4E4E0; }
.b-hit { fill: var(--rust); }

/* Blog index */
.blog-intro { margin-top: 2rem; margin-bottom: 2.5rem; }
.post-list { display: flex; flex-direction: column; }
.post-item { display: block; padding: 1.8rem 0; border-top: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.post-item:last-child { border-bottom: 1px solid var(--border); }
.post-item:hover { text-decoration: none; }
.post-item:hover .post-title { color: var(--accent); }
.post-date { font-style: normal; font-size: 0.82rem; color: var(--secondary); letter-spacing: 0.03em; }
.post-title { font-weight: 300; font-style: italic; font-size: 1.6rem; line-height: 1.25; margin: 0.4rem 0 0.5rem; transition: color 0.2s ease; }
.post-dek { font-style: normal; color: var(--secondary); line-height: 1.55; }

/* Footer */
.footer-left { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-note { font-size: 0.82rem; opacity: 0.6; }

@media (max-width: 820px) {
  .stats, .steps-row, .audience { grid-template-columns: 1fr; }
}


/* Product page */
.product-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); max-width: 1200px; margin: 0 auto; width: 100%; }
.product-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  color: inherit; text-decoration: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.product-card:hover { text-decoration: none; border-color: rgba(19,21,26,0.14); box-shadow: 0 8px 28px rgba(19,21,26,0.06); }
.card-top { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.stage-num { font-style: normal; font-size: 0.8rem; color: var(--rust); letter-spacing: 0.06em; text-transform: uppercase; }
.card-sub { color: var(--secondary); font-size: 1rem; }
.product-card .research-card-desc { font-style: normal; line-height: 1.6; }
.product-card .research-card-image { mix-blend-mode: multiply; }

/* Tables in posts */
.vis-table { width: 100%; border-collapse: collapse; font-style: normal; font-size: 0.95rem; }
.vis-table th { text-align: left; font-weight: 400; color: var(--secondary); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--ink); }
.vis-table td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.45; }
.vis-table td:not(:first-child), .vis-table th:not(:first-child) { white-space: nowrap; }
.stage-table td:nth-child(3) { white-space: normal; }
.stage-table { margin: 1.5rem 0 2rem; }
.t-yes { color: var(--accent); }
.t-mid { color: #9A7B3D; }
.t-no { color: var(--rust); }
.stage-status { border-left: 2px solid var(--rust); padding-left: 1rem; color: var(--secondary); font-size: 1rem !important; }
.article h2[id] { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

/* Extra chart text styles */
.c-white-lg { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 20px; fill: #fff; }
.c-white { font-family: 'Fraunces', Georgia, serif; font-size: 12.5px; fill: #fff; opacity: 0.85; }
.c-box { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.c-box-rust { fill: #fff; stroke: var(--rust); stroke-width: 1.5; }

@media (max-width: 960px) {
  .product-cards { grid-template-columns: 1fr; max-width: 560px; }
}
.c-tiny { font-family: "Fraunces", Georgia, serif; font-size: 10.5px; fill: var(--secondary); }

/* Footer (v3) */
.site-footer { padding: 1.4rem clamp(1.25rem, 5vw, 4rem); }
.footer-right { display: flex; gap: 1.1rem; align-items: center; }
.footer-note { font-size: 0.85rem; opacity: 0.6; font-style: normal; }
.mail-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid rgba(255,255,255,0.55); border-radius: 999px;
  padding: 0.42rem 0.95rem; font-style: normal; font-size: 0.9rem !important;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-footer a.mail-btn:hover { background: #fff; color: var(--ink); opacity: 1; }

/* Hover text swap on hero button */
.btn-swap { display: inline-grid; text-align: center; }
.btn-swap > span { grid-area: 1 / 1; transition: opacity 0.2s ease, transform 0.2s ease; }
.btn-swap .swap-b { opacity: 0; transform: translateY(4px); }
.btn-swap:hover .swap-a, .btn-swap:focus-visible .swap-a { opacity: 0; transform: translateY(-4px); }
.btn-swap:hover .swap-b, .btn-swap:focus-visible .swap-b { opacity: 1; transform: translateY(0); }
.btn-swap:hover { background: var(--ink); color: #fff; opacity: 1; }

/* Research page: compact cards */
.research-page .research-intro { height: auto; padding: 2.5rem 0 2.5rem; }
.research-cards { flex: none; max-width: 820px; margin: 0 auto; width: 100%; gap: 1.25rem; }
.research-card { gap: 0.7rem; padding: 1.25rem 1.4rem; }
.research-card-title { font-size: 1.55rem; }
.research-card-desc { font-size: 0.97rem; line-height: 1.55; }
.research-cards .research-card-image { aspect-ratio: 16 / 7; mix-blend-mode: multiply; }
.research-page .scope { margin-top: 2.5rem; }

/* Product card actions */
.product-card:hover { box-shadow: none; border-color: var(--border); }
.card-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-sm { font-size: 0.9rem; padding: 0.55rem 1.05rem; }
.card-more { font-size: 0.95rem; color: var(--accent); }
#results { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

/* ── Mobile menu toggle (hidden on desktop) ── */
.nav-toggle, .nav-burger { display: none; }

/* ── Mobile ── */
@media (max-width: 760px) {
  :root { --header-h: 3.6rem; --header-offset: calc(var(--header-h) + 1.25rem); }

  /* header: logo left, menu button right */
  .site-header,
  .site-header { height: var(--header-h) !important; min-height: 0 !important; padding: 0 1.1rem !important; flex-wrap: nowrap; }
  .site-header .header-logo { font-size: 1.25rem; }
  .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; margin-right: -8px; padding: 0 9px; cursor: pointer;
  }
  .nav-burger span { display: block; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav-toggle:checked + .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle:checked + .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked + .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav-wrap {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(19,21,26,0.06);
    max-height: 0; overflow: hidden; transition: max-height 0.3s var(--ease-out);
  }
  .nav-toggle:checked ~ .nav-wrap { max-height: 22rem; }
  .header-nav { flex-direction: column; align-items: stretch; gap: 0; padding: 0.4rem 1.1rem 1rem; }
  .header-nav a { display: block; padding: 0.85rem 0.2rem !important; font-size: 1.05rem !important; border-radius: 0; border-bottom: 1px solid var(--border); }
  .header-nav li:last-child a { border-bottom: none; }
  .header-nav a.active::after { left: 0.2rem; right: auto; width: 1.5rem; bottom: 0.55rem; }
  .header-nav a.nav-contact { border: 1px solid var(--ink); border-radius: 4px; margin: 0.8rem 0 0; text-align: center; }

  /* hero */
  .home-hero { min-height: 0; padding: calc(var(--header-offset) + 1.5rem) 1.25rem 3rem; gap: 1.1rem; }
  .home-hero .artwork { width: min(78vw, 320px); }
  .main-statement { font-size: 2.05rem; max-width: 15ch; }
  .hero-sub { font-size: 1rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
  .hero-ctas .btn { text-align: center; padding: 0.85rem 1rem; }
  .btn-swap { display: grid; }

  /* sections */
  .home-section { padding: 3rem 1.25rem 0; }
  .home-last { padding-bottom: 3.5rem; }
  .section-title { font-size: 1.75rem; margin-bottom: 1.1rem; }
  .stat { padding: 1.2rem; }
  .cta-link { display: inline-block; margin: 0 1rem 0.6rem 0; }

  /* research + product intro: remove the big gap */
  .research-page { padding: var(--header-offset) 1.1rem 2rem; }
  .research-page .research-intro { padding: 1.5rem 0 1.75rem; min-height: 0; }
  .research-title { font-size: 2.1rem; }
  .research-cards .research-card-image { aspect-ratio: 16 / 8; }
  .product-card .research-card-image { aspect-ratio: 16 / 9; }
  .scope { margin-top: 2rem; }

  /* code blocks wrap instead of running off screen */
  .terminal, .code { white-space: pre-wrap; word-break: break-word; font-size: 0.74rem; padding: 0.9rem 1rem; }

  /* blog */
  .article-page { padding: var(--header-offset) 1.15rem 3rem; }
  .back-link { margin: 1rem 0 1rem; }
  .article-title { font-size: 2rem; }
  .article-dek { font-size: 1.02rem; }
  .article p, .article li { font-size: 1.02rem; line-height: 1.72; }
  .article h2 { font-size: 1.45rem; margin-top: 2.2rem; }
  .post-title { font-size: 1.35rem; }

  /* charts: keep text readable, let wide ones scroll sideways */
  .chart { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-left: -1.15rem; margin-right: -1.15rem; padding: 0 1.15rem; }
  .chart svg { min-width: 540px; }
  .chart figcaption { position: sticky; left: 0; max-width: calc(100vw - 2.3rem); }
  .vis-table { font-size: 0.85rem; min-width: 480px; }

  /* footer */
  .site-footer { padding: 1.2rem 1.15rem; }
  .footer-right { gap: 0.85rem; }
}

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 4px; background: var(--ink); color: #fff !important; transition: opacity 0.2s ease; }
.icon-btn:hover { opacity: 0.8; text-decoration: none; }
.card-actions { align-items: center; }
.card-actions .btn-sm { padding: 0 1.05rem; height: 2.4rem; display: inline-flex; align-items: center; }
