/* Seabass website -- shared stylesheet.
   Palette matches the app's own "Kelp" theme (see src/gui/qml/Theme.qml)
   so the site and the app feel like the same piece of software. */

:root {
  --bg: #14181c;
  --surface: #1a1f24;
  --surface-alt: #1f242a;
  --border: #333a40;
  --border-subtle: #2c3238;
  --text: #e8ecef;
  --text-muted: #8b9096;
  --accent: #3daee9;
  --accent-bright: #74cdf5;
  --primary: #123a52;
  --kelp: #5be0c0;
  --kelp-dark: #0b6852;
  --good: #8fce8f;
  --warn-bg: #4a3510;
  --warn-border: #c99a2e;
  --warn-text: #f0d080;
  --warn-icon: #f0c040;
  --danger-text: #ff8080;
  /* The app draws its Support heart in #aa0000. That is a dark red on a
     dark header here and all but disappears, so the site lifts it. Same
     heart, same job, legible on #1a1f24. */
  --heart: #e2555a;
  --radius: 6px;
  --wrap: 880px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent-bright); text-decoration-color: rgba(116, 205, 245, 0.4); }
a:hover { text-decoration-color: var(--accent-bright); }

h1, h2, h3 { line-height: 1.25; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 3rem; }
h3 { font-size: 1.15rem; }

p { max-width: 68ch; }

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

code {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  max-width: 100%;
}
pre code { background: none; border: none; padding: 0; }

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

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { display: block; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }

.site-header nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--text); background: var(--surface-alt); }
/* Five links and the heart fit one row on a phone only with less padding
   around each; at the desktop padding the last link ran off the screen. */
@media (max-width: 480px) {
  .site-header nav { gap: 0; }
  .site-header nav a { padding: 8px 7px; font-size: 0.9rem; }
  .site-header nav a.support-heart { padding: 8px 6px; }
}
/* The page you are on: brighter, heavier, and a kelp bar under it, so it
   reads as "here" rather than as a link somebody is hovering. */
.site-header nav a.current {
  color: #fff; font-weight: 600; background: var(--surface-alt);
  box-shadow: inset 0 -2px 0 var(--kelp);
}

/* Pages that live under a top-level one (Features: what it does, and
   the screenshots) get a second, smaller row under the page title, in
   the same shape as the header's links so it reads as the same thing
   one level down. */
.subnav { display: flex; justify-content: center; gap: 4px; margin: 18px 0 0; flex-wrap: wrap; }
.subnav a {
  color: var(--text-muted); text-decoration: none; padding: 6px 12px;
  border-radius: 4px; font-size: 0.95rem;
}
.subnav a:hover { color: var(--text); background: var(--surface-alt); }
.subnav a.current {
  color: #fff; font-weight: 600; background: var(--surface-alt);
  box-shadow: inset 0 -2px 0 var(--kelp);
}

/* The Support heart, matching the one in Seabass's own header: Breeze's
   actions/22/love.svg with only its outer contour, filled rather than
   outlined, because a red outline reads as a grey button with a red edge.
   It is the one link on the site asking for something rather than
   offering something, so it keeps its colour while the nav around it
   stays muted. */
.site-header nav a.support-heart {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
}
.support-heart svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: var(--heart);
  /* A slight, infrequent heartbeat -- a soft "lub-dub" every six seconds
     or so, not a continuous throb -- so it reads as a living detail
     rather than a distracting animated icon. Two swells on sine curves,
     the second weaker, then a long rest. Timings copied from the app's
     donateButton so the two beat alike. */
  animation: seabass-heartbeat 6.23s infinite;
  transform-origin: center;
}
.support-heart:hover svg { fill: #ff6e73; }
/* No heartbeat on the page it points at: there is nowhere left to go. */
.support-heart.current svg { animation: none; opacity: 1; }

@keyframes seabass-heartbeat {
  0%      { transform: scale(1);    opacity: .85; animation-timing-function: cubic-bezier(.39,.575,.565,1); }
  4.17%   { transform: scale(1.12); opacity: 1;   animation-timing-function: cubic-bezier(.445,.05,.55,.95); }
  9.63%   { transform: scale(1);    opacity: .85; animation-timing-function: linear; }
  11.08%  { transform: scale(1);    opacity: .85; animation-timing-function: cubic-bezier(.39,.575,.565,1); }
  14.61%  { transform: scale(1.07); opacity: 1;   animation-timing-function: cubic-bezier(.445,.05,.55,.95); }
  22.95%  { transform: scale(1);    opacity: .85; }
  100%    { transform: scale(1);    opacity: .85; }
}

/* A beating heart is exactly what a reduced-motion setting is about. */
@media (prefers-reduced-motion: reduce) {
  .support-heart svg { animation: none; opacity: 1; }
}

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

.hero {
  padding: 64px 0 40px;
  text-align: center;
}
.hero img.logo { width: 240px; max-width: 100%; height: auto; margin-bottom: 10px; }
.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 6px;
  background: linear-gradient(180deg, var(--accent-bright), var(--kelp));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin: 0 auto 22px;
  max-width: 46ch;
}
.hero .pitch { max-width: 60ch; margin: 0 auto 28px; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* The front page's hero: text and screenshot side by side. Wider than
   --wrap, because a screenshot at half of 880px is too small to read. */
.hero-split {
  max-width: 1160px; margin: 0 auto; padding-left: 20px; padding-right: 20px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 44px; align-items: center;
}
.hero-split .hero-text .pitch { margin-bottom: 24px; }
.hero-split figure.screenshot { margin: 0; }
.hero-split figure.screenshot img { max-width: 100%; }
@media (max-width: 900px) {
  .hero-split { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: var(--wrap); }
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #06222f; }
.btn-primary:hover { background: var(--accent-bright); }
.btn-secondary { border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-alt); }

/* ---- eq divider: a nod to the app icon (an EQ-bar "fish") ---- */

.eq-divider {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  height: 26px;
  margin: 44px 0;
  opacity: 0.85;
}
.eq-divider span {
  display: block;
  width: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-bright), var(--primary));
}
.eq-divider span:nth-child(2n) {
  background: linear-gradient(180deg, var(--kelp), var(--kelp-dark));
}
.eq-divider span:nth-child(1) { height: 40%; }
.eq-divider span:nth-child(2) { height: 90%; }
.eq-divider span:nth-child(3) { height: 60%; }
.eq-divider span:nth-child(4) { height: 100%; }
.eq-divider span:nth-child(5) { height: 55%; }
.eq-divider span:nth-child(6) { height: 80%; }
.eq-divider span:nth-child(7) { height: 45%; }

/* ---- cards / grid ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; color: var(--text-muted); max-width: none; }

/* ---- warning / callout boxes, matching the app's own StickWriteWarning ---- */

.warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 22px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.warning .icon { color: var(--warn-icon); font-size: 1.2em; line-height: 1.4; }
.warning p, .warning ul { color: var(--warn-text); margin: 0; max-width: none; }
.warning strong { color: #fff; }
.warning + .warning { margin-top: -8px; }

/* ---- notice: positive-toned callout, e.g. Free Software / donation notes ---- */

.notice {
  background: rgba(91, 224, 192, 0.08);
  border: 1px solid var(--kelp-dark);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 22px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice .icon { color: var(--kelp); font-size: 1.2em; line-height: 1.4; }
.notice p { color: var(--text); margin: 0; max-width: none; }
.notice strong { color: #fff; }

/* ---- screenshots ---- */

figure.screenshot {
  margin: 28px 0;
  text-align: center;
}
figure.screenshot a {
  display: inline-block;
  line-height: 0;
}
figure.screenshot img {
  max-width: min(100%, 640px);
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  cursor: zoom-in;
  transition: opacity 0.15s, box-shadow 0.15s;
}
figure.screenshot a:hover img {
  opacity: 0.92;
  box-shadow: 0 14px 36px rgba(0,0,0,0.45);
}
figure.screenshot figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- tables ---- */

.table-wrap { overflow-x: auto; margin: 20px 0; }
table { border-collapse: collapse; width: 100%; min-width: 480px; margin: 0; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }

/* ---- misc ---- */

/* Top and bottom only: a section that is also .wrap keeps the gutter
   .wrap gives it. The shorthand zeroed it, and on a phone the front
   page's "What it does" ran into the edge of the screen. */
.section { padding-top: 4px; padding-bottom: 8px; }
.lede { color: var(--text-muted); font-size: 1.05rem; }
.muted { color: var(--text-muted); }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warn-icon);
  border: 1px solid var(--warn-border);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 60px;
  padding: 28px 0 40px;
}
.site-footer p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: none;
}

main { padding-bottom: 20px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  h2 { font-size: 1.3rem; }
}

/* ---- monochrome card icons, the app's own Breeze set (index.html) ---- */

/* Inside the card title, at the title's size and in its colour. 22px is
   the grid Breeze draws on, so the 1px strokes stay on whole pixels. */
/* Top-aligned, so a title that wraps keeps its icon on the first line;
   the line is about 23px tall, the icon 22. */
.card h3:has(.card-icon) { display: flex; align-items: flex-start; gap: 10px; }
.card-icon { margin-top: 1px; }
.card-icon { flex: none; width: 22px; height: 22px; fill: currentColor; }
.card-icon * { fill: inherit; }

/* ---- the front page's "Who am I?": the supporters page's portrait,
   mirrored the same way so the face looks into the text, right beside
   the paragraphs rather than out at the edge of the page ---- */

.who { display: flex; gap: 28px; align-items: flex-start; }
.who > div { min-width: 0; }
.who > div > p:first-child { margin-top: 0; }
.who-portrait {
  flex: none; width: 120px; height: 120px; margin-top: 2px;
  border-radius: 19px; transform: scaleX(-1); object-fit: cover;
}
@media (max-width: 480px) {
  .who { gap: 16px; }
  .who-portrait { width: 88px; height: 88px; border-radius: 14px; }
}
