:root {
  --ink: #171717;
  --muted: #66645f;
  --paper: #ffffff;
  --warm: #f5f1ea;
  --line: #ded9d1;
  /* AI•var Cyan — official web/company accent color */
  --accent: #55d8f0;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}
.header-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: block;
  width: 80px;
  height: 26px;
  background-image: url("/assets/aivar-wordmark.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.brand-dot { color: var(--accent); }
nav { display: flex; gap: 22px; align-items: center; }
nav a {
  text-decoration: none;
  font-size: .92rem;
  font-weight: 650;
  color: #333;
}
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }

main { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.hero {
  padding: 92px 0 58px;
  max-width: 860px;
}
.eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
h1, h2, h3 { line-height: 1.12; margin-top: 0; letter-spacing: -0.035em; }
h1 { font-size: clamp(3rem, 7vw, 6.4rem); margin-bottom: 20px; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: 18px; }
h3 { font-size: 1.2rem; }
.lead {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  max-width: 760px;
  color: #343434;
  margin: 0;
}

.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section.compact { padding: 46px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 26px;
}
.section-head p { margin: 0; color: var(--muted); max-width: 560px; }

.comic-frame {
  background: #fff;
  border: 1px solid var(--line);
  padding: clamp(8px, 1.6vw, 18px);
  box-shadow: 0 14px 44px rgba(0,0,0,.055);
}
.comic-frame img { width: 100%; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  border: 1px solid var(--line);
  padding: 24px;
  background: #fff;
  min-height: 180px;
}
.card p { color: var(--muted); margin-bottom: 0; }
.card-link { display: block; height: 100%; text-decoration: none; }
.card-link .card { height: 100%; }
.card-link:hover .card { border-color: #aaa; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-block;
  text-decoration: none;
  font-weight: 750;
  border: 1.5px solid var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
}
.button.primary { background: var(--ink); color: white; }
.button:hover { transform: translateY(-1px); }

.article-hero { padding: 70px 0 32px; max-width: 920px; }
.article-hero h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
.article-meta { color: var(--muted); margin-top: 10px; }
.prose {
  max-width: 780px;
  font-size: 1.08rem;
}
.prose p { margin: 0 0 1.15em; }
.prose strong { font-weight: 750; }
.pullquote {
  margin: 38px 0;
  padding: 26px 0 26px 24px;
  border-left: 4px solid var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.panel-note { border: 1px solid var(--line); padding: 24px; }
.panel-note .n {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink); color: white;
  font-weight: 800;
  margin-bottom: 14px;
}
.panel-note p { margin-bottom: 0; color: #414141; }

.archive-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: center;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.archive-item:first-of-type { border-top: 0; }
.archive-copy p { color: var(--muted); }
.archive-thumb { border: 1px solid var(--line); padding: 8px; background: #fff; }

.note {
  border: 1px solid var(--line);
  background: var(--warm);
  padding: 20px 22px;
  max-width: 780px;
  font-size: .96rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
}
.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .9rem;
}
.footer-inner a { text-decoration: none; }

@media (max-width: 760px) {
  .header-inner { min-height: 66px; }
  nav { gap: 12px; }
  nav a { font-size: .82rem; }
  .hero { padding-top: 64px; }
  .card-grid, .panel-grid { grid-template-columns: 1fr; }
  .archive-item { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
}

@media (max-width: 520px) {
  main, .header-inner, .footer-inner { width: min(100% - 24px, var(--max)); }
  .header-inner { gap: 12px; }
  .brand { width: 64px; height: 21px; }
  nav { gap: 9px; }
  nav a { font-size: .74rem; }
  .hero { padding-top: 48px; }
}
