/* ==========================================================================
   rousseaux.ca — stylesheet
   One file. Palette and type scale live in the custom properties below.
   Edit those first; most of the page follows from them.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (self-hosted, subset to Latin)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-sans-3-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-semibold.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Palette */
  --night: #111a24;   /* page background */
  --ink: #1c2b3a;     /* raised surfaces: hero, nav, fields */
  --chalk: #e8eae6;   /* primary text */
  --gravel: #9aa3ad;  /* secondary text */
  --steel: #7fa3c4;   /* links, borders */
  --canola: #e3b505;  /* hero rule, one button, focus rings */
  --hairline: rgba(232, 234, 230, 0.12);

  /* Type */
  --font-sans: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Scale: 1.2 ratio from a 17px base */
  --text-sm: 0.9375rem;   /* 15px */
  --text-base: 1.0625rem; /* 17px */
  --text-md: 1.25rem;     /* 20px */
  --text-lg: 1.5rem;      /* 24px */
  --text-xl: 1.8125rem;   /* 29px */
  --text-2xl: 2.1875rem;  /* 35px */
  --text-hero: clamp(2.125rem, 1.4rem + 3.2vw, 3.25rem); /* 34px to 52px */

  --leading-body: 1.6;
  --leading-tight: 1.15;
  --measure: 62ch;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;

  --content-width: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-3);
  max-width: var(--measure);
}

a {
  color: var(--steel);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--chalk);
}

strong {
  font-weight: 600;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* One focus style for everything. Canola on Night reads clearly. */
:focus-visible {
  outline: 3px solid var(--canola);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  background: var(--canola);
  color: var(--night);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-2);
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   4. Header and navigation
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--ink);
  border-bottom: 1px solid var(--hairline);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}

.site-name {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  color: var(--chalk);
  text-decoration: none;
}

.site-name:hover {
  color: var(--canola);
}

/* The Rx mark, same file as the favicon. */
.site-mark {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: -0.55em;
  margin-right: 0.6rem;
  border-radius: 4px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  max-width: none;
}

.site-nav a {
  color: var(--gravel);
  text-decoration: none;
  font-size: var(--text-base);
  padding-block: var(--space-1);
}

.site-nav a:hover {
  color: var(--chalk);
}

/* --------------------------------------------------------------------------
   5. Hero — the one bold moment on the page
   -------------------------------------------------------------------------- */

.hero {
  background: var(--ink);
  padding-block: var(--space-6) var(--space-6);
}

@media (min-width: 48em) {
  .hero {
    padding-block: var(--space-7) var(--space-7);
  }
}

.hero-name {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--gravel);
  margin: 0 0 var(--space-3);
}

.hero-statement {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.12;
  max-width: 24ch;
  margin: 0 0 var(--space-4);
}

.hero-rule {
  width: 4.5rem;
  height: 4px;
  background: var(--canola);
  border: 0;
  margin: 0 0 var(--space-4);
  transform-origin: left center;
}

/* The single deliberate motion on the page. */
@media (prefers-reduced-motion: no-preference) {
  .hero-rule {
    animation: draw-rule 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes draw-rule {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.hero-support {
  font-size: var(--text-md);
  color: var(--gravel);
  max-width: 44ch;
  margin-bottom: var(--space-4);
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--text-md);
}

.hero-contact a {
  color: var(--chalk);
}

.hero-contact a:hover {
  color: var(--canola);
}

/* --------------------------------------------------------------------------
   6. Sections
   -------------------------------------------------------------------------- */

.section {
  padding-block: var(--space-6);
  border-top: 1px solid var(--hairline);
}

.section:first-of-type {
  border-top: 0;
}

.section-intro {
  font-size: var(--text-md);
  color: var(--gravel);
  margin-bottom: var(--space-5);
}

/* Why people get in touch */

.reasons {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 40em) {
  .reasons {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4) var(--space-5);
  }
}

.reasons li {
  padding-left: var(--space-3);
  border-left: 2px solid var(--steel);
}

.reasons strong {
  display: block;
  color: var(--chalk);
}

.reasons span {
  color: var(--gravel);
}

/* Services: three groups, each a list of name | description rows */

.service-group {
  margin-bottom: var(--space-5);
}

.service-group:last-child {
  margin-bottom: 0;
}

.service-group h3 {
  margin-bottom: var(--space-1);
}

.service-group .group-lead {
  color: var(--gravel);
  margin-bottom: var(--space-3);
}

.services {
  margin: 0;
  max-width: none;
  border-top: 1px solid var(--hairline);
}

.services > div {
  display: grid;
  gap: var(--space-1) var(--space-5);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--hairline);
}

@media (min-width: 48em) {
  .services > div {
    grid-template-columns: minmax(12rem, 1fr) 2.2fr;
    padding-block: var(--space-4);
  }
}

.services dt {
  font-weight: 600;
  font-size: var(--text-md);
  line-height: 1.3;
}

.services dd {
  margin: 0;
  color: var(--gravel);
  max-width: var(--measure);
}

/* How I work */

.how {
  list-style: none;
  counter-reset: how;
  padding: 0;
  margin: 0;
  max-width: none;
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 48em) {
  .how {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

.how li {
  counter-increment: how;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--space-3);
}

.how li::before {
  content: counter(how);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: 1;
  color: var(--steel);
  padding-top: 0.15em;
}

.how strong {
  display: block;
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

.how p {
  color: var(--gravel);
  margin: 0;
}

/* About */

.about-grid {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

@media (min-width: 48em) {
  .about-grid {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: var(--space-5);
  }
}

.about-photo {
  background: var(--ink);
  aspect-ratio: 4 / 5;
  max-width: 16rem;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Contact */

.contact-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 48em) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--space-6);
  }
}

.contact-details dl {
  margin: 0;
}

.contact-details dt {
  color: var(--gravel);
  font-size: var(--text-sm);
}

.contact-details dd {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
}

.contact-details dd a {
  color: var(--chalk);
}

.contact-details dd a:hover {
  color: var(--canola);
}

/* Form */

.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.form-field .hint {
  display: block;
  color: var(--gravel);
  font-size: var(--text-sm);
  font-weight: 400;
}

.form-field input,
.form-field textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--chalk);
  background: var(--ink);
  border: 1px solid var(--steel);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
}

.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline-offset: 1px;
}

/* Honeypot. Hidden from people, present for bots. Not display:none,
   since some bots skip fields that are display:none. */
.form-extra {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--night);
  background: var(--canola);
  border: 0;
  border-radius: 2px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--chalk);
  color: var(--night);
}

.button:focus-visible {
  outline-color: var(--chalk);
}

.form-note {
  color: var(--gravel);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

/* Messages from the PHP handler (rendered on index.html after redirect) */

.notice {
  border-left: 3px solid var(--steel);
  background: var(--ink);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  max-width: var(--measure);
}

.notice.is-error {
  border-left-color: var(--canola);
}

.notice p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-5);
  color: var(--gravel);
  font-size: var(--text-sm);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.site-footer a {
  color: var(--gravel);
}

.site-footer a:hover {
  color: var(--chalk);
}

/* --------------------------------------------------------------------------
   8. Privacy page and other plain text pages
   -------------------------------------------------------------------------- */

.page {
  padding-block: var(--space-6);
}

.page h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.page h2 {
  font-size: var(--text-lg);
  margin-top: var(--space-5);
}
