/* Advanced Dermatology — Dana Point
   Tokens → base → layout → components. One radius token, one accent, two families. */

:root {
  /* --- colour: violet-tinted neutrals, never pure black or white --- */
  --paper:        #faf8f8;
  --paper-sunk:   #f2eef1;
  --surface:      #ffffff;
  --ink:          #1a1622;
  --ink-soft:     #46405a;
  --ink-mute:     #635c78;
  --violet:       #4a3f6b;   /* brand hue, darkened for text-legal contrast */
  --violet-mark:  #a197bc;   /* their original lavender — rules, marks, focus */
  --violet-wash:  #efecf3;
  --rule:         #ddd7e2;
  --rule-strong:  #b9b0c6;
  --focus:        #4a3f6b;

  /* --- type --- */
  --display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --text: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.10vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.16vw, 1.10rem);
  --step-1:  clamp(1.20rem, 1.13rem + 0.34vw, 1.42rem);
  --step-2:  clamp(1.56rem, 1.38rem + 0.85vw, 2.12rem);
  --step-3:  clamp(2.10rem, 1.62rem + 2.20vw, 3.60rem);

  /* --- space --- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --pad-section: clamp(64px, 9vw, 148px);

  --radius: 2px;
  --shadow: 0 1px 2px rgba(26,22,34,.05), 0 10px 28px -12px rgba(74,63,107,.18);
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, picture, svg, video { max-width: 100%; display: block; }
svg.i { display: inline-block; vertical-align: -0.14em; }   /* inline icons keep their line */
dialog { margin: auto; }                                     /* the reset would kill UA centring */

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; scroll-padding-bottom: 96px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--text);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first;
}

::selection { background: var(--violet); color: var(--paper); }

/* --- type primitives --- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.028em; }
h2 { font-size: var(--step-2); line-height: 1.12; }
h3 { font-size: var(--step-1); line-height: 1.2; }
p  { text-wrap: pretty; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 34ch; }
.prose p + p { margin-top: 1.1em; }
.prose { max-width: 62ch; color: var(--ink-soft); }
.eyebrow {
  font: 500 var(--step--1)/1 var(--text);
  letter-spacing: .09em; text-transform: uppercase; color: var(--violet);
}
.num { font-variant-numeric: tabular-nums; }

a { color: inherit; }
.prose a, .link {
  color: var(--violet); text-decoration: underline;
  text-underline-offset: .15em; text-decoration-thickness: 1px;
  transition: text-decoration-thickness .15s cubic-bezier(.2,0,0,1);
}
.prose a:hover, .link:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }

/* --- layout --- */
.wrap { width: min(1180px, 100% - clamp(40px, 8vw, 96px)); margin-inline: auto; }
.narrow { width: min(720px, 100% - clamp(40px, 8vw, 96px)); margin-inline: auto; }
section { padding-block: var(--pad-section); }
.rule { border: 0; border-top: 1px solid var(--rule); }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: var(--s3) var(--s5); z-index: 100;
}
.skip:focus { left: 0; }

/* --- header --- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.head-in { display: flex; align-items: center; gap: var(--s6); min-height: 76px; }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; margin-right: auto; }
.brand .mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand-name {
  font-family: var(--display); font-size: 1.06rem; line-height: 1.05;
  letter-spacing: .13em; text-transform: uppercase;
}
.brand-name span { display: block; font-size: .78rem; letter-spacing: .19em; color: var(--ink-mute); }

.nav { display: flex; gap: var(--s6); }
.nav a {
  text-decoration: none; font-size: var(--step--1); letter-spacing: .04em;
  color: var(--ink-soft); padding-block: var(--s2);
  border-bottom: 1px solid transparent; transition: color .15s cubic-bezier(.2,0,0,1), border-color .15s;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--violet-mark); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--violet); }

.head-phone {
  font-family: var(--display); font-size: 1.12rem; text-decoration: none;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.head-phone:hover { color: var(--violet); }
.menu-btn { display: none; }

/* --- buttons: the primary is the darkest thing on the surface --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s6); border-radius: var(--radius);
  font: 500 var(--step-0)/1 var(--text); letter-spacing: .01em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s cubic-bezier(.2,0,0,1), color .15s, border-color .15s, transform .1s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--violet); }
.btn-primary:active { transform: scale(.985); background: #3b3256; }
.btn-ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--violet-wash); }
.btn-ghost:active { transform: scale(.985); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }

/* --- hero --- */
.hero { padding-block: clamp(72px, 11vw, 168px) clamp(56px, 8vw, 112px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: var(--s6); }
.hero .actions { margin-top: var(--s7); }
.hero-note {
  border-top: 1px solid var(--rule); padding-top: var(--s5);
  font-size: var(--step--1); color: var(--ink-mute); max-width: 30ch;
}
.hero-note strong { color: var(--ink); font-weight: 500; }
/* signature moment 1 — the monogram's ring of dots, drawn once, at scale */
.ring {
  position: absolute; right: -132px; top: -232px; width: 540px; height: 540px;
  color: var(--violet-mark); opacity: .26; pointer-events: none; z-index: -1;
}

/* --- section headings --- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; margin-bottom: var(--s7); }
.sec-head h2 { max-width: 20ch; }

/* --- routing list (flex, not auto-fit grid: a wrapped row simply ends) --- */
.routes { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); }
.routes li { flex: 1 1 260px; border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.routes li:first-child { border-left: 0; }
.routes a { display: block; padding: var(--s6) var(--s6) var(--s7); text-decoration: none; height: 100%; transition: background-color .15s cubic-bezier(.2,0,0,1); }
.routes a:hover { background: var(--violet-wash); }
.routes h3 { margin-bottom: var(--s3); }
.routes p { font-size: var(--step--1); color: var(--ink-mute); max-width: 30ch; }
.routes .go { display: block; margin-top: var(--s5); font-size: var(--step--1); color: var(--violet); }
@media (max-width: 640px) { .routes li { border-left: 0; } }

/* --- two-column editorial --- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (max-width: 860px) { .split, .hero-grid { grid-template-columns: 1fr; } .hero-grid { align-items: start; } }

/* --- steps (signature moment 2, skin-cancer page only) --- */
.steps { counter-reset: step; border-top: 1px solid var(--rule); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s5); padding-block: var(--s6); border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--display); font-size: var(--step-1); color: var(--violet-mark);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.steps h3 { margin-bottom: var(--s2); }
.steps p { color: var(--ink-soft); max-width: 56ch; }

/* --- data lists --- */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s3) var(--s6); align-items: baseline; }
.facts dt { font-size: var(--step--1); color: var(--ink-mute); }
.facts dd { font-variant-numeric: tabular-nums; }
.hours td { padding: var(--s2) 0; font-variant-numeric: tabular-nums; }
.hours td:first-child { color: var(--ink-mute); padding-right: var(--s7); }
table.hours { border-collapse: collapse; }

/* --- treatment groups --- */
.group + .group { margin-top: var(--s9); }
.group h2 { margin-bottom: var(--s5); }
.tlist { columns: 2; column-gap: var(--s8); max-width: 760px; }
.tlist li { break-inside: avoid; padding-block: var(--s3); border-bottom: 1px solid var(--rule); }
@media (max-width: 640px) { .tlist { columns: 1; } }

/* --- providers --- */
.provider { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; padding-block: var(--s9); border-top: 1px solid var(--rule); }
.provider:first-of-type { border-top: 0; padding-top: var(--s6); }
.provider .who { position: sticky; top: 108px; }
.provider .who h2 { font-size: var(--step-1); line-height: 1.2; }
.provider .who p { font-size: var(--step--1); color: var(--ink-mute); margin-top: var(--s2); }
@media (max-width: 860px) { .provider { grid-template-columns: 1fr; gap: var(--s5); } .provider .who { position: static; } }

/* credentials read as prose with rules, not ticks */
.creds { border-top: 1px solid var(--rule); margin-top: var(--s6); }
.creds li { padding-block: var(--s3); border-bottom: 1px solid var(--rule); font-size: var(--step--1); color: var(--ink-soft); }

/* --- quote --- */
.pull { border-left: 2px solid var(--violet-mark); padding-left: var(--s6); max-width: 40ch; }
.pull p { font-family: var(--display); font-size: var(--step-2); line-height: 1.22; }
.pull cite { display: block; margin-top: var(--s4); font-style: normal; font-size: var(--step--1); color: var(--ink-mute); }

/* --- closing CTA --- */
.close { background: var(--ink); color: var(--paper); }
.close h2 { color: var(--paper); max-width: 18ch; }
.close p { color: #cfc8dc; margin-top: var(--s5); max-width: 44ch; }
.close .actions { margin-top: var(--s7); }
.close .btn-primary { background: var(--paper); color: var(--ink); }
.close .btn-primary:hover { background: var(--violet-mark); color: var(--ink); }
.close .btn-ghost { border-color: #544c69; color: var(--paper); }
.close .btn-ghost:hover { background: #241f30; border-color: var(--paper); }
.close :focus-visible { outline-color: var(--violet-mark); }

/* --- footer --- */
.site-foot { background: var(--paper-sunk); padding-block: var(--s9) var(--s7); font-size: var(--step--1); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); }
.site-foot h4 { font: 500 var(--step--1)/1 var(--text); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: var(--s4); }
.site-foot li { padding-block: var(--s2); }
.site-foot a { text-decoration: none; color: var(--ink-soft); }
.site-foot a:hover { color: var(--violet); text-decoration: underline; text-underline-offset: .15em; }
.foot-legal { margin-top: var(--s8); padding-top: var(--s5); border-top: 1px solid var(--rule); color: var(--ink-mute); display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: var(--s6); } }

/* --- form --- */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.field label { font-size: var(--step--1); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; max-width: 100%;
  font: 400 var(--step-0)/1.4 var(--text); color: var(--ink);
  padding: var(--s3) var(--s4); min-height: 48px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.field textarea { min-height: 104px; resize: vertical; }
.field .hint { font-size: var(--step--1); color: var(--ink-mute); }
.field .err { font-size: var(--step--1); color: #8c2036; display: none; }
.field [aria-invalid="true"] { border-color: #8c2036; }
.field:has([aria-invalid="true"]) .err { display: block; }
.field:focus-within label { color: var(--violet); }

dialog.sheet {
  position: fixed; inset: 0; margin: auto;                 /* centres regardless of scrollbar */
  width: min(560px, calc(100% - 32px)); max-height: min(86dvh, 720px);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 0;
  background: var(--paper); color: var(--ink);
}
body:has(dialog.sheet[open]) { overflow: hidden; }
body:has(dialog.sheet[open]) .callbar { display: none; }
dialog.sheet::backdrop { background: rgba(26,22,34,.42); }
dialog[open].sheet { display: flex; flex-direction: column; }
dialog.sheet > form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.sheet-head, .sheet-foot { flex: 0 0 auto; padding: var(--s5) var(--s6); }
.sheet-head { border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: var(--s5); }
.sheet-head h2 { font-size: var(--step-1); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s6); }
.sheet-foot { border-top: 1px solid var(--rule); display: flex; gap: var(--s4); justify-content: flex-end; flex-wrap: wrap; }
.sheet-foot .btn { padding-inline: var(--s5); }
.x { background: none; border: 0; cursor: pointer; font-size: 1.4rem; line-height: 1; color: var(--ink-mute); padding: var(--s2); }
.x:hover { color: var(--ink); }
.done { text-align: left; }
.done h3 { margin-bottom: var(--s4); }

/* --- sticky mobile call bar --- */
.callbar { display: none; }
@media (max-width: 860px) {
  .nav { display: none; }
  .head-phone { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: var(--s2); background: none; cursor: pointer;
    border: 1px solid var(--rule-strong); border-radius: var(--radius); min-height: 44px; padding: 0 var(--s4);
    font: 500 var(--step--1)/1 var(--text); color: var(--ink);
  }
  .site-head.open .nav {
    display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: var(--s4) clamp(20px, 8vw, 48px) var(--s6);
  }
  .site-head.open .nav a { padding-block: var(--s4); border-bottom: 1px solid var(--rule); }
  .ring { display: none; }
  .actions .btn { width: 100%; }
  dialog.sheet {                                            /* bottom sheet on a phone */
    inset: auto 0 0 0; margin: 0; width: auto; max-width: none;
    max-height: calc(100dvh - 72px); border-inline: 0; border-bottom: 0;
  }
  .sheet-foot { flex-direction: column-reverse; }
  .sheet-foot .btn { width: 100%; }
  .callbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--ink); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    gap: var(--s3);
  }
  .callbar .btn { flex: 1 1 auto; min-height: 50px; padding-inline: var(--s4); }
  .callbar .btn-primary { background: var(--paper); color: var(--ink); }
  .callbar .btn-ghost { border-color: #544c69; color: var(--paper); }
  body { padding-bottom: 84px; }
  .provider .who { position: static; }
}

/* one motion moment: the hero settles once on load */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lede, .hero .actions, .hero-note {
    animation: rise .5s cubic-bezier(.16,1,.3,1) both;
  }
  .hero .lede { animation-delay: .05s; }
  .hero .actions { animation-delay: .1s; }
  .hero-note { animation-delay: .15s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}


/* --- home: staggered composition on a 12-column rail --------------------
   Each block starts on a different column, and two of them drop deliberately,
   so the page reads as a descending diagonal rather than a stack of bands. */
.rail { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 32px); }
.rail > * { min-width: 0; }

@media (min-width: 861px) {
  .col-a  { grid-column: 1 / span 4; }
  .col-b  { grid-column: 6 / span 6; }
  .col-c  { grid-column: 2 / span 5; }
  .col-d  { grid-column: 8 / span 5; margin-top: var(--s10); }
  .col-e  { grid-column: 3 / span 7; }
  .hero-grid .col-note { grid-column: 9 / span 4; }
  .drop-1 { margin-top: var(--s7); }
  .drop-2 { margin-top: var(--s9); }
}
