/* ============================================================
   CalleEcology Inc. — shared stylesheet
   Design: estuarine / bathymetric. Deep tidal teal + warm shell
   sand + seafoam contour lines. Fraunces / Inter / IBM Plex Mono.
   ============================================================ */

:root {
  --ink:        #08201f;   /* deepest water — page base            */
  --deep:       #0d2c2e;   /* panel / surface                      */
  --deep-2:     #123639;   /* raised surface, card hover           */
  --tide:       #3e9b92;   /* living water — primary               */
  --foam:       #a8d5ce;   /* seafoam — contour lines, hairlines   */
  --sand:       #e8b968;   /* warm shell — accent, numbers, CTA    */
  --sand-deep:  #cf9c46;
  --text:       #eaf2f0;
  --muted:      #8fb0ac;
  --line:       rgba(168,213,206,0.14);

  --maxw: 1180px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --radius: 14px;

  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gap); }

a { color: var(--foam); text-decoration: none; }
a:hover { color: var(--sand); }

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

/* ---- eyebrow / mono labels ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tide);
  margin: 0 0 0.9rem;
}
.coord { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; }

/* ---- headings ---- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0 0 0.5rem; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; }
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 46ch; }
em { font-style: italic; color: var(--foam); }

/* ============================================================
   Header
   ============================================================ */
.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(8,32,31,0.72);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: baseline; gap: 0.55rem; font-family: var(--display); font-size: 1.3rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand b { font-weight: 600; }
.brand .tld { font-family: var(--mono); font-size: 0.7rem; color: var(--tide); letter-spacing: 0.1em; }
.nav { display: flex; gap: 1.6rem; align-items: center; }
.nav a { font-size: 0.9rem; color: var(--muted); letter-spacing: 0.01em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav .ext::after { content: " ↗"; color: var(--tide); font-size: 0.8em; }
.nav-toggle { display: none; }

/* ============================================================
   Hero — bathymetric contour signature
   ============================================================ */
.hero { position: relative; padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3rem, 7vw, 5rem); overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; }
.hero-contours { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0.5; }
.hero-contours path { fill: none; stroke: var(--foam); stroke-width: 1; }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 1.4rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2.4rem; }
.hero-meta span { display: flex; flex-direction: column; }
.hero-meta b { font-family: var(--display); font-size: 1.5rem; color: var(--sand); font-weight: 400; }
.hero-meta small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* animated tide rise on the contours */
@media (prefers-reduced-motion: no-preference) {
  .hero-contours path { animation: swell 14s ease-in-out infinite; }
  .hero-contours path:nth-child(2) { animation-delay: -2s; }
  .hero-contours path:nth-child(3) { animation-delay: -4s; }
  .hero-contours path:nth-child(4) { animation-delay: -6s; }
  .hero-contours path:nth-child(5) { animation-delay: -8s; }
  .hero-contours path:nth-child(6) { animation-delay: -10s; }
  @keyframes swell {
    0%,100% { transform: translateY(0); opacity: 0.35; }
    50%     { transform: translateY(-10px); opacity: 0.7; }
  }
}

/* ============================================================
   Capabilities ticker
   ============================================================ */
.caps { border-block: 1px solid var(--line); background: var(--deep); }
.caps .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; padding-block: 1rem; }
.caps span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); }
.caps span::before { content: "· "; color: var(--tide); }

/* ============================================================
   Grid gallery
   ============================================================ */
.gallery { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 300px;
  padding: 1.7rem;
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.35s, background 0.35s;
}
.card::after {  /* faint contour texture, revealed on hover */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 90% 110%, rgba(62,155,146,0.16), transparent 60%);
  opacity: 0; transition: opacity 0.35s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(62,155,146,0.5); background: var(--deep-2); }
.card:hover::after { opacity: 1; }
.card:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }
.card > * { position: relative; z-index: 1; }

.card .tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tide); }
.card .tag.tool { color: var(--sand); }
.card h3 { margin-top: 0.7rem; }
.card p { color: var(--muted); font-size: 0.98rem; margin: 0.4rem 0 0; }
.card .go { margin-top: auto; padding-top: 1.4rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--foam); display: flex; align-items: center; gap: 0.4rem; }
.card:hover .go { color: var(--sand); }
.card .go .arrow { transition: transform 0.3s; }
.card:hover .go .arrow { transform: translateX(5px); }
.card .stn { position: absolute; top: 1.7rem; right: 1.7rem; z-index: 1; }

.card--wide { grid-column: span 2; }

.card-img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 1.1rem; border: 1px solid var(--line); }
.card--wide .card-img { height: 180px; }

/* interior page figure + portrait */
figure.fig { margin: 0 0 2rem; }
figure.fig img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
figure.fig figcaption { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; margin-top: 0.6rem; }
.portrait { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1.4rem; }

/* ============================================================
   Interior page content
   ============================================================ */
.page { padding: clamp(3rem, 7vw, 5rem) 0 clamp(4rem, 8vw, 6rem); }
.page-head { max-width: 60ch; margin-bottom: 3rem; }
.page-head .lead { max-width: 60ch; margin-top: 1.2rem; }

.back { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); display: inline-block; margin-bottom: 2rem; }
.back:hover { color: var(--sand); }

.prose { max-width: 62ch; }
.prose p { color: var(--muted); }
.prose h2 { margin-top: 2.8rem; color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }

.feature-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-list li { background: var(--deep); padding: 1.1rem 1.3rem; display: flex; gap: 1rem; align-items: baseline; }
.feature-list .n { font-family: var(--mono); font-size: 0.72rem; color: var(--tide); min-width: 2ch; }
.feature-list b { font-family: var(--display); font-weight: 500; font-size: 1.08rem; }
.feature-list span { color: var(--muted); }
.feature-list .txt { display: flex; flex-direction: column; gap: 0.2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em;
  padding: 0.85rem 1.4rem; border-radius: 999px;
  background: var(--sand); color: var(--ink); font-weight: 500;
  border: 1px solid var(--sand);
  transition: background 0.25s, transform 0.25s;
}
.btn:hover { background: var(--sand-deep); color: var(--ink); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--foam); border-color: var(--line); }
.btn--ghost:hover { background: var(--deep); color: var(--sand); border-color: var(--tide); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.aside { background: var(--deep); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.aside h3 { font-size: 1.05rem; }
.aside dl { margin: 0; display: grid; gap: 0.9rem; }
.aside dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tide); }
.aside dd { margin: 0.1rem 0 0; color: var(--text); font-size: 0.95rem; }

/* ============================================================
   Footer
   ============================================================ */
.site-foot { border-top: 1px solid var(--line); background: var(--deep); padding: 3rem 0 2.5rem; margin-top: 2rem; }
.foot-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.foot-brand { font-family: var(--display); font-size: 1.4rem; }
.foot-brand p { font-family: var(--body); font-size: 0.85rem; color: var(--muted); max-width: 34ch; margin-top: 0.6rem; }
.foot-col h4 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tide); margin: 0 0 0.9rem; }
.foot-col a { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.foot-col a:hover { color: var(--sand); }
.foot-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .card--wide { grid-column: span 1; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--deep); border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
  .nav.open { display: flex; }
  .nav a { padding: 0.8rem var(--gap); width: 100%; }
  .nav-toggle { display: block; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-family: var(--mono); font-size: 0.8rem; padding: 0.4rem 0.7rem; cursor: pointer; }
}

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