/* ============================================================
   TRILLIUM STRATEGIES — Digital Paper Design System
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* Colors — Light (default) */
  --color-primary: #000000;
  --color-bg: #FAFAF8;
  --color-accent: #2D4A3E;
  --color-muted: #6B6B6B;
  --color-rule: #E0DDD8;
  --color-white: #FFFFFF;
  --color-card-bg: var(--color-bg);
  --color-svg: #000000;

  /* Typography */
  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;

  /* Theme transition */
  --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --color-primary: #E8E6E1;
  --color-bg: #0E0E0E;
  --color-accent: #6BBF9A;
  --color-muted: #918F8A;
  --color-rule: #2A2826;
  --color-white: #0E0E0E;
  --color-card-bg: #161614;
  --color-svg: #E8E6E1;
}

/* Respect OS preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #E8E6E1;
    --color-bg: #0E0E0E;
    --color-accent: #6BBF9A;
    --color-muted: #918F8A;
    --color-rule: #2A2826;
    --color-white: #0E0E0E;
    --color-card-bg: #161614;
    --color-svg: #E8E6E1;
  }
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-primary);
  background-color: var(--color-bg);
  transition: var(--theme-transition);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
  max-width: 65ch;
}

.text-muted {
  color: var(--color-muted);
}

.text-accent {
  color: var(--color-accent);
}

.font-serif {
  font-family: var(--font-serif);
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-xl) 0;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: var(--theme-transition), height 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.wordmark span {
  font-weight: 400;
  color: var(--color-muted);
}

.site-nav {
  display: flex;
  gap: var(--space-md);
}

.site-nav a {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  transition: color 0.2s ease;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: width 0.2s ease;
}

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

.site-nav a:hover::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--color-primary);
  margin: 6px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Theme toggle — fixed bottom-right */
.theme-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 200;
  background-color: var(--color-bg);
  border: 1px solid var(--color-rule);
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0;
  color: var(--color-muted);
  transition: var(--theme-transition), border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Hide the icon for the currently active theme, show the other */
.theme-toggle .icon-moon { display: inline-block; }
.theme-toggle .icon-sun  { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: inline-block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: inline-block; }
}

/* --- Hero --- */
.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-style: italic;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  max-width: 50ch;
}

.hero-values {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-lg);
}

.hero-values .value-word {
  font-family: var(--font-serif);
  font-size: clamp(0.875rem, 1.5vw, 1.125rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-values .value-separator {
  width: 40px;
  height: 1px;
  background-color: var(--color-rule);
}

.hero-globe {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translateX(-50%);
  width: 75%;
  max-width: 800px;
  opacity: 0.07;
  z-index: 1;
}

.hero-globe canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* --- About --- */
.about-prose {
  max-width: 720px;
}

.about-prose h2 {
  margin-bottom: var(--space-md);
}

.about-prose p {
  font-family: var(--font-serif);
  color: var(--color-primary);
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: var(--space-sm);
}

.about-prose strong {
  color: var(--color-primary);
  font-weight: 700;
}

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

/* --- Services --- */
.services-header {
  margin-bottom: var(--space-lg);
}

.services-header h2 {
  margin-bottom: var(--space-sm);
}

.services-header p {
  color: var(--color-muted);
  font-size: 1.0625rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--color-rule);
  border: 1px solid var(--color-rule);
}

.service-card {
  background-color: var(--color-card-bg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: var(--theme-transition);
}

.service-icon {
  width: 40px;
  height: 40px;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  fill: none;
}

.service-card h3 {
  font-size: 1.125rem;
}

.service-card p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* --- Values --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.value-block {
  padding: var(--space-lg) var(--space-md);
  border-right: 1px solid var(--color-rule);
}

.value-block:last-child {
  border-right: none;
}

.value-block .value-name {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
  line-height: 1.1;
}

.value-block .value-number {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.value-block p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
}

/* --- Global Presence --- */
.global-section {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.global-section h2 {
  margin-bottom: var(--space-sm);
}

.global-section .global-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-muted);
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
}

.globe-map {
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.7;
}

.globe-map circle {
  fill: var(--color-primary);
}

/* Subtle pulse animation for dots */
@keyframes dot-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.globe-map .dot-pulse {
  animation: dot-pulse 3s ease-in-out infinite;
}

.globe-map .dot-pulse:nth-child(3n) {
  animation-delay: 0.5s;
}

.globe-map .dot-pulse:nth-child(5n) {
  animation-delay: 1s;
}

.globe-map .dot-pulse:nth-child(7n) {
  animation-delay: 1.5s;
}

/* --- Contact --- */
.contact-section {
  padding: var(--space-2xl) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.contact-text h2 {
  margin-bottom: var(--space-md);
}

.contact-text p {
  color: var(--color-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 45ch;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-left: var(--space-lg);
  border-left: 1px solid var(--color-rule);
}

.contact-item {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.contact-value {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.contact-value a {
  border-bottom: 1px solid var(--color-rule);
  transition: border-color 0.2s ease;
}

.contact-value a:hover {
  border-color: var(--color-primary);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--color-rule);
  padding: var(--space-lg) 0;
}

.footer-cta {
  text-align: center;
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 1px dotted var(--color-rule);
}

.footer-cta-question {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.footer-cta-link {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  transition: color 0.2s ease;
}

.footer-cta-link:hover {
  color: var(--color-primary);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-wordmark {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.footer-nav {
  display: flex;
  gap: var(--space-md);
}

.footer-nav a {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

/* --- Scroll fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Survey / Intake Form --- */
.survey-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-xl) 0 var(--space-md);
}

.survey-intro h1 {
  margin-bottom: var(--space-md);
}

.survey-intro p {
  font-family: var(--font-serif);
  color: var(--color-primary);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.survey-form {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 var(--space-xl);
}

.survey-question {
  padding: var(--space-md) 0;
  border-bottom: 1px dotted var(--color-rule);
}

.survey-question:last-of-type {
  border-bottom: none;
}

.survey-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.survey-label small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.survey-row {
  display: flex;
  gap: var(--space-md);
}

.survey-row .survey-field {
  flex: 1;
}

.survey-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.survey-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.survey-field input[type="text"],
.survey-field input[type="email"],
.survey-field textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-rule);
  padding: 0.5rem 0;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

.survey-field input[type="text"]:focus,
.survey-field input[type="email"]:focus,
.survey-field textarea:focus {
  border-bottom-color: var(--color-primary);
}

.survey-field textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.6;
}

/* Radio and checkbox groups */
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.survey-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-primary);
}

.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid var(--color-rule);
  background: transparent;
  margin-top: 2px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.survey-option input[type="radio"] {
  border-radius: 50%;
}

.survey-option input[type="checkbox"] {
  border-radius: 2px;
}

.survey-option input[type="radio"]:checked,
.survey-option input[type="checkbox"]:checked {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

.survey-option input[type="radio"]:hover,
.survey-option input[type="checkbox"]:hover {
  border-color: var(--color-primary);
}

/* "Other" free text field inline with radio/checkbox */
.survey-other-text {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-rule);
  padding: 0.25rem 0;
  outline: none;
  width: 100%;
  max-width: 300px;
  margin-top: 0.25rem;
  transition: border-color 0.2s ease;
}

.survey-other-text:focus {
  border-bottom-color: var(--color-primary);
}

/* Submit button */
.survey-submit {
  margin-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.survey-submit button {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-bg);
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 0.875rem 2.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.survey-submit button:hover {
  background-color: transparent;
  color: var(--color-primary);
}

.survey-submit-note {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 600px) {
  .survey-row {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* --- Print Styles --- */
@media print {
  .site-header,
  .site-footer {
    position: static;
  }

  .theme-toggle {
    display: none;
  }

  .hero-globe {
    display: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  section {
    page-break-inside: avoid;
    padding: 2rem 0;
  }

  body {
    font-size: 11pt;
    background: white;
    color: black;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* --- Responsive: Tablet --- */
@media (max-width: 900px) {

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .value-block {
    border-right: none;
    border-bottom: 1px solid var(--color-rule);
    padding: var(--space-md) 0;
  }

  .value-block:last-child {
    border-bottom: none;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .contact-details {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--color-rule);
    padding-top: var(--space-md);
  }

  .hero-globe {
    position: static;
    transform: none;
    width: 100%;
    max-width: 400px;
    margin: var(--space-lg) auto 0;
    opacity: 0.08;
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 600px) {
  :root {
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-rule);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    transition: var(--theme-transition);
  }



  .site-nav.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-values {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .hero-values .value-separator {
    width: 30px;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}
