/* Shared brand system for KelsyClark.co — tokens, chrome, and the pieces every page reuses.
   Page-specific layout stays in each page's own <style> block. */

:root {
  --paper: #f1ede4;
  --paper-light: #fbfaf6;
  --paper-deep: #ddd6ca;
  --ink: #1e231f;
  --muted: #666b66;
  --blue: #3f6375;
  --blue-dark: #294a5b;
  --blue-pale: #d7e0e1;
  --line: rgba(30, 35, 31, .18);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", sans-serif;
  --mono: "DM Mono", monospace;
  --rail: 78px;
  --page: min(1180px, calc(100vw - 150px));
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
::selection { background: #bfd0d3; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.page { width: var(--page); margin: 0 auto; }
.skip-link { position: fixed; top: 14px; left: 94px; z-index: 200; padding: 9px 13px; background: var(--ink); color: var(--paper-light); transform: translateY(-160%); transition: transform .2s; }
.skip-link:focus { transform: none; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  background: var(--paper-light);
  border-right: 1px solid var(--line);
}
.rail-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--blue); color: var(--paper-light); font-family: var(--serif); font-size: 24px; text-decoration: none; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 3px; }
/* The dot stays 7px; the link around it is 24px so it can actually be clicked. */
.rail-nav a { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 0; text-decoration: none; }
.rail-nav a::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--blue); border-radius: 50%; transition: background .2s, transform .2s; }
.rail-nav a:hover::before { background: var(--blue); transform: scale(1.4); }
.rail-copy { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .16em; text-transform: uppercase; }
.mobile-header { display: none; }
.site { margin-left: var(--rail); }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--blue); background: transparent; color: var(--blue-dark); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .25s var(--ease); }
.button:hover { background: var(--blue); color: var(--paper-light); transform: translateY(-2px); }
.button.filled { background: var(--blue); color: var(--paper-light); }
.button.filled:hover { background: var(--blue-dark); }
.plain-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue-dark); font-size: 12px; font-weight: 600; text-underline-offset: 6px; }

.section { padding: clamp(100px, 11vw, 160px) 0; }
.section-kicker { margin: 0 0 22px; color: var(--blue-dark); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.section-title { margin: 0; font-family: var(--serif); font-size: clamp(56px, 7vw, 104px); font-weight: 400; letter-spacing: -.05em; line-height: .92; text-wrap: balance; }

/* The founding-sessions badge doubles as the price marker on the support page. */
.badge { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 7px 14px; border: 1px solid var(--blue); color: var(--blue-dark); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

.form { display: grid; gap: 18px; }
.field label { display: block; margin-bottom: 5px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.field input, .field textarea { width: 100%; min-height: 44px; padding: 10px 0 12px; border: 0; border-bottom: 1px solid rgba(30,35,31,.35); border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--blue); }
.field-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.hidden { position: absolute; left: -9999px; }

.footer { padding: clamp(90px, 10vw, 140px) 0 42px; background: var(--blue-dark); color: var(--paper-light); }
.footer-contact { display: grid; grid-template-columns: 1.08fr .92fr; gap: 8vw; align-items: end; padding-bottom: 70px; }
.footer-contact h2 { margin: 0; font-family: var(--serif); font-size: clamp(42px, 5.5vw, 74px); font-weight: 400; letter-spacing: -.04em; line-height: 1.02; }
.footer-email { color: #c5d3d6; text-underline-offset: 7px; }
.footer-aside { max-width: 460px; margin: 0; color: rgba(251,250,246,.72); font-size: 13px; line-height: 1.75; }
.footer-form { padding-top: 18px; border-top: 1px solid rgba(251,250,246,.25); }
.footer-form summary { padding: 12px 0; color: #c5d3d6; font-family: var(--mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.footer-form .form { margin-top: 24px; }
.footer-form .field label { color: rgba(251,250,246,.5); }
.footer-form .field input, .footer-form .field textarea { color: var(--paper-light); border-bottom-color: rgba(251,250,246,.32); }
.footer-form .button { justify-self: start; border-color: #c5d3d6; color: #c5d3d6; }
.footer-bottom { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-top: 28px; border-top: 1px solid rgba(251,250,246,.18); }
.footer-name { margin: 0; font-family: var(--serif); font-size: 31px; }
.footer-small { margin: 2px 0 0; color: rgba(251,250,246,.48); font-size: 9px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 34px; font-size: 11px; text-underline-offset: 5px; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .75s var(--ease), transform .75s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }
@keyframes settle { from { opacity: .65; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 980px) {
  :root { --rail: 0px; --gutter: 28px; --page: min(100vw - 56px, 760px); }
  .rail { display: none; }
  .skip-link { left: 16px; }
  .site { margin-left: 0; }

  /* The rail is always on screen on desktop, so the mobile header stays on screen too. */
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 0 max(var(--gutter), calc((100vw - 760px) / 2));
    background: var(--paper-light);
    border-bottom: 1px solid var(--line);
  }
  .mobile-name { flex: none; font-family: var(--serif); font-size: 22px; text-decoration: none; white-space: nowrap; }
  .mobile-nav { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0 18px; min-width: 0; margin-left: auto; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; min-height: 36px; color: var(--blue-dark); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; white-space: nowrap; }
  .site section, .footer, .site [id] { scroll-margin-top: calc(var(--header-h, 68px) + 10px); }

  .footer-contact { grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5.5vw, 54px); align-items: start; }
}

@media (max-width: 680px) {
  :root { --gutter: 22px; --page: calc(100vw - 44px); }
  .mobile-header { min-height: 58px; gap: 12px; padding: 0 var(--gutter); }
  .mobile-name { font-size: 20px; }
  /* The right edge fades so the row reads as "there is more nav over here". */
  .mobile-nav { gap: 0 14px; padding-right: 16px; -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 16px), transparent 100%); }
  .mobile-nav a { min-height: 34px; font-size: 9.5px; letter-spacing: .05em; }

  /* Type steps down with the column so headings keep their desktop proportions. */
  .section { padding: clamp(72px, 16vw, 104px) 0; }
  .section-title { font-size: clamp(36px, 12vw, 52px); }

  .footer-contact h2 { font-size: clamp(28px, 8.5vw, 40px); }
  .footer-bottom { flex-direction: column; align-items: stretch; gap: 22px; }
  .footer-name { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
