/* ==========================================================================
   C.A.R.E. — Co-Parenting Access and Records Exchange
   Shared stylesheet
   Palette derived from the logo: terracotta #B85930, amber #D8922E.
   ========================================================================== */

:root {
  --terracotta: #B85930;
  --terracotta-deep: #9A4726;
  --amber: #D8922E;
  --ink: #14100E;
  --ink-soft: #2A2320;
  --slate: #56504C;
  --mist: #918A84;
  --cloud: #E3DFDA;
  --fog: #F7F5F2;
  --paper: #FFFFFF;
  --success: #2E7D4F;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --measure: 68ch;
  --shell: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

/* --- Type ---------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 112%;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); font-stretch: 100%; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; font-stretch: 100%; letter-spacing: 0; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
a { color: var(--terracotta); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta-deep); }

strong { font-weight: 600; }

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

.lede {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.5;
  color: var(--slate);
}

/* Sequence label — the site is structured like the record it describes,
   so section markers are seq numbers, not decoration. */
.seq {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.4rem;
}
.seq::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cloud);
}
.seq--light { color: var(--amber); }
.seq--light::after { background: rgba(255,255,255,.16); }

/* --- Shell --------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--fog { background: var(--fog); }
.section--ink { background: var(--ink); color: var(--fog); }
.section--ink h2, .section--ink h3 { color: var(--paper); }
.section--ink p { color: #C8C0BA; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.rule { height: 1px; background: var(--cloud); border: 0; margin: 0; }

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cloud);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 68px;
}
.masthead__logo { display: flex; align-items: center; }
.masthead__logo img { height: 30px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.9rem); }
.nav a {
  font-family: var(--display);
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--terracotta); }
.nav a[aria-current='page'] { color: var(--terracotta); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--cloud);
  border-radius: 6px;
  padding: .45rem .7rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav {
    display: none;
    position: absolute;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--cloud);
    padding: .5rem var(--gutter) 1.25rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .7rem 0; width: 100%; border-bottom: 1px solid var(--fog); }
  .nav__toggle { display: block; }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 600;
  padding: .8rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--primary { background: var(--terracotta); color: var(--paper); }
.btn--primary:hover { background: var(--terracotta-deep); color: var(--paper); }
.btn--ghost { border-color: var(--cloud); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--terracotta); color: var(--terracotta); }
.btn--onink { background: var(--amber); color: var(--ink); }
.btn--onink:hover { background: #E8A845; color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

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

.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--terracotta);
}
.hero__note {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--mist);
  margin-top: 1.5rem;
  line-height: 1.6;
}

/* --- Signature: the event chain ------------------------------------------ */

.chain {
  background: var(--ink);
  border-radius: 12px;
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: 0 24px 48px -28px rgba(20,16,14,.55);
}
.chain__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mist);
  padding-bottom: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: .35rem;
}
.chain__head span:last-child { color: var(--amber); }

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

.entry {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: .9rem;
  padding: .78rem 0;
  position: relative;
  opacity: 0;
  animation: entry-in .5s ease forwards;
}
.entry + .entry { border-top: 1px solid rgba(255,255,255,.07); }
.entry:nth-child(1) { animation-delay: .15s; }
.entry:nth-child(2) { animation-delay: .35s; }
.entry:nth-child(3) { animation-delay: .55s; }
.entry:nth-child(4) { animation-delay: .75s; }
.entry:nth-child(5) { animation-delay: .95s; }

@keyframes entry-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.entry__seq {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--amber);
  padding-top: .15rem;
  position: relative;
}
/* The spine: each entry links to the one before it. */
.entry__seq::before {
  content: '';
  position: absolute;
  left: -.62rem;
  top: -.85rem;
  bottom: -.85rem;
  width: 1px;
  background: rgba(216,146,46,.32);
}
.entry:first-child .entry__seq::before { top: .4rem; }
.entry:last-child .entry__seq::before { bottom: 50%; }
.entry__seq::after {
  content: '';
  position: absolute;
  left: -.86rem;
  top: .4rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.entry__type {
  font-family: var(--mono);
  font-size: .84rem;
  color: var(--paper);
  margin: 0 0 .2rem;
  max-width: none;
}
.entry__meta {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--mist);
  margin: 0;
  max-width: none;
  overflow-wrap: anywhere;
}
.entry--new .entry__type { color: var(--amber); }

.chain__foot {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--mist);
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: .9rem;
  margin-top: .35rem;
  line-height: 1.6;
}

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

.grid { display: grid; gap: 1.15rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--cloud);
  border-radius: 10px;
  padding: 1.5rem 1.45rem;
}
.card h3 { margin-bottom: .45rem; }
.card p { font-size: .98rem; color: var(--slate); margin-bottom: 0; }
.card--onfog { background: var(--paper); }
.card--onink {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.12);
}
.card--onink p { color: #C0B8B2; }

/* Status badges — every feature says plainly whether it exists yet. */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .22rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
}
.badge--live { background: rgba(46,125,79,.12); color: var(--success); }
.badge--soon { background: rgba(216,146,46,.16); color: #9A6410; }
.badge--onink.badge--live { background: rgba(120,220,160,.14); color: #7FD9A6; }
.badge--onink.badge--soon { background: rgba(216,146,46,.18); color: var(--amber); }

.card__head {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: .45rem;
}
.card__head h3 { margin: 0; }

/* --- Comparison table ---------------------------------------------------- */

.table-wrap { overflow-x: auto; margin-top: 2rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .97rem;
  min-width: 560px;
}
th, td {
  text-align: left;
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--cloud);
  vertical-align: top;
}
thead th {
  font-family: var(--display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mist);
  border-bottom-color: var(--ink);
}
tbody th {
  font-family: var(--body);
  font-weight: 600;
  width: 34%;
}
td { color: var(--slate); }

/* --- Prose (legal pages) ------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cloud);
}
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose h3 { margin-top: 1.9rem; font-size: 1.08rem; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.25rem; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--terracotta); }

.doc-meta {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--mist);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.notice {
  border-left: 3px solid var(--amber);
  background: var(--fog);
  padding: 1.1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 2.25rem;
}
.notice p { margin-bottom: 0; font-size: .95rem; color: var(--slate); }
.notice p + p { margin-top: .7rem; }
.notice strong { color: var(--ink); }

.notice--legal { border-left-color: var(--terracotta); }

.toc {
  background: var(--fog);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 2.5rem;
}
.toc h2 {
  font-size: .78rem !important;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 .75rem !important;
  padding: 0 !important;
  border: 0 !important;
}
.toc ol { margin: 0; padding-left: 1.15rem; columns: 2; column-gap: 2rem; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: .3em; font-size: .93rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* --- Pricing ------------------------------------------------------------- */

.plan {
  border: 1px solid var(--cloud);
  border-radius: 12px;
  padding: 1.9rem 1.7rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.plan--feature { border-color: var(--terracotta); border-width: 2px; }
.plan__name {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: .9rem;
}
.plan__price {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: .3rem;
}
.plan__price small {
  font-size: .95rem;
  font-weight: 500;
  color: var(--mist);
  letter-spacing: 0;
}
.plan__blurb { font-size: .95rem; color: var(--slate); margin-bottom: 1.4rem; }
.plan ul { list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: .95rem; }
.plan li {
  padding: .5rem 0 .5rem 1.5rem;
  position: relative;
  border-top: 1px solid var(--fog);
  color: var(--slate);
}
.plan li::before {
  content: '';
  position: absolute;
  left: 0; top: .95rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
}
.plan .btn { margin-top: auto; justify-content: center; }

/* --- Roadmap timeline ---------------------------------------------------- */

.stage { border-top: 1px solid var(--cloud); padding: 1.9rem 0; }
.stage__grid {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 2rem;
}
@media (max-width: 780px) {
  .stage__grid { grid-template-columns: 1fr; gap: .5rem; }
}
.stage__label {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terracotta);
  padding-top: .3rem;
}
.stage__label span { display: block; color: var(--mist); margin-top: .3rem; }
.stage ul { list-style: none; margin: 0; padding: 0; }
.stage li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--fog);
  display: flex;
  gap: .8rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.stage li:last-child { border-bottom: 0; }
.stage li b { font-weight: 600; }
.stage li span { color: var(--slate); font-size: .95rem; flex: 1 1 18rem; }

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

.footer {
  background: var(--ink);
  color: #A9A19B;
  padding-block: clamp(2.75rem, 5vw, 4rem) 2rem;
  font-size: .92rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__logo img { height: 34px; width: auto; margin-bottom: 1rem; }
.footer p { color: #8E8681; font-size: .9rem; max-width: 30ch; }
.footer h4 {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: .9rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .55rem; }
.footer a { color: #C8C0BA; text-decoration: none; }
.footer a:hover { color: var(--amber); }

.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--mist);
}

/* --- Page header (interior pages) ---------------------------------------- */

.pagehead { padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.pagehead p.lede { margin-bottom: 0; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1.1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* ==========================================================================
   Image-led layout additions
   ========================================================================== */

/* Device shots */
.shot { display: block; width: 100%; height: auto; }
.shot--hero { max-width: 330px; margin-inline: auto; }
.shot--split { max-width: 300px; }

.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.showcase--flip .showcase__art { order: -1; }
@media (max-width: 860px) {
  .showcase { grid-template-columns: 1fr; }
  .showcase--flip .showcase__art { order: 0; }
  .showcase__art { max-width: 300px; margin-inline: auto; }
}

.showcase__art { display: flex; justify-content: center; }

/* Point list beside a device shot */
.points { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.points li {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: .85rem 0;
  border-top: 1px solid var(--cloud);
}
.points li:last-child { border-bottom: 1px solid var(--cloud); }
.points b { font-family: var(--display); font-weight: 600; display: block; margin-bottom: .1rem; }
.points span { color: var(--slate); font-size: .95rem; }
.points .ico { flex: 0 0 auto; margin-top: .15rem; }
.section--ink .points li { border-color: rgba(255,255,255,.12); }
.section--ink .points b { color: var(--paper); }
.section--ink .points span { color: #C0B8B2; }

/* Icon chips */
.ico { width: 22px; height: 22px; display: block; }
.ico--chip {
  width: 40px; height: 40px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(184,89,48,.09);
  margin-bottom: .9rem;
}
.section--ink .ico--chip { background: rgba(216,146,46,.16); }

/* Diagram band */
.diagram {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 2rem;
}
.diagram-wrap { overflow-x: auto; }
.diagram-wrap svg { min-width: 720px; }

/* Compact feature tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  border: 1px solid var(--cloud);
  border-radius: 10px;
  padding: 1.3rem 1.25rem;
}
.tile h3 { font-size: 1.02rem; margin-bottom: .3rem; }
.tile p { font-size: .93rem; color: var(--slate); margin: 0; }
.tile .badge { margin-top: .8rem; }

/* Stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--cloud);
  border: 1px solid var(--cloud);
  border-radius: 10px;
  overflow: hidden;
}
@media (max-width: 620px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--paper); padding: 1.4rem 1.3rem; }
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -.02em;
  color: var(--terracotta);
  margin-bottom: .2rem;
}
.stat span { font-size: .92rem; color: var(--slate); }
