/* Regulate.neuro site design system.
   Structure and motion follow the Regulate.clinic page (hero dot field, floating
   brand mark, ruled columns, rounded boxes); the palette is the neuro one: the
   logo's blue, violet and magenta instead of the clinic's teal and terracotta. */

:root{
  /* ink */
  --ink:#3a3a3a;            /* body text, as the rest of the app uses */
  --ink-2:#6b6670;          /* secondary text */
  --night:#121726;          /* dot field ink, deep shadows */
  --white:#fff;

  /* accents, sampled from images/logo.png */
  --blue:#2E6289;           /* headings and the hero line */
  --violet:#7A4A86;         /* the wordmark in the hero */
  --magenta:#9E4278;        /* the dots a drop lights up */

  /* surfaces */
  --mist-top:#EEF1F7;       /* hero field, top */
  --mist-bot:#D3DCEA;       /* hero field, foot */
  --stone:#E8E7E2;          /* the glow rising inside the hero */
  --fill:#F6F8FD;           /* behind longer texts */
  --line:#E5E5E5;           /* hairlines */

  /* type */
  --text:'Work Sans',-apple-system,Helvetica,Arial,sans-serif;
  --wordmark:'Encode Sans Semi Expanded',sans-serif;

  /* metrics */
  --edge:clamp(16px,2.6vw,40px);
  --inset:clamp(24px,7vw,120px);
  --bar-h:calc(60px + var(--edge));
  --mark-h:46px;
  --r:clamp(14px,1.6vw,22px);
  --r-sm:clamp(10px,1vw,14px);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
html,body{ overflow-x:clip; }
@supports not (overflow-x:clip){ body{ overflow-x:hidden; } }
body{
  margin:0; background:var(--white); color:var(--ink);
  font-family:var(--text); font-weight:400; font-size:17px; line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
img{ display:block; max-width:100%; }
a{ color:inherit; }
p{ margin:0 0 1.1em; }
:focus-visible{ outline:2px solid var(--blue); outline-offset:3px; }
section[id]{ scroll-margin-top:calc(var(--bar-h) + 8px); }
.skip{ position:absolute; top:-200px; left:16px; }
.skip:focus{ top:16px; background:var(--white); padding:8px 12px; z-index:30; }

/* Top bar. The bar itself scrolls away; the mark is fixed, so it stays at the
   top of the page and gains a translucent card once the page moves. */
.top{
  position:relative; z-index:20; background:var(--white);
  display:flex; align-items:center; justify-content:flex-end; gap:24px;
  min-height:var(--bar-h); padding:0 var(--edge);
}
.top .nav{ position:absolute; left:50%; translate:-50% 0; }
.nav{ display:flex; gap:clamp(14px,2.2vw,34px); font-size:15px; }
.nav a{ text-decoration:none; color:#191919; }
.nav a:hover{ text-decoration:underline; text-underline-offset:6px; }
.nav a.current{ text-decoration:underline; text-underline-offset:6px; }

/* the logo PNGs are 677x369 with empty margins; the wrapper crops to the wave */
.logo{ display:block; flex:none; overflow:hidden; aspect-ratio:635 / 200; }
.logo img{ width:106.6%; max-width:none; height:auto; margin:-13.4% 0 0 -3.5%; }

.mark{
  position:fixed; z-index:30; top:calc((var(--bar-h) - var(--mark-h)) / 2); left:12px; height:var(--mark-h);
  display:flex; align-items:center; gap:14px; padding-inline:20px;
  background:rgba(255,255,255,0); -webkit-backdrop-filter:blur(0); backdrop-filter:blur(0);
  border:1px solid rgba(18,23,38,0); border-radius:14px;
  box-shadow:0 1px 2px rgba(18,23,38,0), 0 8px 24px rgba(18,23,38,0);
  color:#191919; text-decoration:none;
  transition:top .5s ease, background-color .5s ease, border-color .5s ease, box-shadow .5s ease,
             -webkit-backdrop-filter .5s ease, backdrop-filter .5s ease;
}
.scrolled .mark{
  top:8px; background:rgba(255,255,255,.5);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border-color:rgba(18,23,38,.06); box-shadow:0 1px 2px rgba(18,23,38,.06), 0 8px 24px rgba(18,23,38,.1);
}
.mark .logo{ width:98px; }
.mark span{ font-family:var(--wordmark); font-weight:200; font-size:21px; letter-spacing:.01em; white-space:nowrap; }
/* a soft haze behind the mark, so it holds together over the hero */
.mark::before{
  content:""; position:absolute; inset:-4px -6px; z-index:-1; pointer-events:none; border-radius:40px;
  background:radial-gradient(closest-side, rgba(18,23,38,.07), rgba(18,23,38,.03) 60%, transparent); filter:blur(6px);
}
@media (max-width:640px){
  .mark{ gap:10px; padding-inline:12px; }
  .mark .logo{ width:70px; }
  .mark span{ font-size:17px; }
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:0 24px;
  border:1px solid var(--blue); background:none; color:var(--blue); border-radius:999px;
  font:inherit; font-weight:600; font-size:15px; text-decoration:none; cursor:pointer; white-space:nowrap;
  transition:background .2s, color .2s, box-shadow .2s;
}
.btn:hover{ background:var(--blue); color:var(--white); }
.btn:disabled{ opacity:.55; cursor:wait; }
.btn--pill{
  min-height:54px; padding:0 30px; border:0; border-radius:999px;
  background:var(--white); color:var(--night); font-size:17px; font-weight:600;
  box-shadow:0 1px 2px rgba(18,23,38,.08), 0 6px 18px rgba(18,23,38,.06);
}
.btn--pill:hover{ background:var(--blue); color:var(--white); }
.btn--wide{ width:100%; }
.top .btn--pill{ min-height:44px; padding:0 22px; font-size:15px; }

/* Hero: one rounded box with the moving dot field behind the text */
.hero{ background:var(--white); padding-bottom:var(--edge); }
.band{ position:relative; margin-inline:var(--edge); }
.band.hero-box{
  height:auto; min-height:clamp(460px, calc(100vh - var(--bar-h) - var(--edge)), 780px);
  display:grid; align-items:center; justify-items:start; text-align:start; border-radius:var(--r);
}
.band--field{ overflow:hidden; background:linear-gradient(180deg, var(--mist-top) 0%, var(--mist-bot) 100%); }
canvas[data-field]{ position:absolute; inset:0; width:100%; height:100%; }
.field-glow{
  position:absolute; pointer-events:none; left:50%; bottom:0; width:44%; height:35%; translate:-50% 0;
  background:radial-gradient(50% 100% at 50% 100%, var(--stone) 0%, var(--stone) 34%,
             rgba(232,231,226,.8) 58%, rgba(232,231,226,.38) 80%, rgba(232,231,226,0) 100%);
  filter:blur(6px); transform-origin:50% 100%;
}
.hero-content{ --gap:clamp(10px,1.1vw,18px); position:relative; z-index:1; padding:clamp(56px,9vh,104px) var(--inset); max-width:1440px; }
.hero h1{
  margin:0; display:flex; flex-direction:column; align-items:flex-start; gap:var(--gap);
  font-weight:200; font-size:clamp(1.6rem,3.1vw,3.1rem); line-height:1.2; letter-spacing:-.01em;
}
.hero h1 .brand{ font-family:var(--wordmark); font-weight:200; font-size:.92em; letter-spacing:.01em; color:var(--violet); }
.hero h1 .line{ color:var(--blue); font-weight:500; text-wrap:balance; }
.hero-content p{
  margin:var(--gap) 0 clamp(32px,3.6vw,52px); color:var(--ink-2); font-weight:300;
  font-size:clamp(1.25rem,2.1vw,1.9rem); line-height:1.25; max-width:42ch; text-wrap:balance;
}
.hero-cta{ display:flex; gap:14px; flex-wrap:wrap; }

/* A smaller hero for the inner pages: same field, room for a form below it */
.band.hero-box--slim{ min-height:clamp(280px,34vh,420px); }
.hero-box--slim .hero-content{ padding:clamp(40px,6vh,72px) var(--inset); }
.hero-box--slim h1{ font-size:clamp(1.6rem,3vw,3rem); }

/* Sections */
.sec{ padding-block:clamp(36px,4.5vw,64px); }
.wrap{ margin-inline:calc(var(--edge) + var(--inset)); }
.head{ display:flex; flex-direction:column; align-items:flex-start; gap:clamp(12px,1.4vw,20px); max-width:58rem; margin-bottom:clamp(24px,3vw,40px); }
.head p{ margin:0; }
h2{ margin:0; color:#222; font-weight:600; font-size:clamp(1.9rem,3.2vw,3rem); line-height:1.12; letter-spacing:-.01em; }
h3{ font-weight:500; }
.lead{ color:#595959; font-weight:400; font-size:clamp(1.1rem,1.6vw,1.35rem); line-height:1.6; }
.muted{ color:var(--ink-2); }

/* Ruled columns: hairline frame with small squares on the corners */
.prow{
  position:relative; display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
  border:1px solid var(--line); background:var(--white);
  box-shadow:0 1px 3px rgba(18,23,38,.05), 0 6px 28px rgba(18,23,38,.07);
}
.pcol{ position:relative; display:flex; flex-direction:column; padding:clamp(28px,3.2vw,48px) clamp(20px,2.6vw,40px) clamp(32px,3.6vw,56px); }
.pcol + .pcol{ border-left:1px solid var(--line); }
.pcol::before,.pcol::after,.prow::before,.prow::after{
  content:""; position:absolute; z-index:1; width:11px; height:11px; box-sizing:border-box;
  border:1px solid var(--line); border-radius:2px; background:var(--white);
}
.pcol::before{ top:-6px; left:-6px; }
.pcol::after{ bottom:-6px; left:-6px; }
.prow::before{ top:-6px; right:-6px; }
.prow::after{ bottom:-6px; right:-6px; }
.pcol-num{
  font-family:var(--wordmark); font-weight:200; font-size:clamp(52px,4.6vw,68px); line-height:.78;
  letter-spacing:-.02em; color:var(--violet); margin-bottom:clamp(20px,2.2vw,30px);
}
.pcol h3{ margin:0 0 6px; color:#262223; font-size:clamp(1.2rem,1.6vw,1.45rem); font-weight:500; line-height:1.3; }
.pcol p{ margin:0; color:#595959; font-size:17px; line-height:1.6; }
.prow-note{ max-width:58rem; margin:clamp(24px,2.6vw,36px) 0 0; color:var(--ink-2); font-size:17px; line-height:1.65; text-wrap:pretty; }

/* A panel for longer text or a form */
.panel{
  border:1px solid var(--line); border-radius:var(--r); background:var(--fill);
  box-shadow:0 1px 3px rgba(18,23,38,.05), 0 6px 28px rgba(18,23,38,.07);
  padding:clamp(28px,3.4vw,48px) clamp(24px,3.8vw,56px);
}
.panel--narrow{ max-width:560px; margin-inline:auto; }

/* Form fields */
.input{
  width:100%; padding:14px 16px; border:1px solid #DCD9D4; border-radius:10px;
  background:var(--white); font-family:inherit; font-size:16px; color:var(--ink);
  outline:none; transition:border-color .15s ease;
}
.input:focus{ border-color:var(--blue); }
.input::placeholder{ color:#9a938b; }
label{ display:block; font-size:12px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2); margin:16px 0 6px; }

/* Footer */
.site-footer{
  padding:28px 0 40px; margin-inline:calc(var(--edge) + var(--inset)); display:flex;
  justify-content:space-between; align-items:center; gap:16px;
  border-top:1px solid var(--line); font-size:13px; color:var(--ink-2);
}

/* Reveal on scroll */
.js .reveal{ opacity:0; translate:0 10px; transition:opacity 1s ease, translate 1s ease; transition-delay:calc(var(--i,0) * 160ms); }
.js .reveal.in{ opacity:1; translate:0 0; }
@media (prefers-reduced-motion: reduce){ .js .reveal{ opacity:1; translate:none; transition:none; } }

/* Phone */
@media (max-width:860px){
  .top .nav{ display:none; }
  .band.hero-box{ margin-inline:8px; }
  .hero-content{ --gap:16px; width:100%; padding:56px 22px 40px; }
  .hero h1{ font-size:min(2.1rem,8.6vw); line-height:1.2; }
  .hero h1 .line{ font-weight:600; }
  .hero h1 .brand{ font-size:.86em; }
  .hero-content p{ margin:22px 0 38px; font-size:1.25rem; line-height:1.35; }
  .hero-cta{ flex-direction:column; align-items:stretch; width:100%; max-width:440px; }
  .hero-cta .btn--pill{ display:flex; width:100%; min-height:58px; border-radius:14px; font-size:18px; }
  .wrap{ margin-inline:22px; }
  .site-footer{ margin-inline:22px; flex-direction:column; gap:8px; text-align:center; }
  .prow{ grid-template-columns:1fr; }
  .pcol + .pcol{ border-left:0; border-top:1px solid var(--line); }
}
