/* Co-Founder Equity Calculator: builds on blog-style.css */

:root {
  --surface: #ffffff;
  --accent-tint: #e6f4f2;
  --warn-ink: #7a4b00;
  --warn-bg: #fff7e6;
  --warn-line: #f3d08a;
  --wide: 72rem;
}

.wrap.wide {
  max-width: var(--wide);
}

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

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding-top: 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.site-nav a {
  color: rgb(203 213 225);
}

.site-nav .brand {
  margin-right: auto;
  color: white;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.site-header .hero-calc {
  padding-top: 0;
  padding-bottom: 3rem;
}

.site-header .hero-calc .eyebrow {
  margin-top: 2rem;
}

.site-header .dek {
  max-width: 44rem;
}

.site-header .dek a {
  color: white;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 0.18em;
}

/* ---------- Layout ---------- */

.calc {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .calc {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: start;
    gap: 2.5rem;
  }

  .results {
    position: sticky;
    top: 1.5rem;
  }
}

.section-title {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.howto {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  color: var(--body);
  line-height: 1.6;
}

.howto li {
  position: relative;
  padding-left: 1.25rem;
}

.howto li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--accent);
}

.howto .privacy {
  margin-top: 0.5rem;
  color: var(--muted);
  font-style: italic;
}

.howto .privacy::before {
  display: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

/* ---------- Founders ---------- */

.founders {
  margin: 0 0 2.5rem;
  padding: 1.25rem;
}

.founders label.field-label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-weight: 700;
}

.founder-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .founder-inputs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.founder-input {
  position: relative;
}

.founder-input::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.35rem;
  border-radius: 999px;
  background: var(--c);
  pointer-events: none;
}

.founder-input input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem 0.5rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.founder-input input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

/* ---------- Questions ---------- */

.questions {
  display: grid;
  gap: 0.9rem;
}

.question {
  min-width: 0;
  margin: 0;
  padding: 1.1rem 1.25rem 1.25rem;
}

.question legend {
  float: left;
  width: 100%;
  padding: 0;
  display: flex;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.question legend + * {
  clear: both;
}

.q-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.question.answered .q-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.q-hint {
  margin: 0.35rem 0 0.8rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 560px) {
  .chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 0.45rem;
  background: var(--surface);
  color: var(--body);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.chip:hover {
  background: var(--paper);
}

/* the real input stays focusable and readable by screen readers */
.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.chip .mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid #b8c0cc;
  border-radius: 0.3rem;
  background: var(--surface);
  color: white;
  font-size: 0.75rem;
  line-height: 1;
}

.chip input[type="radio"] ~ .mark {
  border-radius: 999px;
}

.chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip:has(input:checked) {
  border-color: var(--accent);
  border-left-color: var(--c);
  background: var(--accent-tint);
  color: var(--ink);
}

.chip input:checked ~ .mark {
  border-color: var(--accent);
  background: var(--accent);
}

.chip input:checked ~ .mark::after {
  content: "\2713";
  font-weight: 800;
}

.chip input:focus-visible ~ .mark {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.35);
}

/* ---------- Results ---------- */

.results-card {
  padding: 1.25rem;
}

.results-card h2 {
  margin: 0;
}

.progress {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-bar {
  height: 0.3rem;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 200ms ease;
}

.pie {
  display: block;
  width: 100%;
  max-width: 15rem;
  height: auto;
  margin: 1.25rem auto 1rem;
}

.pie path {
  transition: opacity 120ms ease;
}

.pie.hovering path:not(.active) {
  opacity: 0.35;
}

.pie-empty {
  fill: var(--paper);
  stroke: var(--line);
}

.pie-center {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

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

.split li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.25rem;
  border-top: 1px solid var(--line);
  border-radius: 0.25rem;
}

.split li:first-child {
  border-top: 0;
}

.split li.active {
  background: var(--paper);
}

.split li.zero {
  color: var(--muted);
}

.swatch {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  background: var(--c);
}

.split .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}

.split li.zero .name {
  color: var(--muted);
}

.split .pct {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.split li.zero .pct {
  color: var(--muted);
  font-weight: 600;
}

.empty-note {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.warnings {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.warnings li {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--warn-line);
  border-radius: 0.45rem;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.warnings li.suggest {
  border-color: #b7dcd7;
  background: var(--accent-tint);
  color: #0b4f4a;
}

.warnings .icon {
  flex: none;
  font-weight: 800;
}

/* compact summary pinned to the bottom of small screens */
.split-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px -16px rgba(17, 24, 39, 0.35);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 200ms ease;
}

.split-bar span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 45%;
}

.split-bar .n {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-bar b {
  font-variant-numeric: tabular-nums;
}

.split-bar.hidden {
  transform: translateY(110%);
}

@media (min-width: 960px) {
  .split-bar {
    display: none;
  }
}

/* ---------- Below the calculator ---------- */

.more {
  max-width: var(--measure);
  margin-top: 4rem;
}

@media (min-width: 960px) {
  .more {
    margin-left: 0;
  }
}

.more section + section {
  margin-top: 3rem;
}

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

.post-list li {
  border-top: 1px solid var(--line);
}

.post-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.post-list a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink);
  font-weight: 700;
}

.post-list a:hover {
  color: var(--accent);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  flex: none;
  width: 1rem;
  color: var(--accent);
  font-weight: 800;
}

.faq details[open] summary::before {
  content: "\2212";
}

.faq summary:hover {
  color: var(--accent);
}

.faq details > p {
  margin: 0 0 1.1rem 1.75rem;
  color: var(--body);
  line-height: 1.75;
}

.faq a,
.caveats a,
.post-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.caveats {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--warn-line);
  border-radius: 0.5rem;
  background: var(--warn-bg);
  color: var(--warn-ink);
  line-height: 1.6;
}

.caveats p {
  margin: 0;
}

.caveats p + p {
  margin-top: 0.5rem;
}

.post-footer .mastodon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* leave room for the pinned summary on small screens */
@media (max-width: 959px) {
  main.calc-main {
    padding-bottom: 7rem;
  }
}

@media (max-width: 639px) {
  .site-nav .brand {
    flex-basis: 100%;
  }
}
