/* ============================================
   Third Matter / Exopoiesis — Landing Page
   ============================================ */

/* --- Reset & Base --- */

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

:root {
  --bg:       #0a0e17;
  --bg-card:  #111827;
  --bg-hover: #1a2332;
  --text:     #d4d4d8;
  --text-dim: #8891a0;
  --heading:  #f0f0f2;
  --accent:   #d4a04a;
  --accent2:  #b8863a;
  --border:   #1e293b;
  --pent:     #c9944a;
  --mack:     #6b8fa3;
  --max-w:    800px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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


/* --- Typography --- */

h1, h2, h3 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--heading);
  text-decoration: underline;
}

strong {
  color: var(--heading);
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul {
  margin: 1rem 0 1rem 1.2rem;
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.6rem;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}


/* --- Hero --- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(212,160,74,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-project {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto;
}


/* --- Membrane decoration --- */

.hero-decoration {
  margin-bottom: 3rem;
}

.membrane {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  animation: membrane-breathe 6s ease-in-out infinite;
}

.membrane-layer {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.layer-outer {
  width: 120px;
  height: 120px;
  border-color: rgba(201, 148, 74, 0.3);
}

.layer-mid {
  width: 80px;
  height: 80px;
  border-color: rgba(201, 148, 74, 0.5);
}

.layer-inner {
  width: 48px;
  height: 48px;
  border-color: rgba(107, 143, 163, 0.6);
}

.membrane-core {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(212, 160, 74, 0.4);
}

@keyframes membrane-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}


/* --- Sections --- */

.section {
  padding: 5rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

#results {
  background: linear-gradient(180deg, var(--bg) 0%, rgba(17,24,39,0.5) 50%, var(--bg) 100%);
}


/* --- Card Grid --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color 0.3s, background 0.3s;
}

.card:hover {
  border-color: var(--accent2);
  background: var(--bg-hover);
}

.card-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.card-label {
  font-size: 0.95rem;
  color: var(--heading);
  font-weight: 500;
}

.card-detail {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}


/* --- Architecture Diagram --- */

.diagram {
  margin: 2.5rem 0;
  padding: 2rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.diagram-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}

.diagram-chamber {
  flex: 1;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.diagram-acidic {
  border-radius: 8px 0 0 8px;
  background: rgba(180, 60, 60, 0.1);
  border: 1px solid rgba(180, 60, 60, 0.25);
  border-right: none;
}

.diagram-alkaline {
  border-radius: 0 8px 8px 0;
  background: rgba(60, 100, 180, 0.1);
  border: 1px solid rgba(60, 100, 180, 0.25);
  border-left: none;
}

.diagram-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--heading);
}

.diagram-ph {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.diagram-membrane {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.diagram-layer {
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  letter-spacing: 0.05em;
}

.diagram-pent {
  background: rgba(201, 148, 74, 0.15);
  border-top: 1px solid var(--pent);
  border-bottom: 1px solid var(--pent);
  color: var(--pent);
  min-width: 3.5rem;
}

.diagram-mack {
  background: rgba(107, 143, 163, 0.15);
  border-top: 1px solid var(--mack);
  border-bottom: 1px solid var(--mack);
  color: var(--mack);
  min-width: 3.5rem;
}

.diagram-spec {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.7;
}

.diagram-arrow {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.diagram-arrow sup,
.diagram-arrow sub {
  font-size: 0.7em;
}


/* --- Collaborate --- */

.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}

.collab-item {
  padding: 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
}

.collab-item p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.cta {
  text-align: center;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s;
  letter-spacing: 0.03em;
}

.button:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}


/* --- Footer --- */

.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.footer-muted {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-style: italic;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.7;
}


/* --- Responsive --- */

@media (max-width: 600px) {

  .hero {
    min-height: 90vh;
    padding: 3rem 1rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  h2 {
    font-size: 1.3rem;
  }

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

  .diagram-row {
    flex-direction: column;
    align-items: center;
  }

  .diagram-chamber {
    width: 100%;
    border-radius: 0;
  }

  .diagram-acidic {
    border-radius: 8px 8px 0 0;
    border: 1px solid rgba(180, 60, 60, 0.25);
    border-bottom: none;
  }

  .diagram-alkaline {
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(60, 100, 180, 0.25);
    border-top: none;
  }

  .diagram-membrane {
    flex-direction: column;
    width: 100%;
  }

  .diagram-layer {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    padding: 0.8rem;
    min-width: auto;
  }

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

  .footer-links {
    flex-direction: column;
    gap: 0.8rem;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* --- Print --- */

@media print {
  body {
    background: #fff;
    color: #111;
  }

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

  .membrane {
    display: none;
  }

  .card {
    border: 1px solid #ccc;
    background: #f9f9f9;
  }

  h2 {
    border-bottom-color: #333;
  }
}
