/* ============================================================
   STERLING HARTWELL — STYLE.CSS
   Shared layout, typography, components
   Design system v2: Graphite / Platinum / Steel
   ============================================================ */

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

.section--alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.section-rule {
  width: 60px;
  height: 1px;
  background: var(--border);
  margin: var(--space-5) auto 0;
}

.section-lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-top: var(--space-5);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }

p {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  margin-bottom: var(--space-4);
}

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

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

.text-small {
  font-size: var(--fs-sm);
}

.text-xs {
  font-size: var(--fs-xs);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: var(--space-4) var(--space-8);
  border: 1px solid currentColor;
  border-radius: 0;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  color: var(--text);
  background: transparent;
  border-color: var(--text);
}

.btn--primary:hover,
.btn--primary:focus {
  color: var(--accent);
  border-color: var(--accent);
}

.btn--primary:active {
  transform: scale(0.98);
}

.btn--secondary {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}

.btn--secondary:hover,
.btn--secondary:focus {
  color: var(--bg-deep);
  background: var(--accent);
  border-color: var(--accent);
}

.btn--loading {
  position: relative;
  color: transparent !important;
}

.btn--loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-note {
  text-align: center;
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--text-muted);
  margin-top: var(--space-5);
}

/* Validation states */
.form-input:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown),
.form-select:invalid:not([value=""]) {
  border-color: var(--accent);
}

.form-input:valid,
.form-textarea:valid,
.form-select:valid {
  border-color: var(--border);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: var(--bg);
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-12);
  position: relative;
  z-index: 1;
}

.hero-content { padding-right: var(--space-8); }

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: var(--fs-xl);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.hero-context {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--space-10);
  max-width: 540px;
}

.hero-principles {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.principle {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--text);
}

.hero-cta { align-self: flex-start; }

.hero-ornament {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  color: var(--border);
}

.hero-line { width: 100%; max-width: 200px; height: 1px; }

.hero-date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(58, 58, 56, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
}

.sh-monogram {
  width: 48px;
  height: 48px;
  color: var(--text);
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.site-nav {
  display: flex;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-list a {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding: var(--space-2) 0;
  position: relative;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-list a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--duration-normal) var(--ease-out);
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--text);
}

.nav-list a:hover::after,
.nav-list a:focus::after {
  width: 100%;
}

.nav-cta {
  color: var(--text) !important;
  padding: var(--space-2) var(--space-4) !important;
  border: 1px solid var(--border);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-cta:hover,
.nav-cta:focus {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg-deep) !important;
}

.nav-cta::after {
  display: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-deep);
  color: var(--text);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-10);
  align-items: start;
  margin-bottom: var(--space-10);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
}

.footer-logo .sh-monogram {
  color: var(--accent);
}

.footer-name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-top: var(--space-1);
}

.footer-locations {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: var(--space-10);
}

.footer-nav-group h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.footer-nav-group ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-nav-group a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-nav-group a:hover,
.footer-nav-group a:focus {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-6);
}

.footer-rule {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0 auto var(--space-6);
}

.copyright {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.disclaimer {
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   CARD COMPONENT
   ============================================================ */
.card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--accent);
}

/* Approach cards */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.approach-card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.approach-card:hover {
  border-color: var(--accent);
}

.card-number {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.approach-card .card-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-4);
}

.approach-card .card-body {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* Portfolio cards */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.portfolio-card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all var(--duration-normal) var(--ease-out);
}

.portfolio-card:hover {
  border-color: var(--accent);
}

.card-header {
  margin-bottom: var(--space-5);
}

.card-category {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-2);
}

.card-title {
  font-size: var(--fs-xl);
}

.card-body {
  flex: 1;
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-5);
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: var(--space-1) var(--space-3);
}

/* Standards cards */
.standards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.standard-card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.standard-card:hover {
  border-color: var(--accent);
}

.principle {
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.principle:hover {
  border-color: var(--accent);
}

.principle-number {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.principle-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-4);
}

.principle-body {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* About stats */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ============================================================
   SCROLL REVEAL (progressive enhancement)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

/* Stagger delays for grid children */
.approach-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.approach-grid .reveal:nth-child(2) { transition-delay: 100ms; }
.approach-grid .reveal:nth-child(3) { transition-delay: 200ms; }
.approach-grid .reveal:nth-child(4) { transition-delay: 300ms; }

.portfolio-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.portfolio-grid .reveal:nth-child(2) { transition-delay: 100ms; }
.portfolio-grid .reveal:nth-child(3) { transition-delay: 200ms; }
.portfolio-grid .reveal:nth-child(4) { transition-delay: 300ms; }
.portfolio-grid .reveal:nth-child(5) { transition-delay: 400ms; }
.portfolio-grid .reveal:nth-child(6) { transition-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root {
    --fs-4xl: 2.5rem;
    --fs-3xl: 2rem;
  }

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

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }

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

@media (max-width: 768px) {
  :root {
    --fs-4xl: 2rem;
    --fs-3xl: 1.75rem;
    --header-height: 70px;
  }

  .approach-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-list {
    display: none; /* Mobile nav would need JS - hidden for MVP */
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header,
  .btn,
  .contact-form,
  .site-footer {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 0;
  }

  body {
    background: white;
    color: black;
  }

  .section-alt {
    background: white;
  }

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

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

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