/* TidalMapper site, ocean theme. Built into every page so it always loads. */
:root {
  --surface:  #0d5c7a;   /* sunlit water */
  --mid:      #083f5e;
  --deep:     #052a44;
  --abyss:    #021627;
  --foam:     #eafcff;
  --text:     #e3f4fa;
  --dim:      #a3c4d4;
  --aqua:     #5fe3d6;   /* sea glass */
  --aqua-ink: #02302c;
  --sand:     #f3cf94;   /* placeholders */
  --glass:    rgba(8, 48, 74, .55);
  --line:     rgba(150, 220, 240, .18);
  --max:      68rem;
  --radius:   14px;
  --font:     system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:     ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--abyss); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--text); font: 1.0625rem/1.65 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--mid) 0, var(--mid) 45rem, var(--deep) 80rem, var(--abyss) 100%);
}
/* sunlit band at the top of every page; its waves break onto the deeper water below */
.hero, .sea-top {
  position: relative; overflow: hidden;
  background:
    radial-gradient(50rem 22rem at 20% 0, rgba(150, 240, 245, .30), transparent 65%),
    linear-gradient(180deg, #1a8fb0 0, #0f6f90 55%, #0b5a7c 100%);
}
.sea-top .waves path:last-child, .hero .waves path:last-child { fill: var(--mid); }
.waves path { fill: var(--mid); }
main { flex: 1; }
a { color: var(--aqua); }
a:hover { color: var(--foam); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
h1, h2, h3 { color: var(--foam); line-height: 1.2; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--aqua); color: var(--aqua-ink); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(4, 38, 60, .72); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { color: var(--foam); text-decoration: none; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; display: flex; align-items: center; gap: .6rem; }
.brand:hover { color: var(--foam); }
.brand svg { flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.site-nav a { display: block; padding: .45rem 1rem; border-radius: 999px; color: var(--dim); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover { color: var(--foam); background: rgba(95, 227, 214, .12); }
.site-nav a[aria-current="page"] { color: var(--aqua-ink); background: var(--aqua); }

/* waves */
.waves { display: block; width: 100%; height: 70px; margin-bottom: -1px; }
.waves path { animation: drift 18s linear infinite; }
.waves path:nth-child(1) { animation-duration: 22s; opacity: .35; }
.waves path:nth-child(2) { animation-duration: 15s; animation-delay: -4s; opacity: .55; }
.waves path:nth-child(3) { animation-duration: 11s; animation-delay: -7s; }
@keyframes drift { from { transform: translateX(-90px); } to { transform: translateX(85px); } }
@media (prefers-reduced-motion: reduce) { .waves path { animation: none; } }

/* hero */
.hero { padding: 4.5rem 0 0; }
.hero-grid { position: relative; display: grid; gap: 2.5rem; align-items: center; padding-bottom: 2rem; }
@media (min-width: 52rem) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.eyebrow { color: #c4fbf4; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); margin: 0 0 1rem; text-shadow: 0 2px 30px rgba(95, 227, 214, .35); }

.page-title { position: relative; padding-top: 3.5rem; padding-bottom: 1rem; }
.sea-top::before, .hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(105deg, rgba(255,255,255,.05) 0 40px, transparent 40px 120px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.page-title h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 0 0 .5rem; }
.page-title p { color: var(--dim); margin: 0; max-width: 42rem; }

.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { font-size: 1.65rem; margin: 0 0 1rem; }
.grid-3 { display: grid; gap: 1.1rem; }
@media (min-width: 44rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
  box-shadow: 0 10px 30px rgba(0, 10, 25, .35), inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.card h3 { margin: 0 0 .6rem; font-size: 1.15rem; }

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--aqua); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(95, 227, 214, .3); }
.btn-primary { background: var(--aqua); color: var(--aqua-ink); }
.btn-primary:hover { color: var(--aqua-ink); }
.btn-ghost { color: var(--aqua); background: rgba(95, 227, 214, .06); }

/* placeholders: search the HTML for "CONTENT:" */
.ph { border: 2px dashed var(--sand); border-radius: var(--radius); background: rgba(243, 207, 148, .07); color: var(--sand); padding: 1rem 1.25rem; margin: 0 0 1rem; font-family: var(--mono); font-size: .9rem; line-height: 1.5; }
.ph strong { display: block; color: #ffe2b3; font-family: var(--font); font-size: 1rem; margin-bottom: .25rem; }
.ph-media { aspect-ratio: 3 / 2; display: grid; place-items: center; text-align: center; margin: 0; }
.ph-portrait { aspect-ratio: 1 / 1; max-width: 22rem; }

/* instructions */
.doc-layout { display: grid; gap: 2rem; padding-bottom: 3rem; }
@media (min-width: 60rem) { .doc-layout { grid-template-columns: 15.5rem 1fr; } }
.toc { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; font-size: .93rem; align-self: start; }
@media (min-width: 60rem) { .toc { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto; } }
.toc h2 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--aqua); margin: 0 0 .5rem; }
.toc ol, .toc ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.toc li { margin: .2rem 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--aqua); text-decoration: underline; }
.doc section { scroll-margin-top: 5rem; }
.doc > section { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.doc > section:last-child { border-bottom: 0; }
.doc h2 { font-size: 1.75rem; margin: 0 0 .8rem; }
.doc h3 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
.download-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.download-bar p { margin: 0; color: var(--dim); }
.back-top { font-size: .9rem; }

.notice { border-left: 4px solid var(--sand); background: rgba(243, 207, 148, .08); padding: .9rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0 0; }

/* footer: the seabed */
.site-footer { margin-top: 2rem; color: var(--dim); font-size: .9rem; }
.site-footer .waves path { fill: #01101d; }
.site-footer .inner { background: #01101d; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; display: grid; gap: .75rem; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--foam); }
.site-footer p { margin: 0; }

/* ---------------------------------------------------------------- content pieces */
.lead { color: var(--foam); opacity: .9; font-size: 1.2rem; max-width: 36rem; margin: 0 0 1.25rem; }
.section-lead { color: var(--dim); margin: -.5rem 0 1.5rem; }
.small { color: var(--dim); font-size: .93rem; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1.75rem; }
.pills li { border: 1px solid rgba(234, 252, 255, .35); background: rgba(2, 22, 39, .25); color: var(--foam); border-radius: 999px; padding: .25rem .8rem; font-size: .88rem; font-weight: 600; }
.card p { margin: 0 0 .5rem; color: var(--text); }
.card p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1rem 3rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--aqua); color: var(--aqua-ink); font-weight: 800;
}
.ticks { list-style: none; padding: 0; margin: 0 0 1rem; }
.ticks li { position: relative; padding: 0 0 .55rem 1.6rem; }
.ticks li::before { content: "≈"; position: absolute; left: 0; color: var(--aqua); font-weight: 800; }

/* device drawing on the home page */
.device { margin: 0; }
.device svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 40px rgba(0, 12, 30, .55)); }
.device figcaption { color: var(--foam); opacity: .8; font-size: .9rem; text-align: center; margin-top: .75rem; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .85rem; border-bottom: 1px solid var(--line); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { color: var(--aqua); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; background: rgba(2, 22, 39, .35); }
.specs th { width: 34%; color: var(--dim); font-weight: 600; }

/* manual text */
.doc-sub { color: var(--dim); margin: -.4rem 0 1.25rem; }
.doc h4 { font-size: 1.1rem; margin: 2rem 0 .5rem; color: var(--foam); }
.doc h5 { font-size: 1rem; margin: 1.5rem 0 .4rem; color: var(--aqua); }
.doc h6 { font-size: .95rem; margin: 1.25rem 0 .4rem; color: var(--aqua); text-transform: none; }
.doc h3, .doc h4, .doc h5, .doc h6 { scroll-margin-top: 5rem; }
.doc h3 { padding-top: 1.25rem; border-top: 1px solid var(--line); margin-top: 2.5rem; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: .3rem 0; }
.doc em { color: var(--dim); }
.doc em strong { color: var(--text); }

.callout { border-radius: var(--radius); padding: .9rem 1.15rem; margin: 1.25rem 0; border: 1px solid; }
.callout p { margin: 0 0 .5rem; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout p > strong:first-child { display: block; margin-bottom: .2rem; }
.callout-warn { background: rgba(255, 140, 90, .10); border-color: rgba(255, 160, 110, .45); }
.callout-warn p > strong:first-child { color: #ffb48a; }
.callout-notice { background: rgba(95, 227, 214, .07); border-color: rgba(95, 227, 214, .35); }
.callout-notice p > strong:first-child { color: var(--aqua); }

/* placeholders for photos and open items */
.fig-ph {
  display: block; margin: .75rem 0; padding: .8rem 1rem; border: 2px dashed var(--sand); border-radius: var(--radius);
  background: rgba(243, 207, 148, .06); color: var(--sand); font-size: .88rem; line-height: 1.45;
}
.fig-ph strong { display: block; color: #ffe2b3; }
.ph-inline { display: inline-block; border: 1px dashed var(--sand); color: var(--sand); background: rgba(243, 207, 148, .07); border-radius: 6px; padding: 0 .4rem; font-size: .9em; }
.toc .sub { font-size: .88rem; }

/* keep the manual column inside the screen on phones (tables scroll inside .table-wrap) */
.doc-layout > * { min-width: 0; }
.doc { overflow-wrap: break-word; }
@media (max-width: 40rem) { .doc section, .doc h3, .doc h4, .doc h5, .doc h6 { scroll-margin-top: 7.5rem; } }
.site-footer, .sea-top, .hero { overflow: hidden; }
