/* ==========================================================================
   Crest Capital — Shared Stylesheet
   Design tokens + components used across every page.
   Page-specific layout (hero sizing, wrap width, etc.) stays in each page's
   own small <style> block — this file is the shared system underneath it.
   ========================================================================== */

:root{
  --ink: #12181F;
  --ink-2: #1B242E;
  --paper: #E7E2D3;
  --paper-2: #DDD7C4;
  --line-dark: #333B44;
  --line-paper: #C9C2AE;
  --text-hi: #EDE7D9;
  --text-lo: #98A1AB;
  --text-paper: #1B2027;
  --text-paper-lo: #5B5546;
  --bronze: #A17C43;
  --moss: #4B5D45;
  --serif: 'Newsreader', serif;
  --sans: 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

/* ---- Reset & base ---- */
*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  background: var(--ink);
  color: var(--text-hi);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; text-decoration: none; }
::selection{ background: var(--bronze); color: var(--ink); }
strong{ color: var(--text-hi); }

/* ---- Layout spine (homepage only, harmless elsewhere) ---- */
.spine{
  position: fixed;
  top:0; bottom:0; left: 48px;
  width: 1px;
  background: var(--line-dark);
  z-index: 1;
}
.spine span{
  position: absolute;
  left: -3px;
  width: 7px; height: 1px;
  background: var(--bronze);
}
@media (max-width: 860px){ .spine{ display:none; } }

/* ---- Header / nav ---- */
header{
  position: sticky; top:0;
  background: rgba(18,24,31,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-dark);
  z-index: 10;
  padding: 22px 0;
}
header .row{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap: 24px; flex-wrap: wrap;
}
.brand{ display:flex; flex-direction: column; }
.brand-top{ display:flex; align-items:flex-end; gap: 11px; }
.brand-top img{ height: 48px; width: auto; display:block; flex-shrink:0; }
.brand-text-col{ display:flex; flex-direction: column; align-items: center; }
.brand-tagline{ font-family: var(--serif); font-size: 14px; color: var(--text-lo); text-align: center; margin-top: 2px; }
.wordmark{
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}
.back-link{ font-size: 14px; color: var(--text-lo); }
.back-link:hover{ color: var(--text-hi); }

nav{ display:flex; gap: 26px; flex-wrap: wrap; align-items: center; }
nav a{ font-size: 14px; color: var(--text-lo); transition: color 0.2s ease; }
nav a:hover{ color: var(--text-hi); }
nav .soon{ color: #5C6470; }
nav .soon:hover{ color: #5C6470; cursor: default; }

.nav-more{ position: relative; }
.nav-more-btn{
  background: none; border: none;
  font-family: var(--sans); font-size: 14px; color: var(--text-lo);
  cursor: pointer; padding: 0;
  transition: color 0.2s ease;
}
.nav-more-btn:hover, .nav-more.open .nav-more-btn{ color: var(--text-hi); }
.nav-more-menu{
  display: none;
  position: absolute; top: 100%; right: 0; margin-top: 16px;
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  padding: 6px 0;
  min-width: 170px;
  z-index: 20;
  flex-direction: column;
}
.nav-more.open .nav-more-menu{ display: flex; }
.nav-more-menu a, .nav-more-menu .soon{ padding: 11px 18px; font-size: 14px; }
.nav-more-menu a:hover{ background: rgba(255,255,255,0.04); }

/* ---- Sections ---- */
section{ padding: 96px 0; border-bottom: 1px solid var(--line-dark); }
section:last-of-type{ border-bottom: none; }
.section-head-row{ display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-head-row h2{ margin-bottom: 0; }
h2{ font-family: var(--serif); font-weight: 600; font-size: 28px; margin-bottom: 14px; }
.section-lede{ color: var(--text-lo); max-width: 56ch; margin-bottom: 44px; }
.eyebrow{ font-family: var(--mono); font-size: 12px; color: var(--bronze); margin-bottom: 16px; }

/* ---- Buttons ---- */
.btn{
  display: inline-block;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  color: var(--ink); background: var(--text-hi);
  padding: 13px 26px; border: none; border-radius: 2px;
  cursor: pointer; transition: background 0.2s ease;
}
.btn:hover{ background: var(--bronze); }

/* ---- Plain list / steps ---- */
.list-plain{ list-style:none; }
.list-plain li{
  padding: 22px 0; border-top: 1px solid var(--line-dark);
  display: grid; grid-template-columns: 1fr; gap: 6px;
}
.list-plain li:last-child{ border-bottom: 1px solid var(--line-dark); }
.list-plain .item-title{ font-family: var(--serif); font-size: 19px; font-weight: 500; }
.list-plain .item-body{ color: var(--text-lo); font-size: 15px; max-width: 58ch; }

.steps{ counter-reset: step; }
.steps li{
  padding: 26px 0; border-top: 1px solid var(--line-dark);
  display: grid; grid-template-columns: 40px 1fr; gap: 18px; align-items: baseline;
}
.steps li:last-child{ border-bottom: 1px solid var(--line-dark); }
.steps li::before{
  counter-increment: step; content: counter(step);
  font-family: var(--mono); font-size: 15px; color: var(--moss);
  grid-column: 1; grid-row: 1 / span 2; align-self: start;
}
.steps .item-title{ grid-column: 2; font-family: var(--serif); font-size: 19px; font-weight: 500; margin-bottom: 5px; }
.steps .item-body{ grid-column: 2; color: var(--text-lo); font-size: 15px; max-width: 56ch; }

/* ---- Paper panel (light section) + FAQ ---- */
.paper-panel{ background: var(--paper); color: var(--text-paper); }
.paper-panel h2, .paper-panel .wordmark{ color: var(--text-paper); }
.paper-panel .section-lede{ color: var(--text-paper-lo); }
.faq-item{ border-top: 1px solid var(--line-paper); }
.faq-item:last-child{ border-bottom: 1px solid var(--line-paper); }
.faq-q{
  width: 100%; text-align: left; background: none; border: none;
  font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--text-paper);
  padding: 22px 0; display: flex; justify-content: space-between; align-items: center;
  gap: 20px; cursor: pointer;
}
.faq-q .mark{ font-family: var(--mono); font-size: 16px; color: var(--bronze); flex-shrink: 0; }
.faq-a{ max-height: 0; overflow: hidden; transition: max-height 0.3s ease; color: var(--text-paper-lo); font-size: 15px; }
.faq-a p{ padding-bottom: 22px; max-width: 58ch; }
.faq-item.open .faq-a{ max-height: 320px; }

/* ---- Credentials grid ---- */
.credentials{ display:grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 560px){ .credentials{ grid-template-columns: 1fr 1fr; } }
.cred{ border-top: 1px solid var(--line-dark); padding-top: 18px; }
.cred .item-title{ font-family: var(--serif); font-size: 17px; margin-bottom: 8px; }
.cred .item-body{ color: var(--text-lo); font-size: 14.5px; }

/* ---- Journal carousel ---- */
.journal-carousel-wrap{ position: relative; }
.journal-carousel{
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent;
}
.journal-carousel::-webkit-scrollbar{ height: 4px; }
.journal-carousel::-webkit-scrollbar-thumb{ background: var(--line-dark); border-radius: 2px; }
.journal-card{
  flex: 0 0 100%; scroll-snap-align: start;
  background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 2px;
  padding: 26px;
}
@media (min-width: 640px){ .journal-card{ flex-basis: calc(50% - 10px); } }
.j-eyebrow{ font-family: var(--mono); font-size: 12px; color: var(--bronze); margin-bottom: 10px; }
.journal-card h3{ font-family: var(--serif); font-size: 18px; font-weight: 500; margin-bottom: 10px; line-height: 1.3; }
.journal-card p{ color: var(--text-lo); font-size: 14.5px; margin-bottom: 14px; }
.journal-card.muted h3{ color: #C7C1B3; }
.carousel-nav{ display: flex; gap: 8px; }
.carousel-nav button{
  width: 34px; height: 34px; border: 1px solid var(--line-dark); background: none;
  color: var(--text-lo); font-family: var(--sans); font-size: 15px; border-radius: 50%;
  cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease;
}
.carousel-nav button:hover{ border-color: var(--bronze); color: var(--bronze); }
.read-link{ font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--text-hi); border-bottom: 1px solid var(--bronze); padding-bottom: 2px; }
.read-link:hover{ color: var(--bronze); }
.read-link.soon{ color: #5C6470; border-bottom: 1px solid var(--line-dark); cursor: default; }

/* ---- Article page bits (Journal articles) ---- */
.dek{ color: var(--text-lo); font-size: 18px; max-width: 54ch; margin-bottom: 48px; }
.note{
  font-family: var(--mono); font-size: 12.5px; color: #5C6470;
  border-top: 1px solid var(--line-dark); margin-top: 48px; padding-top: 24px; max-width: 60ch;
}

/* ---- Legal page bits (Terms / Privacy) ---- */
.dates{ font-family: var(--mono); font-size: 12px; color: var(--text-lo); margin-bottom: 40px; }
.back{ display:inline-block; margin-bottom: 40px; font-size: 14px; color: var(--text-lo); }
.back:hover{ color: var(--text-hi); }
.contact-block{ margin-top: 8px; }
h3{ font-family: var(--serif); font-size: 16px; font-weight: 600; margin-top: 22px; margin-bottom: 8px; color: var(--text-hi); }
ul{ color: var(--text-lo); font-size: 15px; margin: 0 0 14px 20px; }
li{ margin-bottom: 8px; }

/* ---- Contact form ---- */
.contact-form{ max-width: 560px; }
.contact-form label{
  display: block; font-family: var(--mono); font-size: 12px; color: var(--text-lo);
  letter-spacing: 0.02em; margin-bottom: 20px;
}
.form-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px){ .form-grid{ grid-template-columns: 1fr; } }
.contact-form input:not([type="checkbox"]),
.contact-form textarea{
  display: block; width: 100%; margin-top: 8px;
  background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 2px;
  color: var(--text-hi); font-family: var(--sans); font-size: 15px; padding: 11px 13px;
}
.contact-form input:not([type="checkbox"]):focus,
.contact-form textarea:focus{ outline: none; border-color: var(--bronze); }
.contact-form textarea{ resize: vertical; }
.contact-form .consent-label{
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--sans); font-size: 12.5px; color: var(--text-lo);
  letter-spacing: 0; text-transform: none; margin-bottom: 24px; cursor: pointer;
}
.contact-form .consent-checkbox{
  width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--bronze); cursor: pointer;
}
.consent-label a{ color: var(--text-hi); text-decoration: underline; }
.form-disclaimer{ font-family: var(--mono); font-size: 11px; color: #5C6470; max-width: 500px; margin-top: 20px; line-height: 1.6; }
.confirm{ display:none; }
.confirm.show{ display:block; }
.confirm h2{ font-family: var(--serif); font-size: 24px; margin-bottom: 12px; }
.confirm p{ color: var(--text-lo); max-width: 50ch; }

/* ---- Footer ---- */
footer{ padding: 64px 0 80px; }
.foot-links{ display:flex; gap: 28px; flex-wrap: wrap; margin-bottom: 32px; }
.foot-links a{ font-size: 14px; color: var(--text-lo); }
.foot-links a:hover{ color: var(--text-hi); }
.fineprint{
  font-family: var(--mono); font-size: 12px; color: #565F6A;
  border-top: 1px solid var(--line-dark); padding-top: 24px; max-width: 62ch;
}

/* ---- Motion ---- */
.fade-in{ animation: fadeUp 0.7s ease both; }
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}