/* ============================================================
   Brisa Haal — Stylesheet
   Editorial magazine × marine field station
   ============================================================ */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
figure,
blockquote,
pre,
fieldset {
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
ul,
ol {
  list-style: none;
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
table {
  border-collapse: collapse;
  width: 100%;
}
:focus-visible {
  outline: 2px solid var(--c-coral);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Tokens --- */
:root {
  --c-teal: #0e4d52;
  --c-sand: #e8d9b5;
  --c-kelp: #3f7d44;
  --c-coral: #e97d5c;
  --c-cream: #faf7f0;
  --c-charcoal: #1a1a1a;
  --c-ink: #2b2b2b;
  --c-ink-soft: #555;
  --c-rule: #ddd5c2;
  --c-rule-soft: #ece6d5;

  --font-display:
    "Söhne", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  --font-body:
    "Inter", "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-h1: clamp(2.4rem, 5vw + 1rem, 4.5rem);
  --fs-h2: clamp(1.8rem, 2.5vw + 0.6rem, 2.6rem);
  --fs-h3: clamp(1.2rem, 1vw + 0.8rem, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-tag: 0.75rem;

  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --sp-7: 6rem;

  --container: min(1180px, 100% - 2.5rem);
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-1:
    0 1px 2px rgba(26, 26, 26, 0.05), 0 2px 8px rgba(26, 26, 26, 0.04);
  --shadow-2:
    0 2px 6px rgba(26, 26, 26, 0.06), 0 12px 32px rgba(26, 26, 26, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* --- Base typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--c-ink);
  background: var(--c-cream);
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--c-charcoal);
}
h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.025em;
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: 1.0625rem;
}
p {
  font-size: var(--fs-body);
}
small,
.small {
  font-size: var(--fs-small);
}
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-charcoal);
  color: var(--c-cream);
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

/* --- Header / nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--c-rule-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--c-teal);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-mark {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c-coral);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.site-nav a:not(.btn) {
  color: var(--c-ink);
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.site-nav a:not(.btn):hover,
.site-nav a:not(.btn).is-active {
  border-bottom-color: var(--c-coral);
}
.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c-teal);
  padding: 0.4rem;
}
@media (max-width: 820px) {
  .site-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--c-cream);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-4);
    gap: var(--sp-3);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
    border-top: 1px solid var(--c-rule-soft);
  }
  .site-nav.is-open {
    transform: translateX(0);
  }
  .site-nav a {
    font-size: 1.2rem;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

/* --- Container & layout --- */
.container {
  width: var(--container);
  margin-inline: auto;
}
.section {
  padding: var(--sp-6) 0;
}
.section--tight {
  padding: var(--sp-5) 0;
}
.section--loose {
  padding: var(--sp-7) 0;
}
.bg-sand {
  background: var(--c-sand);
}
.bg-teal {
  background: var(--c-teal);
  color: var(--c-cream);
}
.bg-teal h1,
.bg-teal h2,
.bg-teal h3 {
  color: var(--c-cream);
}
.grid {
  display: grid;
  gap: var(--sp-3);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 760px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
.flex {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.flex-col {
  flex-direction: column;
  align-items: stretch;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: var(--sp-1);
}
.gap-2 {
  gap: var(--sp-2);
}
.gap-3 {
  gap: var(--sp-3);
}
.gap-4 {
  gap: var(--sp-4);
}
.mt-1 {
  margin-top: var(--sp-1);
}
.mt-2 {
  margin-top: var(--sp-2);
}
.mt-3 {
  margin-top: var(--sp-3);
}
.mt-4 {
  margin-top: var(--sp-4);
}
.mt-5 {
  margin-top: var(--sp-5);
}
.mb-1 {
  margin-bottom: var(--sp-1);
}
.mb-2 {
  margin-bottom: var(--sp-2);
}
.mb-3 {
  margin-bottom: var(--sp-3);
}
.mb-4 {
  margin-bottom: var(--sp-4);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--c-coral);
  color: var(--c-cream);
}
.btn-primary:hover {
  background: #d76b4d;
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--c-teal);
  border-color: var(--c-teal);
}
.btn-secondary:hover {
  background: var(--c-teal);
  color: var(--c-cream);
}
.btn-ghost {
  background: transparent;
  color: var(--c-charcoal);
  border-color: var(--c-rule);
}
.btn-ghost:hover {
  border-color: var(--c-charcoal);
}
.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 1.05rem 1.75rem;
  font-size: 1.05rem;
}
.btn-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid var(--c-rule-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  transition: all 0.2s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-teal);
  padding: 0.2rem 0.5rem;
  background: var(--c-sand);
  border-radius: 100px;
  margin-bottom: 0.6rem;
}
.card-tag.tag-coral {
  background: var(--c-coral);
  color: var(--c-cream);
}
.card-tag.tag-kelp {
  background: var(--c-kelp);
  color: var(--c-cream);
}
.card h3 {
  margin-bottom: 0.5rem;
}
.card p {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}
.card a {
  color: var(--c-coral);
  font-weight: 500;
}
.card a:hover {
  text-decoration: underline;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--c-sand);
}
.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-image .image-placeholder {
  width: 100%;
  height: 100%;
  border: 0;
}
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 77, 82, 0.45) 0%,
    rgba(14, 77, 82, 0.65) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 1;
  width: var(--container);
  margin-inline: auto;
  color: var(--c-cream);
  padding: var(--sp-6) 0;
}
.hero h1 {
  color: var(--c-cream);
  max-width: 18ch;
}
.hero-sub {
  max-width: 48ch;
  font-size: 1.2rem;
  margin-top: var(--sp-3);
  color: rgba(250, 247, 240, 0.92);
}
.hero-ctas {
  margin-top: var(--sp-4);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.hero-ctas .btn-secondary {
  color: var(--c-cream);
  border-color: var(--c-cream);
}
.hero-ctas .btn-secondary:hover {
  background: var(--c-cream);
  color: var(--c-teal);
}

/* --- Mission / intro --- */
.intro {
  max-width: 65ch;
  margin: 0 auto;
  text-align: center;
}
.intro h2 {
  margin-bottom: var(--sp-2);
}
.intro p {
  color: var(--c-ink-soft);
  font-size: 1.1rem;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-coral);
  margin-bottom: var(--sp-2);
}

/* --- Pipeline stages --- */
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}
.stage {
  padding: var(--sp-4) var(--sp-3);
  border-right: 1px solid var(--c-rule-soft);
  cursor: pointer;
  position: relative;
  transition: background 0.2s var(--ease);
}
.stage:last-child {
  border-right: 0;
}
.stage:hover,
.stage.is-active {
  background: rgba(232, 217, 181, 0.4);
}
.stage-number {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  color: var(--c-coral);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.stage h3 {
  margin-bottom: 0.5rem;
}
.stage p {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}
.stage-popover {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--c-cream);
  border: 1px solid var(--c-rule);
  border-top: 3px solid var(--c-coral);
  padding: var(--sp-3);
  box-shadow: var(--shadow-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.stage.is-active .stage-popover {
  display: block;
}
@media (max-width: 820px) {
  .stages {
    grid-template-columns: 1fr;
  }
  .stage {
    border-right: 0;
    border-bottom: 1px solid var(--c-rule-soft);
  }
  .stage:last-child {
    border-bottom: 0;
  }
  .stage-popover {
    position: static;
    box-shadow: none;
    border-top: 1px solid var(--c-rule-soft);
  }
}

/* --- Big number / impact tiles --- */
.metric {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-rule);
}
.metric-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  color: var(--c-teal);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}
.metric-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--c-ink-soft);
}
.metric-chart {
  margin-top: var(--sp-2);
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  height: 60px;
}
.metric-chart .bar {
  flex: 1;
  background: var(--c-kelp);
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
}
.metric-chart .bar.is-accent {
  background: var(--c-coral);
  opacity: 1;
}

/* --- Team --- */
.person {
  text-align: left;
  background: #fff;
  border: 1px solid var(--c-rule-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
}
.person-portrait {
  aspect-ratio: 4 / 5;
  background: var(--c-sand);
  border-radius: var(--radius);
  margin-bottom: var(--sp-2);
  overflow: hidden;
}
.person h3 {
  font-size: 1.15rem;
  margin-bottom: 0.1rem;
}
.person-role {
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-coral);
  margin-bottom: 0.6rem;
}
.person-bio {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}
.person-links {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-size: var(--fs-small);
}
.person-links a {
  color: var(--c-teal);
  border-bottom: 1px solid var(--c-rule);
}
.person-links a:hover {
  color: var(--c-coral);
  border-bottom-color: var(--c-coral);
}

/* --- Newsroom --- */
.news-item {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-rule-soft);
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: var(--sp-3);
  align-items: baseline;
}
.news-date {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-ink-soft);
}
.news-title {
  font-weight: 500;
}
.news-source {
  font-size: var(--fs-small);
  color: var(--c-ink-soft);
}
@media (max-width: 600px) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* --- Forms --- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--sp-3);
}
.form-row label {
  font-weight: 500;
  font-size: 0.95rem;
}
.form-row .hint {
  font-size: var(--fs-small);
  color: var(--c-ink-soft);
}
.form-row input,
.form-row textarea,
.form-row select {
  border: 1px solid var(--c-rule);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  background: #fff;
  font-size: 1rem;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--c-teal);
  outline: 2px solid rgba(14, 77, 82, 0.18);
  outline-offset: 0;
}
.form-row textarea {
  resize: vertical;
  min-height: 140px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Footer --- */
.site-footer {
  background: var(--c-teal);
  color: var(--c-cream);
  margin-top: var(--sp-7);
  padding: var(--sp-5) 0 var(--sp-3);
}
.site-footer a {
  color: var(--c-cream);
  opacity: 0.85;
}
.site-footer a:hover {
  opacity: 1;
  border-bottom: 1px solid var(--c-cream);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1fr;
  gap: var(--sp-4);
  align-items: start;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
}
.footer-fine {
  grid-column: 1 / -1;
  font-size: var(--fs-small);
  opacity: 0.7;
  border-top: 1px solid rgba(250, 247, 240, 0.15);
  padding-top: var(--sp-2);
  margin-top: var(--sp-3);
}
@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* --- Image placeholders (for real images, swap <figure> for <img>) --- */
.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    #e8d9b5,
    #e8d9b5 8px,
    #dccca6 8px,
    #dccca6 16px
  );
  color: var(--c-teal);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  text-align: center;
  padding: var(--sp-3);
  min-height: 200px;
  border-radius: var(--radius);
  border: 1px dashed var(--c-teal);
  position: relative;
}
.image-placeholder::before {
  content: attr(data-ph);
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: var(--fs-tag);
  background: var(--c-cream);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.image-placeholder::after {
  content: attr(data-ph-desc);
  max-width: 30ch;
  line-height: 1.4;
}

/* --- Utility / prose --- */
.prose p {
  margin-bottom: var(--sp-2);
}
.prose h2 {
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.prose h3 {
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-1);
}
.prose ul {
  padding-left: 1.4rem;
  list-style: disc;
  margin-bottom: var(--sp-2);
}
.prose li {
  margin-bottom: 0.3rem;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--c-rule);
  margin: var(--sp-4) 0;
}
.prose blockquote {
  border-left: 3px solid var(--c-coral);
  padding: 0.4rem 0 0.4rem var(--sp-3);
  color: var(--c-ink-soft);
  font-style: italic;
  margin: var(--sp-3) 0;
}

/* --- Page banners --- */
.page-banner {
  padding: var(--sp-6) 0 var(--sp-4);
  border-bottom: 1px solid var(--c-rule-soft);
}
.page-banner h1 {
  max-width: 22ch;
}
.page-banner p {
  max-width: 60ch;
  margin-top: var(--sp-2);
  color: var(--c-ink-soft);
  font-size: 1.1rem;
}

/* --- About-this-page (collapsible) --- */
.about-toggle {
  border: 1px solid var(--c-rule-soft);
  border-radius: var(--radius);
  margin: var(--sp-4) auto 0;
  max-width: 65ch;
  background: #fff;
}
.about-toggle summary {
  padding: 0.8rem 1.1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.about-toggle summary::before {
  content: "ℹ";
  color: var(--c-teal);
}
.about-toggle[open] summary {
  border-bottom: 1px solid var(--c-rule-soft);
}
.about-toggle .about-body {
  padding: 1rem 1.1rem;
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}

/* --- Tag chips --- */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-tag);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--c-rule);
  border-radius: 100px;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
  color: var(--c-ink-soft);
}

/* --- Quote --- */
.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw + 0.5rem, 2rem);
  line-height: 1.3;
  color: var(--c-teal);
  border-left: 3px solid var(--c-coral);
  padding-left: var(--sp-3);
  margin: var(--sp-4) 0;
  max-width: 40ch;
}
.pull-quote-cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--c-ink-soft);
  font-style: normal;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
