/* =========================
   Fonts
========================= */
@font-face {
  font-family: "Avenir Next Web";
  src: url("/fonts/avenir-next-ultra-light.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Avenir Next Web";
  src: url("/fonts/avenir-next-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =========================
   Variables
========================= */
:root {
  --ink: #0B0F14;
  --black: #000000;
  --offwhite: #F7F7F5;
  --lightgray: #E9E5E5;

  --green: #105944;
  --coral: #FF654F;
  --yellow: #FFF691;
  --indigo: #1D117F;

  --border: rgba(233, 229, 229, 0.14);
  --border-strong: rgba(233, 229, 229, 0.25);

  --card: rgba(247, 247, 245, 0.04);
  --card2: rgba(247, 247, 245, 0.03);

  --muted: rgba(247, 247, 245, 0.82);
  --muted2: rgba(247, 247, 245, 0.65);

  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

/* =========================
   Base
========================= */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Avenir Next Web", "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--ink);
  color: var(--offwhite);
  line-height: 1.3;
}

/* One-time glow overlay (does not repeat on scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  height: 640px;
  pointer-events: none;
  z-index: -1;

  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(16, 89, 68, 0.25), transparent 55%),
    radial-gradient(900px 700px at 85% 15%, rgba(255, 101, 79, 0.20), transparent 55%);

  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Keep global hover subtle (do not fade UI elements) */
a:hover {
  text-decoration: none;
}

/* =========================
   Layout
========================= */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 22px 64px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(247, 247, 245, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(233, 229, 229, 0.12);
}

.logo img {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-name {
  font-weight: 650;
  letter-spacing: 0.2px;
}

.pill {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.05);
}

/* =========================
   Top Nav Pills (Philosophy / Discipline / Identity)
========================= */
.nav-pills {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Nav pills: slightly smaller + tighter */
.nav-pills .tag {
  display: inline-flex;
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  background: rgba(247, 247, 245, 0.035);
}

/* Polished link behavior for nav pills */
.nav-tag {
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.nav-tag:hover {
  border-color: rgba(233, 229, 229, 0.25);
  transform: translateY(-1px);
}

.nav-tag:focus-visible {
  outline: none;
  border-color: rgba(233, 229, 229, 0.28);
  transform: translateY(-1px);
}

/* =========================
   Hero
========================= */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

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

h1, h2, h3 { font-family: inherit; }

h1 {
  margin: 0 0 10px;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

@media (max-width: 520px) {
  h1 { font-size: 44px; }
}

.sub {
  font-size: 18px;
  color: rgba(247, 247, 245, 0.84);
  margin: 0 0 18px;
  max-width: 52ch;
}

/* =========================
   Pills (general)
========================= */
.triad {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 20px;
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.04);
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.dot.c { background: var(--coral); }
.dot.y { background: var(--yellow); }

/* =========================
   Cards
========================= */
.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.card p {
  margin: 0 0 14px;
  color: var(--muted);
}

/* =========================
   Grid + Tiles (clickable cards)
========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

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

.tile {
  display: block;
  position: relative;
  z-index: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card2);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

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

.tile b {
  display: block;
  margin-bottom: 6px;
}

.tile:hover {
  border-color: rgba(233, 229, 229, 0.25);
  transform: translateY(-1px);
}

.tile::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 22px;
  pointer-events: none;
  opacity: 0;
  filter: blur(18px);
  transition: opacity 0.16s ease;
  z-index: 0;
}

.tile:hover::before { opacity: 0.55; }

.tile:active::before,
.tile:focus-visible::before { opacity: 0.55; }

.tile:focus-visible {
  outline: none;
  border-color: rgba(233, 229, 229, 0.25);
  transform: translateY(-1px);
}

.tile-ordo::before {
  background: radial-gradient(60% 60% at 30% 20%, rgba(255, 101, 79, 0.45), transparent 70%);
}
.tile-cadence::before {
  background: radial-gradient(60% 60% at 30% 20%, rgba(255, 246, 145, 0.38), transparent 70%);
}
.tile-continuism::before {
  background: radial-gradient(60% 60% at 30% 20%, rgba(16, 89, 68, 0.45), transparent 70%);
}

/* =========================
   Forms
========================= */
form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="text"],
input[type="email"],
textarea {
  flex: 1 1 220px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(233, 229, 229, 0.18);
  background: rgba(0, 0, 0, 0.22);
  color: var(--offwhite);
  outline: none;
  font-size: 16px;
  line-height: 1.2;
  min-width: 0;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: rgba(247, 247, 245, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Give founders note field a little more room on desktop */
#foundersForm input[name="note"] {
  flex: 2 1 320px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: var(--coral);
  color: var(--black);
  flex: 0 0 auto;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.small {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 10px;
}

/* =========================
   Content pages
========================= */
.page-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.page-title h1 {
  font-size: 44px;
  margin: 0;
}

.page-kicker {
  color: rgba(247, 247, 245, 0.72);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.prose {
  margin-top: 14px;
  max-width: 74ch;
}

.prose p,
.prose ul {
  color: rgba(247, 247, 245, 0.84);
  line-height: 1.55;
}

.prose li { margin: 6px 0; }

.breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
  color: rgba(247, 247, 245, 0.65);
  font-size: 12px;
}

.breadcrumbs a { opacity: 0.9; }
.breadcrumbs a:hover { opacity: 1; }

/* =========================
   Continuism Book: TOC Accordion Pills
   (Used on /continuism/book/)
========================= */
.toc-accordion {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Pill button used as section toggles */
.toc-pill {
  width: 100%;
  text-align: left;
  cursor: pointer;

  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  padding: 12px 14px;
  border-radius: 999px;

  border: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.05);
  color: rgba(247, 247, 245, 0.88);

  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.toc-pill:hover {
  border-color: rgba(233, 229, 229, 0.25);
  transform: translateY(-1px);
}

.toc-pill.active {
  border-color: rgba(233, 229, 229, 0.30);
  background: rgba(247, 247, 245, 0.08);
}

/* Panel that opens under each pill */
.toc-panel {
  display: none;
  margin-top: -6px; /* tucks under pill */
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(247, 247, 245, 0.03);
}

.toc-panel.active {
  display: block;
}

/* =========================
   Footer
========================= */
.footer {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid rgba(233, 229, 229, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(247, 247, 245, 0.62);
  font-size: 12px;
  flex-wrap: wrap;
}

.links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* Footer link + icon styling */
.footer-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color: rgba(247,247,245,.72);
}

.footer-link:hover{
  color: rgba(247,247,245,.90);
}

.footer-link .icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity:.9;
}
.footer-link .icon svg{
  display:block;
}
/* =========================
   Mobile nav behavior
========================= */
@media (max-width: 520px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 10px;
  }

  .brand { width: 100%; }
  .nav .pill { align-self: flex-start; }

  .nav-pills {
    width: 100%;
    justify-content: flex-start;

    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    padding-top: 2px;
    padding-bottom: 2px;
  }

  .nav-pills .tag {
    display: inline-flex;
    white-space: nowrap;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-pills .tag:active {
    transform: none;
  }

  /* TOC pills on mobile: slightly tighter */
  .toc-pill {
    padding: 11px 12px;
    font-size: 11px;
  }
}