/* ============================================================
   Proyecto ARES — bitácora de campo
   ============================================================ */

:root {
  --bg: #e9ede9;
  --bg-soft: #dfe6e1;
  --panel: #ffffff;
  --panel-2: #f2f5f1;
  --ink: #0c2321;
  --ink-soft: #3d5250;
  --ink-faint: #6a7c78;
  --line: rgba(12, 35, 33, 0.14);
  --line-strong: rgba(12, 35, 33, 0.28);
  --teal-deep: #0b2e2e;
  --teal-panel: #123f3d;
  --aqua: #2f8f7c;
  --aqua-bright: #217364;
  --oxide: #b5502f;
  --shadow: 0 24px 60px -32px rgba(11, 46, 46, 0.45);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081d1c;
    --bg-soft: #0a2422;
    --panel: #0f2e2c;
    --panel-2: #0c2624;
    --ink: #eef1ec;
    --ink-soft: #aec4c0;
    --ink-faint: #7f9793;
    --line: rgba(238, 241, 236, 0.14);
    --line-strong: rgba(238, 241, 236, 0.3);
    --teal-deep: #051413;
    --teal-panel: #0c2624;
    --aqua: #4dc9b0;
    --aqua-bright: #5fe0c5;
    --oxide: #e08356;
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --bg: #081d1c;
  --bg-soft: #0a2422;
  --panel: #0f2e2c;
  --panel-2: #0c2624;
  --ink: #eef1ec;
  --ink-soft: #aec4c0;
  --ink-faint: #7f9793;
  --line: rgba(238, 241, 236, 0.14);
  --line-strong: rgba(238, 241, 236, 0.3);
  --teal-deep: #051413;
  --teal-panel: #0c2624;
  --aqua: #4dc9b0;
  --aqua-bright: #5fe0c5;
  --oxide: #e08356;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aqua-bright);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------------- Top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar nav { flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.brand { flex-shrink: 0; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aqua-bright);
  display: inline-block;
  transform: translateY(-2px);
}

.brand small {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-wrap: nowrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--aqua-bright);
  border-color: var(--aqua-bright);
}
.nav-links a.active {
  color: var(--aqua-bright);
  border-color: var(--aqua-bright);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  width: 38px;
  height: 34px;
  color: var(--ink);
  font-family: var(--font-mono);
  cursor: pointer;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: 94vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #f2f6f4;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 20, 19, 0.35) 0%, rgba(5, 20, 19, 0.55) 55%, rgba(5, 20, 19, 0.92) 100%),
    linear-gradient(90deg, rgba(5, 20, 19, 0.65) 0%, rgba(5, 20, 19, 0.15) 55%);
}

.wave-trace {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 90px;
  opacity: 0.55;
}
.wave-trace path {
  fill: none;
  stroke: var(--aqua-bright);
  stroke-width: 2;
  stroke-dasharray: 9 7;
  animation: dash-scroll 7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .wave-trace path { animation: none; }
}
@keyframes dash-scroll {
  to { stroke-dashoffset: -480; }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 1.75rem 4rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.hero-content .eyebrow {
  color: #bfe6db;
}

.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  margin-top: 0.7rem;
  font-style: italic;
  color: #fff;
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: #d8ece6;
  margin-top: 0.9rem;
  letter-spacing: 0.01em;
}

.hero-lede {
  margin-top: 1.4rem;
  max-width: 56ch;
  color: #e7f1ed;
  font-size: 1.05rem;
}

.hero-cta {
  margin-top: 2.2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 3px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--aqua-bright);
  color: #06201c;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.btn-ghost:hover { border-color: #fff; transform: translateY(-2px); }

/* ---------------- Stats strip ---------------- */

.stats {
  background: var(--teal-deep);
  color: #eaf3f0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
}
.stat {
  padding: 2.4rem 1.5rem;
  border-left: 1px solid rgba(255,255,255,0.1);
  text-align: left;
}
.stat:first-child { border-left: none; }
.stat-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--aqua-bright);
}
.stat-label {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #c4d8d2;
  max-width: 20ch;
}

/* ---------------- Sections ---------------- */

section { padding: 5.5rem 0; }
.section-head {
  margin-bottom: 3rem;
  max-width: 70ch;
}
.section-head h2 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  margin-top: 0.6rem;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Proyecto ---------------- */

.proyecto-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: start;
}

.objetivo-general {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--aqua-bright);
  padding-left: 1.4rem;
  margin-bottom: 2.2rem;
}

.objetivos-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.objetivos-list li {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.objetivos-list li::before {
  content: "▸";
  color: var(--aqua-bright);
  flex-shrink: 0;
}

.side-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.side-card h4 {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}
.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}
.badge-group:last-child { margin-bottom: 0; }
.badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--ink-soft);
}

.pullquote {
  margin-top: 3.5rem;
  background: var(--teal-panel);
  color: #eaf3f0;
  border-radius: 6px;
  padding: 2.4rem 2.6rem;
  position: relative;
}
.pullquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  line-height: 1.5;
  max-width: 68ch;
}
.pullquote cite {
  display: block;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9dc4bb;
}

/* ---------------- Timeline / bitácora ---------------- */

.log-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2.2rem;
  padding-bottom: 3.8rem;
}
.log-entry:last-child { padding-bottom: 0; }

.log-marker {
  border-right: 2px solid var(--line);
  position: relative;
  padding-right: 1.6rem;
  padding-top: 0.1rem;
}
.log-marker::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--aqua-bright);
  border: 3px solid var(--bg);
}
.log-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  display: block;
  text-align: right;
  line-height: 1.4;
}
.log-year {
  display: block;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.log-body h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 0.9rem;
}
.log-body p {
  color: var(--ink-soft);
  max-width: 66ch;
}
.log-body p + p { margin-top: 0.85rem; }

.log-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.log-figures figure { margin: 0; }
.log-figures img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.log-figures figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.tag.alert {
  background: color-mix(in srgb, var(--oxide) 16%, transparent);
  border-color: color-mix(in srgb, var(--oxide) 55%, transparent);
  color: var(--oxide);
}

/* ---------------- Comunidad ---------------- */

.comunidad {
  background: var(--bg-soft);
}
.comunidad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.comunidad-grid img {
  border-radius: 6px;
  width: 100%;
  height: 340px;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.testimonios {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.testimonio {
  border-left: 2px solid var(--oxide);
  padding-left: 1.2rem;
}
.testimonio p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink);
}
.testimonio cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------------- Equipo ---------------- */

.equipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.equipo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem;
}
.equipo-card h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aqua-bright);
  margin-bottom: 1rem;
}
.equipo-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.equipo-card li strong {
  display: block;
  font-size: 0.96rem;
}
.equipo-card li span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------------- Resultados ---------------- */

.resultados-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}
.resultado {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.resultado .tag { justify-self: start; align-self: start; }
.resultado p { color: var(--ink-soft); }
.resultado .fecha {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  display: block;
  margin-top: 0.4rem;
}

/* ---------------- Home: mission teaser + hub grid ---------------- */

.mission-teaser {
  max-width: 74ch;
}
.mission-teaser p.objetivo-general {
  margin-bottom: 1.5rem;
}
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--aqua-bright);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, gap 0.2s;
}
.arrow-link:hover { border-color: var(--aqua-bright); gap: 0.6rem; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.hub-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.hub-card:hover {
  transform: translateY(-3px);
  border-color: var(--aqua-bright);
  box-shadow: var(--shadow);
}
.hub-card .eyebrow { display: block; margin-bottom: 0.7rem; }
.hub-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.hub-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.hub-card .arrow-link { margin-top: 1.1rem; }

.funding-note {
  margin-top: 2rem;
  font-size: 0.82rem;
  color: #9dc4bb;
  max-width: 60ch;
}
.funding-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- Footer ---------------- */

footer {
  background: var(--teal-deep);
  color: #cfe3dd;
  padding: 3.5rem 0 2.2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9dc4bb;
  margin-bottom: 0.9rem;
}
.footer-grid p, .footer-grid a {
  font-size: 0.9rem;
  color: #cfe3dd;
  text-decoration: none;
}
.footer-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: #fff;
}
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #7fa79c;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .proyecto-grid { grid-template-columns: 1fr; }
  .comunidad-grid { grid-template-columns: 1fr; }
  .comunidad-grid img { height: 260px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .log-entry { grid-template-columns: 90px 1fr; gap: 1.4rem; }
  .log-date { font-size: 0.68rem; }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .topbar.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.25rem 1.75rem;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .stat { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
  .stat:first-child { border-top: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .resultado { grid-template-columns: 1fr; }
}
