/* PenClay site. The colours are the program's own (src/ui/theme.cpp). No web fonts: Segoe UI on
   Windows, the system font elsewhere. */

:root {
  --bar: #17181b;
  --bg: #1b1c20;
  --panel: #1d1e22;
  --popup: #24262b;
  --border: #2c2e34;
  --field: #2a2c32;
  --field-hover: #32353c;
  --accent: #5a8dee;
  --accent-hover: #6f9cf1;
  --accent-soft: rgba(90, 141, 238, 0.22);
  --text: #e1e3e8;
  --label: #a0a5af;
  --dim: #70757f;
  --warning: #e2aa60;
  --ok: #7cc58a;
  --radius: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 0.6em; }
h2 { font-size: 1.3rem; margin: 2em 0 0.6em; }
h3 { font-size: 1.05rem; margin: 1.6em 0 0.4em; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--popup); padding: 6px 10px; }

/* --- the top bar, like the program's ------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 4px;
  height: 52px; padding: 0 16px;
  background: var(--bar); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; margin-right: 12px; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar nav a, .topbar .account-link {
  color: var(--text); padding: 6px 12px; border-radius: var(--radius); white-space: nowrap;
}
.topbar nav a:hover, .topbar .account-link:hover { background: var(--field); text-decoration: none; }
.topbar nav a[aria-current="page"] { background: var(--field); }
.topbar .account-link { background: var(--field); }

/* --- buttons and fields ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px;
  font: inherit; font-weight: 500; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--field-hover); color: var(--text); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.big { min-height: 48px; padding: 10px 24px; font-size: 1.05rem; }
.btn.danger { color: #f0a0a0; }
.btn[disabled] { opacity: 0.5; cursor: default; }
input[type="email"], input[type="text"], select {
  width: 100%; min-height: 42px; padding: 8px 12px;
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--border); border-radius: var(--radius);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
label { display: block; color: var(--label); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 0 0.45em; margin: 0 0.1em;
  font: 500 0.88em/1.7 var(--font); text-align: center; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px;
}

/* --- the landing page: one screen, no scrolling on a desktop ------------------------------------ */
.landing { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; }
.hero {
  display: grid; grid-template-columns: minmax(300px, 0.85fr) 1.4fr; gap: clamp(24px, 4vw, 64px);
  align-items: center; align-content: center; padding: clamp(20px, 3vh, 40px) clamp(16px, 4vw, 64px);
  max-width: 1600px; width: 100%; margin: 0 auto; min-height: 0;
}
.hero h1 { font-size: clamp(2rem, 3.4vw, 3.1rem); margin-bottom: 0.4em; }
.hero .lead { font-size: clamp(1rem, 1.25vw, 1.15rem); color: var(--label); max-width: 34em; }
.points { list-style: none; padding: 0; margin: 1.4em 0 1.6em; }
.points li { display: flex; gap: 12px; align-items: baseline; margin: 0.55em 0; }
.points li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.fine { color: var(--dim); font-size: 0.9rem; margin-top: 14px; }
.media { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.media .frame {
  position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bar); aspect-ratio: 16 / 10; max-height: 68vh; max-height: 68dvh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.media .frame img, .media .frame video { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.media figcaption { color: var(--dim); font-size: 0.85rem; }
.thumbs { display: flex; gap: 8px; }
.thumbs button {
  flex: 1; padding: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  background: var(--bar); cursor: pointer; aspect-ratio: 16 / 9; max-height: 9vh; opacity: 0.6;
}
.thumbs button[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }

/* --- the status bar at the bottom, like the program's: key hints left, links right -------------- */
.statusbar {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--bar); border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--dim);
}
.statusbar .hints span { margin-right: 18px; white-space: nowrap; }
.statusbar .hints b { color: var(--text); font-weight: 500; margin-right: 5px; }
.statusbar .links a { color: var(--label); margin-left: 16px; white-space: nowrap; }
.statusbar .links a:first-child { margin-left: 0; }

/* --- ordinary pages ------------------------------------------------------------------------------ */
.page { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; }
.content { max-width: 860px; width: 100%; margin: 0 auto; padding: 40px 16px 64px; }
.content.wide { max-width: 1100px; }
.narrow { max-width: 520px; margin: 0 auto; padding: 56px 16px; }
.note { color: var(--label); }
.muted { color: var(--dim); }
.draft-banner {
  border: 1px solid var(--warning); color: var(--warning); background: rgba(226, 170, 96, 0.08);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 28px;
}
.devbanner {
  border: 1px dashed var(--warning); color: var(--warning);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 20px; font-size: 0.9rem;
}
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.card + .card { margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--label); font-weight: 500; }
.table-wrap { overflow-x: auto; }
ul.clean { list-style: none; padding: 0; }
.features { columns: 2 300px; column-gap: 32px; padding-left: 1.1em; }
.features li { break-inside: avoid; margin-bottom: 0.5em; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.8rem; background: var(--field); color: var(--label); }
.badge.ok { background: rgba(124, 197, 138, 0.15); color: var(--ok); }
.badge.warn { background: rgba(226, 170, 96, 0.15); color: var(--warning); }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-row .meta { color: var(--dim); font-size: 0.85rem; word-break: break-all; }
.message { padding: 10px 14px; border-radius: var(--radius); background: var(--field); margin: 14px 0; }
.message.error { background: rgba(240, 120, 120, 0.12); color: #f2b0b0; }
.message.ok { background: rgba(124, 197, 138, 0.12); color: var(--ok); }
.outbox li { margin-bottom: 14px; word-break: break-all; }
[hidden] { display: none !important; }

/* --- the guide ----------------------------------------------------------------------------------- */
.guide { display: grid; grid-template-columns: 220px 1fr; gap: 40px; max-width: 1100px; margin: 0 auto; padding: 40px 16px 64px; width: 100%; }
.guide-nav ol { list-style: none; padding: 0; margin: 0; position: sticky; top: 16px; }
.guide-nav a { display: block; padding: 6px 10px; border-radius: var(--radius); color: var(--label); }
.guide-nav a:hover { background: var(--field); color: var(--text); text-decoration: none; }
.guide-nav a[aria-current="page"] { background: var(--field); color: var(--text); }
.guide article { min-width: 0; max-width: 760px; }
.guide article li { margin-bottom: 0.4em; }
.guide .command { color: var(--text); border-bottom: 1px dotted var(--dim); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); }

/* --- small screens: the landing page may scroll there -------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .media .frame { max-height: none; }
  .guide { grid-template-columns: 1fr; gap: 16px; }
  .guide-nav ol { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .statusbar .hints { display: none; }
}
@media (max-height: 640px) and (min-width: 901px) {
  .thumbs { display: none; }
  .points { margin: 0.8em 0 1em; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .thumbs button { transition: background-color 0.12s, opacity 0.12s, border-color 0.12s; }
}
