:root {
  --tomato: #ff4f40;
  --lavender-grey: #d7dce4;
  --powder-blue: #dfeaf6;
  --cool-steel: #7f93a2;
  --space-indigo: #112231;
  --paper: #f7faf8;
  --ink: #182532;
  --muted: #5d6a73;
  --line: #dce3e5;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

a {
  color: var(--space-indigo);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--tomato);
}

.page-frame {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, 0.94);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.25rem;
}

.site-mark {
  color: var(--space-indigo);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.2;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--tomato);
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

.page-content {
  min-height: calc(100vh - 12rem);
  padding-block: 4.5rem 6rem;
}

.home-intro {
  position: relative;
  max-width: 58rem;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(127, 147, 162, 0.62);
  border-radius: 2rem;
  margin-bottom: 3.5rem;
  padding: 3rem 2rem 4rem;
  text-align: center;
  box-shadow: 0 1.5rem 0 rgba(17, 34, 49, 0.06);
  background:
    linear-gradient(180deg, rgba(223, 234, 246, 0.78), transparent 70%),
    var(--paper);
}

.home-intro::before {
  position: absolute;
  top: -10rem;
  right: -7rem;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223, 234, 246, 0.95) 0, rgba(223, 234, 246, 0.5) 35%, transparent 68%);
  content: "";
  filter: blur(10px);
  pointer-events: none;
}

.home-intro::after {
  position: absolute;
  bottom: -12rem;
  left: -8rem;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 79, 64, 0.16) 0, rgba(255, 79, 64, 0.06) 42%, transparent 70%);
  content: "";
  filter: blur(12px);
  pointer-events: none;
}

.home-intro > * {
  position: relative;
  z-index: 1;
}

.home-intro .eyebrow {
  justify-content: center;
}

.home-intro h1 {
  margin-inline: auto;
}

.home-intro p {
  margin-inline: auto;
}

.home-intro .home-actions,
.home-intro .social-links {
  justify-content: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  color: var(--tomato);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--space-indigo);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 12ch;
  margin: 0 0 1.25rem;
  font-size: clamp(3rem, 8vw, 6.5rem);
}

h2 {
  font-size: 2rem;
}

p {
  max-width: 68ch;
  margin: 0 0 1.15rem;
}

.lede {
  max-width: 38rem;
  color: var(--space-indigo);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  line-height: 1.35;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-block: 2rem 1.5rem;
}

.icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-small {
  width: 0.82rem;
  height: 0.82rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--space-indigo);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--space-indigo);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
}

.button:hover {
  border-color: var(--tomato);
}

.button-primary {
  border-color: var(--tomato);
  background: var(--tomato);
  color: var(--white);
}

.button-primary:hover {
  background: var(--space-indigo);
  border-color: var(--space-indigo);
  color: var(--white);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.home-grid {
  display: grid;
  margin-top: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.8fr);
  gap: 2rem;
  align-items: start;
}

.home-section-writing {
  padding-right: 1rem;
}

.home-section.home-section-labs {
  border: 1px solid var(--line);
  border-top: 3px solid var(--tomato);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.42);
}

.home-section {
  position: relative;
  border-top: 1px solid var(--cool-steel);
  padding-top: 1.5rem;
}

.home-section-writing {
  min-height: 22rem;
  padding-right: 1rem;
}

.home-section-labs {
  border-radius: 1.25rem;
  box-shadow: 0 1rem 2rem rgba(17, 34, 49, 0.05);
}

.content-list li {
  transition: background-color 160ms ease, transform 160ms ease;
}

.content-list li:hover {
  border-radius: 0.7rem;
  background: rgba(223, 234, 246, 0.48);
  transform: translateX(0.35rem);
}

.home-section::before,
.eyebrow::before {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--tomato);
  content: "";
}

.home-section::before {
  position: absolute;
  top: -0.25rem;
  left: 0;
}

.section-heading .eyebrow::before {
  display: none;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.section-heading .eyebrow {
  margin-bottom: 0;
}

.section-heading > a {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
}

.section-intro {
  min-height: 0;
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-size: 0.98rem;
}

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

.content-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1rem;
}

.content-list time {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
}

.content-list a {
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-footer p {
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: 0.5rem;
  text-align: center;
}

.site-footer a {
  color: inherit;
}

@media (max-width: 42rem) {
  .page-frame {
    width: min(100% - 1.5rem, 70rem);
  }

  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .site-nav {
    gap: 0.8rem 1rem;
  }

  .page-content {
    padding-block: 3rem 4rem;
  }

  .home-intro {
    border-radius: 1.25rem;
    margin-bottom: 2.5rem;
    padding: 2rem 1rem 3rem;
  }

  .home-section-writing {
    min-height: 0;
    padding-right: 0;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.5rem);
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .content-list li {
    grid-template-columns: 5.5rem 1fr;
    gap: 0.7rem;
  }
}


/* Compatibility utilities for existing non-home templates. */
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-bold { font-weight: 700; }
.text-muted { color: var(--muted); }
.text-dark { color: var(--ink); }
.text-decoration-none { text-decoration: none; }
.text-uppercase { text-transform: uppercase; }
.fs-5 { font-size: 1.25rem; }
.fs-6 { font-size: 1rem; }
.h5 { font-size: 1.35rem; }
.h6 { font-size: 1rem; }

.d-flex { display: flex; }
.gap-4 { gap: 1.5rem; }
.align-items-baseline { align-items: baseline; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.me-auto { margin-inline-end: auto; }
.ms-2 { margin-inline-start: 0.5rem; }
.me-1 { margin-inline-end: 0.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }
.ps-3 { padding-inline-start: 1rem; }

.border { border: 1px solid var(--line); }
.border-bottom { border-bottom: 1px solid var(--line); }

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

.list-group {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-group-item {
  position: relative;
  display: block;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.list-group-numbered {
  counter-reset: list-item;
}

.list-group-numbered > .list-group-item {
  counter-increment: list-item;
  padding-inline-start: 2rem;
}

.list-group-numbered > .list-group-item::before {
  position: absolute;
  left: 0;
  color: var(--muted);
  content: counter(list-item) ".";
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
}

.text-bg-light {
  background: var(--paper);
  color: var(--muted);
}

.bg-primary {
  background: var(--tomato);
  color: var(--white);
}

.bg-secondary {
  background: var(--cool-steel);
  color: var(--white);
}

.rounded-pill {
  border-radius: 999px;
}

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.g-4 {
  gap: 1.5rem;
}

.col-sm-7,
.col-sm-5 {
  grid-column: span 12;
}

@media (min-width: 42rem) {
  .col-sm-7 { grid-column: span 7; }
  .col-sm-5 { grid-column: span 5; }
}
