/* Mark Noonan Psychology
   One palette expressed as variables, redefined for dark. Nothing else theme-aware. */

:root {
  --ground:      #FBF8F3;
  --ground-alt:  #F3EEE4;
  --ink:         #3C3A34;
  --ink-soft:    #6E6A60;
  --ink-strong:  #1F4436;
  --accent:      #1F4436;
  --accent-ink:  #FBF8F3;
  --rule:        #E2DACB;
  --clay:        #9C5F42;
  --frame:       #FFFFFF;
  --map:         url("assets/map-newport.png");
  --shadow:      0 1px 2px rgba(58, 48, 32, 0.06), 0 10px 28px rgba(58, 48, 32, 0.08);

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 34rem;
  --page: 62rem;
  --gap: clamp(4rem, 9vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #151815;
    --ground-alt:  #1D211C;
    --ink:         #D6D2C8;
    --ink-soft:    #9A968C;
    --ink-strong:  #A8C6AF;
    --accent:      #A8C6AF;
    --accent-ink:  #151815;
    --rule:        #2C312B;
    --clay:        #C89075;
    --frame:       #232823;
    --map:         url("assets/map-newport-dark.png");
    --shadow:      0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.34);
  }
}

:root[data-theme="dark"] {
  --ground:      #151815;
  --ground-alt:  #1D211C;
  --ink:         #D6D2C8;
  --ink-soft:    #9A968C;
  --ink-strong:  #A8C6AF;
  --accent:      #A8C6AF;
  --accent-ink:  #151815;
  --rule:        #2C312B;
  --clay:        #C89075;
  --frame:       #232823;
  --map:         url("assets/map-newport-dark.png");
  --shadow:      0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.34);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink-strong);
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: none; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 1.2rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }

p { margin: 0 0 1.15rem; max-width: var(--measure); }

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--ground);
  z-index: 20;
}
.skip:focus { left: 0.5rem; }

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem clamp(1.25rem, 5vw, 3rem);
  background: var(--ground);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--rule); }

.wordmark {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink-strong);
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}
.site-header nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.site-header nav a:hover { color: var(--ink-strong); border-bottom-color: var(--rule); }

.theme-toggle {
  margin-left: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex: none;
}
.theme-toggle span {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--ink-strong);
  box-shadow: inset -0.32rem -0.12rem 0 0 var(--ground);
}

@media (max-width: 860px) {
  .site-header nav { display: none; }
  .theme-toggle { margin-left: auto; }
}

/* Sections ---------------------------------------------------------------- */

main { display: block; }

section {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--gap) clamp(1.25rem, 5vw, 3rem);
}

section + section { border-top: 1px solid var(--rule); }

.hero { padding-top: clamp(3.5rem, 10vw, 7rem); }
.hero h1 { margin-bottom: 2.25rem; }
.hero + section { border-top: 0; }

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.lede { font-size: 1.15rem; color: var(--ink); }
.hero .lede { max-width: none; }

.place {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 2rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.875rem;
  padding: 0.6rem 1.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}
.button:hover { opacity: 0.85; }

.quiet-link {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.quiet-link:hover { color: var(--ink-strong); border-bottom-color: currentColor; }

/* About ------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (max-width: 799px) {
  .about-grid { display: flex; flex-direction: column; }
  .portrait { order: -1; }
}
@media (min-width: 800px) {
  .about-grid { grid-template-columns: 1fr 23rem; gap: 4rem; align-items: start; }
  .portrait { position: sticky; top: 6rem; }
}

.portrait { margin: 0; }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--ground-alt);
  border-radius: 3px;
}

/* One frame treatment shared by the portrait and the map. */
.portrait,
.map {
  max-width: 23rem;
  padding: 0.5rem;
  background: var(--frame);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.about-text h3 { margin-top: 3rem; color: var(--ink-soft); font-size: 1.15rem; }

.quals {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}
.quals li { display: flex; flex-direction: column; }
.quals span { color: var(--ink); }
.quals small { color: var(--ink-soft); font-size: 0.875rem; }

/* Areas ------------------------------------------------------------------- */

.areas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem 3rem;
  margin-bottom: 3rem;
}
@media (min-width: 760px) {
  .areas-grid { grid-template-columns: 1fr 1fr; }
}
.areas-grid p { margin: 0; max-width: 30rem; }

.pullquote {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink-strong);
  max-width: none;
  border-left: 2px solid var(--rule);
  padding-left: 1.5rem;
  margin: 0;
}

/* Approach ---------------------------------------------------------------- */

#approach p,
#contact .lede { max-width: none; }

/* Modality terms are buttons that reveal a plain-language note in place. */
.term {
  font: inherit;
  font-weight: 500;
  color: var(--ink-strong);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-soft);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.term:hover,
.term[aria-expanded="true"] {
  color: var(--clay);
  text-decoration-color: currentColor;
}

.term-panel {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--ground-alt);
  border-left: 2px solid var(--clay);
  border-radius: 0 3px 3px 0;
}
.term-panel[hidden] { display: none; }
.term-panel p { margin: 0; max-width: 46rem; }
.term-more { margin-top: 0.75rem !important; font-size: 0.9375rem; }
.term-more a { color: var(--ink-soft); }

/* Getting started --------------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.5rem;
}
.steps p { margin: 0; }

/* Practical --------------------------------------------------------------- */

.practical { margin: 0 0 var(--gap); display: grid; gap: 0; }
.practical > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.practical > div:first-child { border-top: 1px solid var(--rule); }
@media (min-width: 640px) {
  .practical > div { grid-template-columns: 12rem 1fr; gap: 2rem; }
}
.practical dt { color: var(--ink-soft); font-size: 0.9375rem; }
.practical dd { margin: 0; }
.practical dd .muted { color: var(--ink-soft); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 3.5rem 0 0;
  max-width: none;
}

.button-outline {
  background: none;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.contact-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 820px) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.contact-details {
  margin: 0;
  display: grid;
  gap: 1.5rem;
}
.contact-details dt {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin-bottom: 0.15rem;
}
.contact-details dd { margin: 0; }

/* Phone and email share one size. The email is the longer of the two, so the
   size is chosen to fit it inside the column rather than to flatter the phone. */
.contact-details a {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.3;
  color: var(--ink-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15em;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-details a:hover {
  color: var(--clay);
  border-bottom-color: currentColor;
}

/* Both column headings sit at the top of the grid so they line up. */
#contact h3 {
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 1rem;
}
.address { color: var(--ink); }

.map { display: block; position: relative; max-width: none; margin: 1.5rem 0; }
.map-image {
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--map) center / cover no-repeat var(--ground-alt);
  border-radius: 3px;
  filter: saturate(0.8);
  transition: filter 0.2s ease;
}
.map:hover .map-image { filter: saturate(1); }

.pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin: -0.375rem 0 0 -0.375rem;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--clay) 28%, transparent);
}

.attribution {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 0;
  max-width: none;
}
.attribution a { color: inherit; }


/* Footer ------------------------------------------------------------------ */

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 5vw, 3rem) 6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.site-footer p { max-width: none; margin-bottom: 0.75rem; }
.site-footer a { color: var(--ink-soft); }
.crisis { color: var(--ink); }
.copyright { margin-top: 1.5rem; }

/* Mobile contact bar ------------------------------------------------------ */

.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
  background: var(--ground);
}
.mobile-bar[hidden] { display: none; }
.mobile-bar a {
  min-height: 3.25rem;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink-strong);
  font-size: 0.95rem;
}
.mobile-bar a + a { border-left: 1px solid var(--rule); }

@media (min-width: 700px) {
  .mobile-bar { display: none !important; }
}
@media (max-width: 699px) {
  .site-footer { padding-bottom: 7rem; }
}

/* Motion ------------------------------------------------------------------ */

.hero > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.hero > *:nth-child(2) { animation-delay: 0.06s; }
.hero > *:nth-child(3) { animation-delay: 0.12s; }
.hero > *:nth-child(4) { animation-delay: 0.16s; }
.hero > *:nth-child(5) { animation-delay: 0.2s; }
.hero > *:nth-child(6) { animation-delay: 0.24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
