/* ===== Palette & tokens ===== */
:root{
  --bg: #fdfcf9;
  --card: #ffffff;
  --ink: #2a2a2a;
  --ink-2: #4a4a4a;
  --muted: #6b7b7c;
  --accent: #4f8a8b;
  --accent-2: #6fb1b3;
  --line: #e0e5e5;
  --ring: #93c8c9;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f1415;
    --card: #161c1d;
    --ink: #e6eaea;
    --ink-2: #c5cdcd;
    --muted: #8da2a2;
    --accent: #4f8a8b;
    --accent-2: #6fb1b3;
    --line: #253031;
    --ring: #6fb1b3;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --radius: 12px;
  }
}

/* ===== Base ===== */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0; background: var(--bg); color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  line-height: 1.7; font-size: 17px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.container{ max-width: 880px; margin: 0 auto; padding: 3.5rem 1.25rem 4.5rem; }
@media (min-width: 880px){ .container{ padding-top: 5rem; } }

/* ===== Header ===== */
header{ text-align:center; margin-bottom: 2.25rem; }
.eyebrow{ color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
h1{ margin:.35rem 0 .5rem; font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 500; letter-spacing: -.015em; }
h2{ margin: 1rem 0 .5rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.subtitle{ max-width: 60ch; margin: 0 auto; color: var(--ink-2); font-size: 1.05rem; }

/* ===== Creed card ===== */
.creed{ 
  background: var(--card); 
  border: 1px solid var(--line); 
  border-radius: var(--radius); 
  padding: 1.25rem 1rem; 
  box-shadow: var(--shadow); 
  margin-top: 1.5rem;
}
.creed p{ margin:.35rem 0; }
.creed b{ color: var(--accent); font-weight: 600; }
.creed ul{ margin: .5rem 0; padding-left: 1.2rem; }
.creed li{ margin: .4rem 0; color: var(--ink-2); }
.creed code{ 
  background: var(--line); 
  color: var(--ink); 
  padding: .15rem .4rem; 
  border-radius: 4px; 
  font-size: .9rem; 
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ===== List (accordion) ===== */
.list{ display:grid; gap: 1rem; margin-top: 2rem; counter-reset: cf; }
details.principle{
  background: var(--card); border:1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
}
summary{ list-style:none; display:grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; cursor: pointer; }
summary::-webkit-details-marker{ display:none }
.num{ counter-increment: cf; font-variant-numeric: tabular-nums; background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 999px; display:grid; place-items:center; font-weight: 700; }
.name{ font-weight: 700; font-size: 1.15rem; letter-spacing: .004em; }
.desc{ color: var(--muted); font-style: italic; }
.chev{ width: 18px; height: 18px; border: 1.5px solid var(--accent-2); border-left: 0; border-top: 0; transform: rotate(-45deg); border-radius: 2px; opacity:.8; }
details[open] .chev{ transform: rotate(45deg); }
.panel{ padding: .6rem 0 .2rem .1rem; }
.panel ul{ margin:.2rem 0 0; padding-left: 1.2rem; }
.panel li{ color: var(--ink-2); margin:.25rem 0; }
@media (hover: hover){ details.principle:hover{ border-color: var(--accent-2); } }

/* ===== Waitlist Styles ===== */
details.wl{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  margin-top: 2rem;
}

.wl-summary{
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .9rem;
  align-items: center;
  cursor: pointer;
}

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

.wl-badge{
  background: var(--accent);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.wl-content{
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.wl-title{
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .004em;
}

.wl-desc{
  color: var(--muted);
  font-style: italic;
  font-size: .95rem;
}

.wl-chev{
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--accent-2);
  border-left: 0;
  border-top: 0;
  transform: rotate(-45deg);
  border-radius: 2px;
  opacity: .8;
  transition: transform .2s ease;
}

details.wl[open] .wl-chev{
  transform: rotate(45deg);
}

.wl-panel{
  padding: .8rem 0 .2rem;
}

/* ===== Form Styling ===== */
.formkit-form{
  margin: 0;
}

.formkit-fields{
  display: flex;
  flex-direction: column;
  gap: .8rem;
  margin: .5rem 0 0;
}

.formkit-field{
  margin: 0;
}

.formkit-input{
  width: 100%;
  height: 46px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}

.formkit-input:focus{
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.formkit-submit{
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color .2s ease;
}

.formkit-submit:hover{
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.wl-note{
  color: var(--muted);
  font-size: .85rem;
  margin-top: .5rem;
  display: block;
  text-align: center;
}

.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Side-by-side on wider screens */
@media (min-width: 640px){
  .formkit-fields{
    flex-direction: row;
    align-items: center;
  }
  
  .formkit-field{
    flex: 1 1 auto;
  }
  
  .formkit-submit{
    width: auto;
    padding: 0 1.5rem;
  }
}

/* Hover effects */
@media (hover: hover){
  details.wl:hover{
    border-color: var(--accent-2);
  }
}

/* Error handling */
.formkit-alert{
  margin: 0 0 .5rem;
  padding: 0;
  list-style: none;
}

.formkit-alert-error{
  color: #dc2626;
  font-size: .9rem;
}

/* ===== Actions (buttons) ===== */
.actions{ 
  display:flex; 
  justify-content:center; 
  gap:.6rem; 
  margin-top: 1.25rem; 
  flex-wrap: wrap; 
}
.btn{ 
  appearance:none; 
  cursor:pointer; 
  border-radius: 10px; 
  border:1px solid var(--line); 
  background: var(--card); 
  color: var(--ink); 
  padding:.55rem 1rem; 
  font-family: inherit; 
  font-size: .95rem; 
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.btn:hover{ border-color: var(--accent-2); }
.btn:focus-visible{ outline: none; box-shadow: 0 0 0 2px var(--ring); }

/* ===== Footer ===== */
footer{ 
  text-align:center; 
  color: var(--muted); 
  margin-top: 2rem; 
  font-style: italic; 
}

/* ===== Links ===== */
a{ color: var(--accent); text-decoration: underline; }
a:hover{ color: var(--accent-2); }

/* ===== Text styling ===== */
b{ color: var(--accent); font-weight: 600; }
i{ font-style: italic; }

/* ===== Motion ===== */
@media (prefers-reduced-motion: no-preference){
  details.principle, details.wl, .formkit-submit, .formkit-input, .btn{ transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
  .chev, .wl-chev{ transition: transform .2s ease; }
}

/* ===== Print ===== */
@media print{
  body{ background:#fff; color:#000 }
  .btn, .actions, details.wl{ display:none !important }
  .container{ padding: 1rem; }
  details.principle, .creed{ break-inside: avoid; box-shadow:none; }
}