/* =========================================================
   Cyber Divers Inc. site styles
   Palette is built around the dive metaphor: surface light
   at the top of the page, depth-teal beneath, brand green
   reserved for actions and the mark itself.
   ========================================================= */

:root {
  --ink:        #0B2B33;   /* deepest water: headings, hero ground */
  --deep:       #123E4B;   /* mid depth: secondary dark surfaces */
  --tide:       #0F7A73;   /* aqua: links, rules, quiet accents */
  --surface:    #EDF3F1;   /* light section background */
  --paper:      #FFFFFF;
  --green:      #7ED956;   /* brand mark green */
  --green-ink:  #3C8A21;   /* green that passes contrast on white */
  --body:       #29434B;   /* body copy on light */
  --muted:      #5E767D;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);

  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 28px;

  --shadow-lift: 0 18px 44px -24px rgba(11,43,51,.55);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .display {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 1.45rem + 2.9vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; }

p  { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }

a { color: var(--tide); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--green-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .75rem 1rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- layout ---------- */

.wrap { width: min(1160px, 100% - (var(--gutter) * 2)); margin-inline: auto; }
.wrap-narrow { width: min(780px, 100% - (var(--gutter) * 2)); margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(2.25rem, 5vw, 4rem); }
.section-surface { background: var(--surface); }
.section-deep { background: var(--ink); color: #CFE0E2; }
.section-deep h1, .section-deep h2, .section-deep h3, .section-deep h4 { color: #fff; }
.section-deep a { color: var(--green); }

.lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.375rem); line-height: 1.5; color: var(--deep); max-width: 58ch; }
.section-deep .lede { color: #BCD3D6; }

.eyebrow {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .95rem; font-weight: 600; color: var(--green-ink);
  margin: 0 0 .75rem; letter-spacing: 0;
}
.section-deep .eyebrow { color: var(--green); }

/* ---------- header / nav ---------- */

.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid #DCE7E4;
}
.masthead-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700; font-size: 1.15rem; color: var(--ink);
  text-decoration: none; letter-spacing: -.02em;
  margin-right: auto;
}
.brand svg { height: 30px; width: auto; display: block; }
.brand span small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: 1; margin-top: 2px; font-family: "IBM Plex Sans", sans-serif; }

.nav-toggle {
  display: none; border: 1px solid #CFDDD9; background: #fff;
  border-radius: var(--r-sm); padding: .5rem .7rem; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--ink);
}

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a, .nav .menu-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .7rem; border-radius: var(--r-sm);
  font-size: .95rem; font-weight: 500; color: var(--ink);
  text-decoration: none; border: 0; background: transparent;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.nav a:hover, .nav .menu-btn:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--green); }

.menu { position: relative; }
.menu-btn svg { transition: transform .18s ease; }
.menu[data-open="true"] .menu-btn svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% + .4rem); left: 0;
  min-width: 268px; padding: .4rem;
  background: #fff; border: 1px solid #DCE7E4; border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  display: none;
}
.menu[data-open="true"] .menu-panel { display: block; }
.menu-panel a {
  display: block; padding: .6rem .7rem; border-radius: var(--r-sm);
  font-weight: 600; color: var(--ink); line-height: 1.3;
}
.menu-panel a small { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: 999px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600; font-size: 1rem; line-height: 1;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn-give { background: var(--green); color: #0B2B33; border-color: var(--green); }
.btn-give:hover { background: #6ECB45; color: #0B2B33; }
.btn-line { background: transparent; color: var(--ink); border-color: #B9CCC8; }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.section-deep .btn-line { color: #fff; border-color: rgba(255,255,255,.4); }
.section-deep .btn-line:hover { border-color: #fff; color: #fff; }
.btn-sm { padding: .55rem 1rem; font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.75rem; }

/* ---------- hero ---------- */

/* The hero is the light surface of the water; the stats strip below it is the
   depth. Keeping them as separate sections means a longer headline can never
   spill into the dark band. */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(170deg, #FFFFFF 0%, #F3F8F6 55%, #E7F0ED 100%);
}
.hero-stats { background: var(--ink); }
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}
.hero-copy h1 { color: var(--ink); }
.hero-copy .lede { color: var(--deep); }
.hero-stage { display: flex; justify-content: center; align-items: center; }
.hero-stage svg { width: min(100%, 420px); height: auto; overflow: visible; }

/* the isometric puzzle assembles once on load */
.cube { opacity: 0; }
.cube.on { animation: drop .62s cubic-bezier(.2,.75,.25,1) forwards; }
@keyframes drop {
  from { opacity: 0; transform: translate(0, -58px) scale(.9); }
  to   { opacity: 1; transform: translate(0, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cube, .cube.on { opacity: 1; animation: none; transform: none; }
}

.hero-band {
  padding-block: clamp(2rem, 4vw, 3rem);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.5rem;
}
.hero-band p { color: #A9C4C7; font-size: .95rem; margin: 0; max-width: 34ch; }
.hero-band b { display: block; font-family: "Bricolage Grotesque", sans-serif; color: #fff; font-size: 1.85rem; font-weight: 700; line-height: 1.1; }

/* ---------- editorial pieces ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
.split-lead { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }

.stack > * + * { margin-top: 1.1rem; }

.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li { padding: 1.15rem 0; border-top: 1px solid #D7E3E0; }
.rule-list li:last-child { border-bottom: 1px solid #D7E3E0; }
.rule-list h3 { margin-bottom: .3rem; }
.rule-list p { margin: 0; color: var(--body); }

.program-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 2.5rem; }
.program {
  background: #fff; border: 1px solid #DCE7E4; border-radius: var(--r-md);
  padding: 1.6rem 1.5rem 1.75rem; display: flex; flex-direction: column;
}
.program .tag {
  align-self: flex-start; font-size: .78rem; font-weight: 600; color: var(--deep);
  background: var(--surface); border-radius: 999px; padding: .25rem .65rem; margin-bottom: .9rem;
}
.program .tag-soon { background: #FFF3D6; color: #8A6100; }
.program p { flex: 1; font-size: .97rem; }
.program a { font-weight: 600; text-decoration: none; }
.program a:hover { text-decoration: underline; }

.figure-note { font-size: .88rem; color: var(--muted); max-width: 60ch; }

blockquote.pull {
  margin: 2rem 0; padding-left: 1.4rem; border-left: 4px solid var(--green);
  font-family: "Bricolage Grotesque", sans-serif; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  line-height: 1.3; color: var(--ink); font-weight: 600;
}
blockquote.pull p { max-width: 30ch; margin: 0; }

/* ---------- forms ---------- */

.form { display: grid; gap: 1.1rem; max-width: 620px; margin-top: 2rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .7rem .85rem; border: 1px solid #C3D4D0; border-radius: var(--r-sm);
  background: #fff; width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.hidden-field { position: absolute; left: -9999px; }

/* ---------- donation tiers ---------- */

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 2rem 0 1.5rem; }
.tier {
  text-align: left; background: #fff; border: 2px solid #DCE7E4; border-radius: var(--r-md);
  padding: 1.15rem 1.2rem; cursor: pointer; font: inherit; color: var(--body);
  transition: border-color .15s ease, background-color .15s ease;
}
.tier:hover { border-color: var(--green); }
.tier[aria-pressed="true"] { border-color: var(--green-ink); background: #F3FBEE; }
.tier b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.6rem; color: var(--ink); line-height: 1; margin-bottom: .45rem; }
.tier span { font-size: .9rem; display: block; }

/* ---------- article ---------- */

.article-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1rem; }
.article-meta { font-size: .9rem; color: var(--muted); }
.article-body h2 { margin-top: 2.5rem; }
.article-body h3 { margin-top: 1.9rem; }
.article-body ul { padding-left: 1.15rem; }
.article-body li { margin-bottom: .5rem; }
.article-body hr { border: 0; border-top: 1px solid #D7E3E0; margin: 3rem 0; }
.sources { font-size: .9rem; color: var(--muted); }
.sources li { margin-bottom: .45rem; }

.card-list { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.card-list article {
  border-top: 1px solid #D7E3E0; padding-top: 1.25rem;
  display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: start;
}
.card-list .kicker { font-size: .85rem; color: var(--muted); }
.card-list h3 { margin-bottom: .35rem; }
.card-list h3 a { color: var(--ink); text-decoration: none; }
.card-list h3 a:hover { color: var(--tide); text-decoration: underline; }
.card-list p { margin: 0; font-size: .97rem; }

/* ---------- final CTA + footer ---------- */

.give-strip { background: var(--green); }
.give-strip .wrap { padding-block: clamp(2.5rem, 6vw, 4rem); display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; align-items: center; }
.give-strip h2, .give-strip p { color: #0B2B33; }
.give-strip p { margin: 0; max-width: 52ch; }
.give-strip .btn-give { background: var(--ink); border-color: var(--ink); color: #fff; }
.give-strip .btn-give:hover { background: #06181D; color: #fff; }

.footer { background: var(--ink); color: #9FBBBF; padding-block: 3.5rem 2.5rem; font-size: .93rem; }
.footer a { color: #CFE0E2; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: .8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .45rem; }
.footer .brand { color: #fff; margin-bottom: 1rem; }
.footer .brand span small { color: #85A5AA; }
.footer-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: 1rem 2rem; font-size: .85rem; color: #7E9EA3; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stage { order: -1; }
  .hero-stage svg { width: min(78%, 300px); }
  .split, .split-lead, .give-strip .wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-list article { grid-template-columns: 1fr; gap: .5rem; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; order: 3; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: #fff; border-bottom: 1px solid #DCE7E4; padding: .75rem var(--gutter) 1.25rem;
    box-shadow: var(--shadow-lift);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a, .nav .menu-btn { padding: .7rem .5rem; font-size: 1rem; width: 100%; justify-content: space-between; }
  .menu-panel { position: static; display: none; box-shadow: none; border: 0; border-left: 2px solid var(--surface); border-radius: 0; margin: .2rem 0 .4rem .5rem; padding-left: .6rem; min-width: 0; }
  .nav .btn { margin-top: .6rem; justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr 1fr; }
}
