/* CardioAT — clean light, arterial red accents
   Display: Schibsted Grotesk · Body: Instrument Sans · Meta: IBM Plex Mono */

:root {
  --paper: #FCFBFA;
  --ink: #17181C;
  --muted: #5D6167;
  --hairline: #E8E6E2;
  --red: #C8102E;
  --red-deep: #9A0B22;
  --tint: #FCF4F3;
  --display: "Schibsted Grotesk", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(252, 251, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark-spark {
  width: 26px;
  height: 15px;
  color: var(--red);
  flex: none;
}

.wordmark-at { color: var(--red); }

.site-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}

.site-nav a:hover { color: var(--ink); }

.signin {
  color: #B9B4AE;
  display: inline-flex;
  padding: 4px;
  border-radius: 50%;
}

.signin svg { width: 22px; height: 22px; }

.signin:hover { color: var(--ink); }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .signin { margin-left: auto; }
}

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

.hero { padding: 88px 0 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin-bottom: 24px;
}

.hero-at { color: var(--red); }

.hero-oolbox { color: #8F8A84; }

.hero-sub {
  max-width: 620px;
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 22px;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: #A8A39D;
}

.trace {
  margin-top: 26px;
  border-bottom: 1px solid var(--hairline);
}

.trace svg {
  display: block;
  width: 100%;
  height: clamp(64px, 9vw, 120px);
}

#ecg {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2.4s cubic-bezier(0.4, 0, 0.3, 1) 0.2s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #ecg { animation: none; stroke-dashoffset: 0; }
  .card, .card h3::after { transition: none !important; }
}

/* ---------- Directory sections ---------- */

.directory { padding: 72px 0 8px; }

.directory h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.directory .eyebrow { margin-bottom: 10px; }

.section-intro {
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 20px 16px;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.card:hover {
  border-color: #DCA9B0;
  background: var(--tint);
  transform: translateY(-2px);
}

.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card p {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.card-domain {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: #A8A39D;
}

.card-flag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #EFD3D7;
  background: var(--tint);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red-deep);
}

.card-deadline {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red-deep);
}

.card-domain::after {
  content: " ↗";
  color: var(--red);
  opacity: 0;
  transition: opacity 140ms ease;
}

.card:hover .card-domain::after { opacity: 1; }

/* ---------- Score chips ---------- */

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.chip:hover {
  border-color: #DCA9B0;
  background: var(--tint);
  transform: translateY(-2px);
}

.chip strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.chip span {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  color: #A8A39D;
  text-transform: uppercase;
}

.cards-after-chips { margin-top: 4px; }

/* ---------- Latest feed ---------- */

.feed {
  max-height: 540px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #FFFFFF;
}

.feed-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  transition: background 120ms ease;
}

.feed-row:last-of-type { border-bottom: none; }

.feed-row:hover { background: var(--tint); }

.feed-rowmeta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.feed-rowmeta time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.feed-source {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #A8A39D;
}

.feed-title {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
}

.feed-row:hover .feed-title { color: var(--red-deep); }

.feed-badge {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--muted);
  align-self: center;
}

.feed-badge-if {
  border-color: #EFD3D7;
  background: var(--tint);
  color: var(--red-deep);
}

.feed-empty {
  padding: 22px 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.feed-stamp {
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: #A8A39D;
  border-top: 1px solid var(--hairline);
}

@media (max-width: 620px) {
  .feed-row {
    grid-template-columns: 1fr auto;
  }
  .feed-rowmeta {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 10px;
    align-items: baseline;
  }
}

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

.site-footer {
  margin-top: 88px;
  border-top: 1px solid var(--hairline);
  padding: 30px 0 40px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-row p {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 560px;
}

.footer-row strong { color: var(--ink); }

.footer-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #A8A39D;
}
