/* ==========================================================================
   Singularity AI — independent AI research commentary
   Palette carried over from the holding page: deep navy ground, glacier blue
   accent. Deliberately restrained and typographic — this is a publication,
   not a product site, so the design leans on rhythm and hierarchy rather
   than decoration.
   ========================================================================== */

:root {
  --ink:            #060910;
  --ink-raised:     #0d131f;
  --ink-panel:      #111a28;
  --line:           rgba(126, 184, 218, 0.14);
  --line-strong:    rgba(126, 184, 218, 0.32);

  --glacier:        #7eb8da;
  --glacier-bright: #a8d4ee;
  --glacier-dim:    rgba(126, 184, 218, 0.10);
  --amber:          #d9a441;

  --text:           #dfe6ef;
  --text-muted:     #94a3b5;
  --text-faint:     #64748b;

  --font-display: Newsreader, Georgia, "Times New Roman", serif;
  --font-body:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 68ch;
  --shell: 1140px;
  --radius: 4px;
  --ease: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--glacier); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--glacier-bright); }

/* Visible focus everywhere — keyboard users should never lose their place. */
:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.measure { max-width: var(--measure); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--glacier); color: var(--ink);
  padding: 10px 18px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 9, 16, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 68px;
}

.wordmark {
  display: inline-flex; align-items: baseline; gap: 9px;
  font-family: var(--font-display);
  font-size: 1.24rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.wordmark__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--glacier);
  box-shadow: 0 0 12px var(--glacier);
  transform: translateY(-2px);
}
.wordmark:hover { color: var(--glacier-bright); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: block; padding: 8px 13px;
  font-size: 0.9rem; color: var(--text-muted);
  text-decoration: none; border-radius: var(--radius);
  transition: color var(--ease), background var(--ease);
}
.nav a:hover { color: var(--text); background: var(--glacier-dim); }
.nav a[aria-current="page"] { color: var(--glacier); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  color: var(--text); padding: 7px 11px; border-radius: var(--radius);
  cursor: pointer; font-size: 1rem;
}

/* --- Hero ---------------------------------------------------------------- */

.hero { padding: 104px 0 80px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; 
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/hero-bg.webp') center / cover no-repeat;
  opacity: 0.15;
  z-index: -1;
}

.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 340px at 12% -10%, rgba(126,184,218,0.12), transparent 70%),
    radial-gradient(560px 300px at 92% 0%, rgba(217,164,65,0.06), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--glacier); margin: 0 0 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.6vw, 4rem);
  line-height: 1.08; font-weight: 500;
  letter-spacing: -0.022em; margin: 0 0 24px;
  max-width: 19ch;
}
.hero h1 em { font-style: italic; color: var(--glacier); }

.hero__lede { font-size: 1.13rem; color: var(--text-muted); margin: 0 0 36px; max-width: 60ch; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: 0.93rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--ease);
}
.btn--primary { background: var(--glacier); color: var(--ink); }
.btn--primary:hover { background: var(--glacier-bright); color: var(--ink); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--glacier); color: var(--glacier); background: var(--glacier-dim); }

/* --- Sections ------------------------------------------------------------ */

.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section--flush { border-bottom: 0; }

.section__head { margin-bottom: 44px; }
.section__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 500; letter-spacing: -0.015em;
  margin: 0 0 12px; line-height: 1.2;
}
.section__head p { color: var(--text-muted); margin: 0; max-width: 62ch; }

/* --- Cards --------------------------------------------------------------- */

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: border-color var(--ease), transform var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.card__index {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--glacier); letter-spacing: 0.12em; display: block; margin-bottom: 14px;
}
.card h3 {
  font-family: var(--font-display); font-size: 1.24rem;
  font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em;
}
.card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* --- Article list -------------------------------------------------------- */

.article-list { list-style: none; margin: 0; padding: 0; }

.article-item { border-bottom: 1px solid var(--line); }
.article-item:first-child { border-top: 1px solid var(--line); }

.article-item a {
  display: grid; grid-template-columns: 128px 1fr; gap: 28px;
  padding: 26px 4px; text-decoration: none; color: inherit;
  transition: background var(--ease), padding-left var(--ease);
}
.article-item a:hover { background: var(--glacier-dim); padding-left: 14px; }

.article-item time {
  font-family: var(--font-mono); font-size: 0.76rem;
  color: var(--text-faint); letter-spacing: 0.06em; padding-top: 5px;
}
.article-item h3 {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 600; margin: 0 0 7px; letter-spacing: -0.01em; color: var(--text);
}
.article-item p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }

.tag {
  display: inline-block; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--glacier); border: 1px solid var(--line-strong);
  border-radius: 100px; padding: 3px 10px; margin-bottom: 10px;
}

/* --- Prose (article pages) ----------------------------------------------- */

.prose { max-width: var(--measure); font-size: 1.06rem; }
.prose h2 {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  margin: 44px 0 14px; letter-spacing: -0.012em; line-height: 1.25;
}
.prose h3 { font-family: var(--font-display); font-size: 1.24rem; margin: 32px 0 10px; }
.prose p { margin: 0 0 20px; color: #cdd6e2; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 22px; color: #cdd6e2; }
.prose li { margin-bottom: 9px; }
.prose blockquote {
  margin: 28px 0; padding: 4px 0 4px 22px;
  border-left: 2px solid var(--glacier);
  color: var(--text-muted); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: 0.87em;
  background: var(--ink-panel); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 3px; color: var(--glacier-bright);
}

.article-header { padding: 72px 0 36px; border-bottom: 1px solid var(--line); }
.article-header h1 {
  font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.14; margin: 14px 0 18px;
  max-width: 24ch;
}
.article-meta {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 16px;
}

.backlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-muted); text-decoration: none; margin-bottom: 8px;
}
.backlink:hover { color: var(--glacier); }

/* --- Callout ------------------------------------------------------------- */

.note {
  background: var(--ink-panel); border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius); padding: 20px 24px; margin: 32px 0;
}
.note p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }
.note strong { color: var(--text); }

/* --- Stats --------------------------------------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; }
.stat { border-left: 2px solid var(--line-strong); padding-left: 18px; }
.stat__value {
  font-family: var(--font-display); font-size: 2.1rem;
  font-weight: 600; color: var(--glacier); line-height: 1; margin-bottom: 7px;
}
.stat__label { font-size: 0.86rem; color: var(--text-muted); }

/* --- Footer -------------------------------------------------------------- */

.footer { padding: 56px 0 40px; background: var(--ink-raised); border-top: 1px solid var(--line); }
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer h4 {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 16px; font-weight: 500;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--text-muted); text-decoration: none; font-size: 0.92rem; }
.footer a:hover { color: var(--glacier); }
.footer__blurb { color: var(--text-muted); font-size: 0.92rem; max-width: 42ch; margin: 14px 0 0; }
.footer__base {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: 0.84rem; color: var(--text-faint);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-raised); border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px;
  }
  .masthead.is-open .nav { display: flex; }
  .nav a { padding: 12px 0; }
  .hero { padding: 68px 0 56px; }
  .section { padding: 60px 0; }
  .article-item a { grid-template-columns: 1fr; gap: 8px; }
  .article-item time { padding-top: 0; }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* Logo image in wordmark */
.wordmark__logo {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5em;
  border-radius: 50%;
}
