/* ============================================================
   CFTP Oshawa — Base, typography, shell, buttons, forms
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 1em; }
a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-deep); }

img, svg, video { display: block; max-width: 100%; height: auto; }
img { user-select: none; }

ul, ol { padding-left: 1.2em; }

/* ---------- A11y ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-md) 0; z-index: 400; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

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

::selection { background: var(--red); color: #fff; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: var(--container-wide); }

.section { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.section--warm { background: var(--paper-warm); }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: #EDF1F4; }
.section--ink h2, .section--ink h3 { color: #fff; }

/* ---------- Eyebrow / kicker ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.8125rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--red);
  margin: 0 0 1rem;
}
.eyebrow::before {
  content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--red);
}
.eyebrow--blue { color: var(--blue-dark); }
.eyebrow--blue::before { background: var(--blue); }
.section--ink .eyebrow { color: #7fd0ff; }
.section--ink .eyebrow::before { background: var(--blue); }

/* ---------- Lead / intro ---------- */
.section-head { max-width: 720px; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.section-head p { color: var(--slate); font-size: 1.1rem; }
.lead { font-size: 1.15rem; color: var(--slate); max-width: 34em; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: var(--red);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.975rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.6rem; border-radius: var(--r-md);
  border: 2px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bg: var(--paper-warm); border-color: var(--ink-soft); color: var(--ink); box-shadow: none; }

.btn--blue { --btn-bg: var(--blue); --btn-bd: var(--blue); }
.btn--blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn--invert { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn--invert:hover { background: var(--paper-warm); border-color: var(--paper-warm); color: var(--ink); }

.btn--lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn--sm { padding: 0.6rem 1.05rem; font-size: 0.875rem; }

.btn .arrow { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Text link (contextual action) ---------- */
.text-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  color: var(--red); text-decoration: none; letter-spacing: 0.01em;
}
.text-link:hover { color: var(--red-dark); }
.text-link .arrow { transition: transform var(--dur-fast) var(--ease); }
.text-link:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo { height: 62px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-text span { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.nav { display: flex; align-items: center; gap: clamp(0.6rem, 1.5vw, 1.4rem); }
.nav a:not(.btn) {
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  color: var(--ink-soft); text-decoration: none; letter-spacing: 0.02em;
  padding: 0.4rem 0.1rem; position: relative; white-space: nowrap;
}
.nav a:not(.btn):hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--red); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--red); border-radius: 2px;
}
.nav-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; cursor: pointer; color: var(--ink);
}

/* ---------- Mobile drawer ---------- */
.drawer {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(10,14,18,0.5); opacity: 0; transition: opacity var(--dur) var(--ease); }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 360px);
  background: var(--paper); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;
  transform: translateX(100%); transition: transform var(--dur) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.drawer__close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; font-size: 1.1rem; }
.drawer a.drawer-link {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--line-soft);
}
.drawer a.drawer-link:hover { color: var(--red); }
.drawer .btn { margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C6CFD6; padding: clamp(3rem, 2rem + 4vw, 5rem) 0 2rem; }
.site-footer a { color: #D7DFE5; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer-brand p { color: #A9B4BD; max-width: 30em; }
.footer-col h4 { color: #fff; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.footer-col a { text-decoration: none; font-size: 0.95rem; }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.footer-contact .ico { color: var(--blue); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; font-size: 0.85rem; color: #8E9AA4; }
.footer-bottom a { color: #8E9AA4; }
.footer-bottom a:hover { color: #fff; }
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: 0.8rem 0.95rem; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: #fff; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(32,138,197,0.18);
}
.input::placeholder, .textarea::placeholder { color: #9AA6AF; }
.textarea { resize: vertical; min-height: 120px; }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--red); }
.field-msg { font-size: 0.82rem; color: var(--red); font-weight: 600; }

.form-note { font-size: 0.82rem; color: var(--muted); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--muted); }

/* ---------- Media helpers ---------- */
.media-frame { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--mist); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }

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

/* ---------- Responsive: header/footer ---------- */
@media (max-width: 1023px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .brand-text span { display: none; }
  .brand-logo { height: 48px; }
}
