/* School Earth Foundation - Global Styles */
/* Version 1.0 - 2026 */

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

:root {
  --earth: #2D5A3D;
  --earth-light: #4A7C5F;
  --earth-pale: #EAF2ED;
  --soil: #8B6F47;
  --sky: #1A3A5C;
  --dawn: #F5F0E8;
  --text: #1C1C1C;
  --text-muted: #5A5A5A;
  --line: #D8D2C8;
  --white: #FAFAF8;

  /* Font variables - override per language */
  --font-serif: 'Source Serif 4', serif;
  --font-sans: 'Source Sans 3', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--earth);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex; gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

/* LANGUAGE BUTTONS */
.lang-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.lang-buttons a {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--white);
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.lang-buttons a:hover {
  border-color: var(--earth);
  color: var(--earth);
  background: var(--earth-pale);
}

.lang-buttons a.active {
  background: var(--earth);
  color: white;
  border-color: var(--earth);
}

/* HERO */
.hero {
  display: flex; flex-direction: column;
  justify-content: flex-start; align-items: flex-start;
  padding: 6rem 10vw 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(45,90,61,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(139,111,71,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--earth);
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: 0.75rem;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 2rem; height: 1px;
  background: var(--earth);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 16ch;
}

.hero-title em {
  font-style: normal;
  color: var(--earth);
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 50ch;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: var(--earth);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover { background: var(--earth-light); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  border: 1px solid var(--line); cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover { border-color: var(--earth); color: var(--earth); }

.hero-scroll {
  position: absolute; bottom: 3rem; left: 10vw;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.1em;
}

.hero-scroll-line {
  width: 3rem; height: 1px;
  background: var(--line);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* SECTION COMMON */
section { padding: 7rem 10vw; }

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--earth);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  max-width: 20ch;
}

.section-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.9;
}

/* STORY */
.story {
  background: var(--dawn);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.story-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.story-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 400;
  line-height: 1.8;
  color: var(--sky);
  border-left: 3px solid var(--earth);
  padding-left: 2rem;
  font-style: italic;
}

.story-body p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.9;
}

.story-body p strong {
  color: var(--text);
  font-weight: 500;
}

/* WHAT */
.what-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 4rem;
  border: 1px solid var(--line);
}

.what-item {
  padding: 2.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.what-item:nth-child(2n) { border-right: none; }
.what-item:nth-child(n+3) { border-bottom: none; }
.what-item:hover { background: var(--earth-pale); }

.what-number {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--earth);
  opacity: 0.25;
  margin-bottom: 1rem;
  line-height: 1;
}

.what-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.what-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* WHO */
.who { background: var(--text); }

.who .section-label { color: var(--earth-pale); }

.who .section-title { color: var(--white); }

.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 4rem;
}

.who-card {
  padding: 2.5rem 2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
}

.who-card:hover { background: rgba(255,255,255,0.07); }

.who-icon {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  display: block;
}

.who-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.who-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.8;
}

/* FOUR PILLARS */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.pillar {
  padding: 2rem 0;
  border-top: 2px solid var(--line);
  transition: border-color 0.2s;
}

.pillar:hover { border-color: var(--earth); }

.pillar-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--earth);
  margin-bottom: 0.75rem;
}

.pillar-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.pillar-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* CONTRIBUTORS */
.contrib { background: var(--dawn); border-top: 1px solid var(--line); }

.contrib-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6rem;
  align-items: start;
}

.contrib-list {
  list-style: none;
  margin-top: 2rem;
}

.contrib-list li {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.contrib-list li:first-child { border-top: 1px solid var(--line); }

.contrib-num {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--earth);
  font-weight: 700;
  min-width: 1.5rem;
  margin-top: 0.15rem;
}

.contrib-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.contrib-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.contrib-returns {
  padding: 2.5rem;
  background: var(--earth-pale);
  border: 1px solid rgba(45,90,61,0.15);
  margin-top: 1rem;
}

.contrib-returns h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--earth);
  margin-bottom: 1.5rem;
}

.returns-item {
  display: flex; gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.returns-check {
  color: var(--earth);
  font-weight: 700;
  min-width: 1rem;
}

.returns-text { color: var(--text-muted); line-height: 1.7; }

/* LICENSE */
.license {
  border-top: 1px solid var(--line);
}

.license-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.license-box {
  padding: 2.5rem;
  border: 1px solid var(--line);
  margin-top: 2rem;
}

.license-box h3 {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--earth);
  margin-bottom: 1.25rem;
}

.license-rule {
  display: flex; gap: 0.75rem;
  margin-bottom: 0.875rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.rule-allow { color: #2D5A3D; font-weight: 500; }
.rule-deny { color: #8B3A3A; font-weight: 500; }

.license-philosophy {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--earth-pale);
  border-left: 3px solid var(--earth);
}

.license-philosophy p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--sky);
  font-style: italic;
}

/* CTA */
.cta {
  text-align: center;
  padding: 8rem 10vw;
  background: var(--earth);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.cta-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  position: relative;
}

.cta-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  max-width: 46ch;
  margin: 0 auto 3rem;
  line-height: 1.8;
  position: relative;
}

.cta-actions {
  display: flex; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
  position: relative;
}

.btn-white {
  padding: 0.9rem 2.25rem;
  background: white;
  color: var(--earth);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-white:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline-white {
  padding: 0.9rem 2.25rem;
  background: transparent;
  color: white;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  cursor: pointer;
  transition: border-color 0.2s;
}

.btn-outline-white:hover { border-color: white; }

/* FOOTER */
footer {
  padding: 3rem 10vw;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--earth);
}

.footer-links {
  display: flex; gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

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

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

/* RTL SUPPORT */
html[dir="rtl"] {
  direction: rtl;
}

/* RTL: Navigation */
html[dir="rtl"] nav {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

/* RTL: Language Buttons */
html[dir="rtl"] .lang-buttons {
  justify-content: flex-end;
}

/* RTL: Hero Section */
html[dir="rtl"] .hero {
  align-items: flex-end;
  text-align: right;
}

html[dir="rtl"] .hero-eyebrow {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

html[dir="rtl"] .hero-eyebrow::before {
  margin-left: 0.75rem;
  margin-right: 0;
}

html[dir="rtl"] .hero-title {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .hero-sub {
  text-align: right;
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .hero-actions {
  justify-content: flex-start;
}

html[dir="rtl"] .hero-scroll {
  left: auto;
  right: 10vw;
  flex-direction: row-reverse;
}

/* RTL: Section Content */
html[dir="rtl"] .section-label,
html[dir="rtl"] .section-title,
html[dir="rtl"] .section-body {
  text-align: right;
}

/* RTL: Story Section */
html[dir="rtl"] .story-layout {
  direction: rtl;
}

html[dir="rtl"] .story-quote {
  border-left: none;
  border-right: 3px solid var(--earth);
  padding-left: 0;
  padding-right: 2rem;
  text-align: right;
}

html[dir="rtl"] .story-body p {
  text-align: right;
}

/* RTL: What Grid */
html[dir="rtl"] .what-item {
  text-align: right;
}

html[dir="rtl"] .what-grid .what-item:nth-child(2n) {
  border-right: 1px solid var(--line);
  border-left: none;
}

html[dir="rtl"] .what-grid .what-item:nth-child(2n+1) {
  border-right: none;
  border-left: 1px solid var(--line);
}

/* RTL: Who Section */
html[dir="rtl"] .who-card {
  text-align: right;
}

/* RTL: Pillars */
html[dir="rtl"] .pillar {
  text-align: right;
}

/* RTL: Contribute Section */
html[dir="rtl"] .contrib-layout {
  direction: rtl;
}

html[dir="rtl"] .contrib-list li {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .contrib-info {
  text-align: right;
}

html[dir="rtl"] .contrib-returns {
  text-align: right;
}

html[dir="rtl"] .returns-item {
  flex-direction: row-reverse;
  text-align: right;
}

/* RTL: License Section */
html[dir="rtl"] .license-layout {
  direction: rtl;
}

html[dir="rtl"] .license-philosophy {
  border-left: none;
  border-right: 3px solid var(--earth);
  text-align: right;
}

html[dir="rtl"] .license-box {
  text-align: right;
}

html[dir="rtl"] .license-rule {
  flex-direction: row-reverse;
  text-align: right;
}

/* RTL: CTA Section */
html[dir="rtl"] .cta {
  text-align: right;
}

html[dir="rtl"] .cta-title,
html[dir="rtl"] .cta-sub {
  text-align: center;
}

/* RTL: Footer */
html[dir="rtl"] footer {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-links {
  flex-direction: row-reverse;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  section { padding: 5rem 6vw; }
  .hero { padding: 5rem 6vw 4rem; }
  html[dir="rtl"] .hero-scroll { right: 6vw; }
  .story-layout,
  .contrib-layout,
  .license-layout { grid-template-columns: 1fr; gap: 3rem; }
  .what-grid { grid-template-columns: 1fr; }
  .what-item { border-right: none !important; border-bottom: 1px solid var(--line) !important; }
  html[dir="rtl"] .what-item { border-left: none !important; }
  .what-item:last-child { border-bottom: none !important; }
  .who-grid { grid-template-columns: 1fr; }
  .pillars-grid { grid-template-columns: 1fr 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
  html[dir="rtl"] footer { align-items: flex-end; }
}

@media (max-width: 600px) {
  .pillars-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
