/*
  Canon Wright — interim site.
  Tokens are a trimmed copy of the Holding site's src/styles/tokens.css,
  so the two stay visually consistent.
*/

@font-face {
  font-family: 'Raleway';
  src: url('../fonts/Raleway-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-primary: #5a8a09;
  --brand-primary-dark: #49720d;
  --brand-accent: #d97706;
  --brand-accent-dark: #c2650a;
  --text-on-brand: #ffffff;

  --text-primary: #3d3d3d;
  --text-secondary: #4a4a4a;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --border-subtle: #e5e7eb;
  --contour: #5a8a09;
  --contour-opacity: 0.14;

  --radius: 6px;
  --radius-full: 9999px;

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.2s ease;
  color-scheme: light;
}

/* System dark preference applies until the visitor picks a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --border-subtle: #30363d;
    --brand-primary: #7fb02a;
    --contour: #7fb02a;
    --contour-opacity: 0.12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text-primary: #f0f6fc;
  --text-secondary: #c9d1d9;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --border-subtle: #30363d;
  --brand-primary: #7fb02a;
  --contour: #7fb02a;
  --contour-opacity: 0.12;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-primary);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* ===== Header ===== */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-10);
  border-top: 3px solid var(--brand-primary);
}

.logo { display: inline-flex; line-height: 0; }
.logo img { height: 48px; width: auto; }

/* Swap logo variant with the theme. Light variant is the no-JS fallback. */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.theme-toggle svg {
  width: 19px; height: 19px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===== Main / hero ===== */
main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Decorative contour lines, like a map of a place that doesn't exist yet. */
.contours {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.contours path {
  fill: none;
  stroke: var(--contour);
  stroke-width: 1.4;
  opacity: var(--contour-opacity);
  vector-effect: non-scaling-stroke;
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 50rem;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-20);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  color: var(--brand-primary-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-6);
}
:root[data-theme="dark"] .eyebrow { color: var(--brand-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .eyebrow { color: var(--brand-primary); }
}
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 var(--space-6);
  text-wrap: balance;
}
.hero h1 .mark {
  color: var(--brand-primary);
  position: relative;
  display: inline-block;
}
.hero h1 .mark::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px;
  bottom: 0.08em;
  height: 0.14em;
  background: color-mix(in srgb, var(--brand-primary) 22%, transparent);
  border-radius: var(--radius-full);
  z-index: -1;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto var(--space-10);
  text-wrap: pretty;
}

.lede + .note { margin-top: calc(-1 * var(--space-4)); }
.note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: var(--space-6) 0 0;
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-6);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}
.btn-primary {
  background: var(--brand-accent);
  color: var(--text-on-brand);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}
.btn-primary:hover {
  background: var(--brand-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

/* ===== Entrance animation ===== */
.rise {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}
.rise-1 { animation-delay: 0.1s; }
.rise-2 { animation-delay: 0.2s; }
.rise-3 { animation-delay: 0.3s; }
.rise-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-6);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--brand-primary); }
.site-footer .nowrap { white-space: nowrap; }
.site-footer .sep { margin: 0 var(--space-2); opacity: 0.6; }

/* ===== Text pages (privacy, 404) ===== */
.prose {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-16);
}
.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}
.prose .updated {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-8);
}
.prose h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-2);
}
.prose p, .prose li { color: var(--text-secondary); }
.prose a { color: var(--brand-primary); font-weight: 600; }
.prose a.btn { color: var(--text-on-brand); }
.prose ul { padding-left: var(--space-5); }

.center-page {
  text-align: center;
  margin: auto;
}
.center-page p { margin-bottom: var(--space-8); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-header { padding: var(--space-4) var(--space-5); }
  .logo img { height: 34px; }
  .hero { padding-top: var(--space-10); }
}

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