/* ==========================================================================
   Materia Arche — Design System & Main Stylesheet
   ========================================================================== */

/* ---------- Design Tokens ---------- */

:root {
  /* Backgrounds */
  --bg-main: #F7F6F2;
  --bg-soft: #F1EFE8;
  --surface: #FFFFFF;

  /* Navy */
  --navy-900: #16324F;
  --navy-700: #2E4963;

  /* Slate */
  --slate-500: #5F7C95;
  --slate-300: #AAB8C4;

  /* Teal */
  --teal-700: #2E6863;
  --teal-500: #4F8B84;

  /* Amber */
  --amber-600: #C28A2C;
  --amber-300: #E2C178;

  /* Text */
  --text-main: #1F2A33;
  --text-muted: #5A6570;
  --text-light: #FFFFFF;

  /* Borders */
  --border-light: #D9D8D1;
  --border-mid: #C7C9C8;

  /* Button hover */
  --navy-hover: #10273D;

  /* Spacing scale (8px base) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 80px;
  --sp-8: 96px;
  --sp-9: 120px;
  --sp-10: 160px;

  /* Grid */
  --grid-max: 1200px;
  --grid-gutter: 24px;
  --grid-padding: 40px;
}

/* ---------- Reset ---------- */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  color: var(--navy-900);
  font-weight: 600;
}

h1 {
  font-size: 3.5rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
}

h3 {
  font-size: 1.75rem;
  line-height: 1.2;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.body-l {
  font-size: 1.25rem;
  line-height: 1.5;
}

.small {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.eyebrow {
  font-size: 0.8125rem;
  line-height: 1.4;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--teal-700);
  margin-bottom: var(--sp-2);
  display: block;
}

p {
  max-width: 72ch;
}

p + p {
  margin-top: 1em;
}

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

/* ---------- Layout ---------- */

.container {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: 0 var(--grid-padding);
}

.section-intro {
  max-width: 640px;
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
  font-size: 1.125rem;
  line-height: 1.6;
}

.section {
  padding: var(--sp-8) 0;
}

.bg-soft {
  background-color: var(--bg-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--navy-900);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--navy-hover);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--navy-900);
  border: 1.5px solid var(--navy-900);
}

.btn-secondary:hover {
  background-color: var(--navy-900);
  color: var(--text-light);
}

.btn-inverted {
  background-color: var(--surface);
  color: var(--navy-900);
}

.btn-inverted:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* ---------- Focus Styles ---------- */

:focus-visible {
  outline: 2px solid var(--teal-700);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid var(--teal-700);
  outline-offset: 3px;
}

.nav-cta:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 3px;
}

.final-cta a:focus-visible,
.footer a:focus-visible {
  outline-color: var(--surface);
}

/* ---------- Cards ---------- */

.card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--sp-3) var(--sp-4);
  transition: box-shadow 200ms ease;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(22, 50, 79, 0.05);
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  color: var(--text-main);
  font-size: 1.125rem;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

/* ---------- Mini Cards (partners section) ---------- */

.mini-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--sp-3) var(--sp-4);
  transition: box-shadow 200ms ease;
}

.mini-card:hover {
  box-shadow: 0 8px 24px rgba(22, 50, 79, 0.05);
}

.mini-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--sp-1);
}

.mini-card p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- 1. Header ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 84px;
  display: flex;
  align-items: center;
  background-color: transparent;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.nav.scrolled {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(22, 50, 79, 0.04);
}

.nav-inner {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: 0 var(--grid-padding);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.nav-logo {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-900);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  justify-content: center;
}

.nav-links li {
  display: contents;
}

.nav-links a {
  color: var(--slate-500);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 180ms ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--navy-900);
}

.nav-cta {
  background-color: var(--navy-900);
  color: var(--text-light);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 180ms ease;
}

.nav-cta:hover {
  background-color: var(--navy-hover);
}

/* Hamburger */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--navy-900);
  margin: 6px 0;
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- 2. Hero ---------- */

.hero {
  padding-top: 72px;
  display: flex;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 139, 132, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gutter);
  align-items: center;
}

.hero-content {
  grid-column: 1 / 7;
  max-width: 580px;
}

.hero-content .eyebrow {
  margin-bottom: var(--sp-2);
}

.hero-content h1 {
  margin-bottom: var(--sp-3);
}

.hero-content .body-l {
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: var(--sp-4);
}

.hero-buttons {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.trust-strip {
  font-size: 0.8125rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--slate-500);
}

.hero-visual {
  grid-column: 7 / 13;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagram-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--sp-3);
  width: 100%;
  max-width: 300px;
}

.diagram-card svg {
  width: 100%;
  height: auto;
}

/* ---------- 3. For Perovskite Teams ---------- */

#perovskite h2 {
  margin-bottom: var(--sp-2);
}

#perovskite .section-intro {
  margin-bottom: var(--sp-6);
}

/* ---------- 4. Our First Offer ---------- */

.offer-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  transition: box-shadow 200ms ease;
}

.offer-card:hover {
  box-shadow: 0 8px 24px rgba(22, 50, 79, 0.05);
}

.offer-card h3 {
  margin-bottom: var(--sp-1);
}

.offer-card .offer-meta {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--teal-700);
  margin-bottom: var(--sp-2);
  font-weight: 500;
}

.offer-card > p:not(.offer-meta):not(.offer-output) {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: var(--sp-3);
  flex: 1;
}

.offer-card .offer-output {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--teal-700);
  padding-left: var(--sp-2);
  border-left: 3px solid var(--teal-500);
  margin-top: auto;
}

/* ---------- 5. Why This Works (Method) ---------- */

.method-grid {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--sp-6);
  align-items: start;
}

.method-intro .body-l {
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1.5;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.principle {
  border-left: 3px solid var(--teal-500);
  padding-left: var(--sp-3);
}

.principle h3 {
  font-size: 1.25rem;
  margin-bottom: var(--sp-1);
}

.principle p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---------- 6. Evidence ---------- */

#evidence .container {
  max-width: 720px;
}

#evidence .section-intro {
  margin-left: auto;
  margin-right: auto;
}

#evidence .btn {
  margin-top: var(--sp-3);
}

/* ---------- 7. Research Partners ---------- */

#partners .section-intro {
  margin-bottom: var(--sp-5);
}

#partners > .container > .small {
  margin-top: var(--sp-5);
  display: block;
}

/* ---------- 8. Adjacent Materials ---------- */

#adjacent {
  padding: var(--sp-6) 0;
}

#adjacent .container {
  max-width: 680px;
}

#adjacent h2 {
  font-size: 1.5rem;
  color: var(--navy-700);
  margin-bottom: var(--sp-2);
}

#adjacent > .container > p {
  color: var(--text-muted);
}

#adjacent .small {
  margin-top: var(--sp-3);
  display: block;
}

/* ---------- 9. Final CTA ---------- */

.final-cta {
  padding: var(--sp-9) 0;
  background-color: var(--navy-900);
  color: var(--text-light);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.final-cta::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.final-cta .container {
  position: relative;
  z-index: 1;
}

.final-cta h2 {
  color: var(--text-light);
  margin-bottom: var(--sp-2);
}

.final-cta > .container > p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 560px;
  margin: 0 auto var(--sp-5);
}

.final-cta .btn-inverted {
  margin-bottom: var(--sp-4);
}

.final-cta .small {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- 10. Footer ---------- */

.footer {
  background-color: var(--navy-900);
  color: var(--text-light);
  padding: var(--sp-6) 0 var(--sp-4);
  min-height: 220px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.footer-logo {
  font-family: 'Inter Tight', sans-serif;
  color: var(--text-light);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.footer-links {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9375rem;
  transition: color 180ms ease;
}

.footer-links a:hover {
  color: var(--text-light);
}

.footer-contact {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--sp-1);
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: color 180ms ease, border-color 180ms ease;
}

.footer-contact a:hover {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.6);
}

.footer-tagline {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- Milestones List ---------- */

.milestones-list {
  max-width: 720px;
  counter-reset: milestone;
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.milestones-list li {
  counter-increment: milestone;
  position: relative;
  padding-left: 48px;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.milestones-list li::before {
  content: counter(milestone);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--teal);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Status List ---------- */

.status-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.status-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.status-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--teal);
}

/* ---------- Two-column card grid ---------- */

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

/* ==========================================================================
   Responsive — Tablet (max 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  :root {
    --grid-gutter: 20px;
    --grid-padding: 28px;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 2.875rem;
  }

  h2 {
    font-size: 2.125rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .hero-content {
    grid-column: 1 / -1;
    max-width: 600px;
  }

  .hero-visual {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .diagram-card {
    max-width: 420px;
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

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

/* ==========================================================================
   Responsive — Mobile (max 767px)
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --grid-padding: 20px;
  }

  h1 {
    font-size: 2.375rem;
    line-height: 1.1;
  }

  h2 {
    font-size: 1.875rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  /* Header */
  .nav {
    height: 72px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface);
    flex-direction: column;
    padding: var(--sp-4) var(--sp-3);
    gap: var(--sp-3);
    justify-content: flex-start;
    overflow-y: auto;
    z-index: 999;
    border-top: 1px solid var(--border-light);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.125rem;
    padding: var(--sp-1) 0;
  }

  .nav-cta {
    display: none;
  }

  /* Hero */
  .hero {
    padding-top: var(--sp-5);
    min-height: auto;
    padding-bottom: var(--sp-6);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .hero-content {
    grid-column: 1 / -1;
  }

  .hero-visual {
    grid-column: 1 / -1;
  }

  .diagram-card {
    max-width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
    gap: var(--sp-2);
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* Sections spacing */
  .section {
    padding: var(--sp-6) 0;
  }

  #adjacent {
    padding: var(--sp-5) 0;
  }

  /* All grids single column */
  .card-grid,
  .card-grid--two,
  .principles-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  /* Final CTA */
  .final-cta {
    padding: var(--sp-7) 0;
  }

  /* Footer */
  .footer-main {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .footer-links {
    flex-direction: column;
    gap: var(--sp-2);
  }
}

/* ---------- Mobile CTA ---------- */

.mobile-cta-item {
  display: none;
}

@media (max-width: 767px) {
  .mobile-cta-item {
    display: block;
    margin-top: var(--sp-2);
  }

  .mobile-cta-item .btn {
    width: 100%;
  }
}

/* ---------- Reduced Motion ---------- */

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .card:hover,
  .mini-card:hover,
  .offer-card:hover {
    transform: none;
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.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;
}

.text-center {
  text-align: center;
}

.text-center p {
  margin-left: auto;
  margin-right: auto;
}

