/* kryptos.gg - shared styles (landing + docs). The app's "Blood Moon" palette: dark slate, red accent. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/BricolageGrotesque-500.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/BricolageGrotesque-700.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/InstrumentSans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/InstrumentSans-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/InstrumentSans-500.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/InstrumentSans-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/JetBrainsMono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/JetBrainsMono-500.woff2") format("woff2"); }

:root {
  --bg: #111219;
  --bg-2: #14151e;
  --surface: #1b1c28;
  --raised: #2B2D42;
  --line: #3b3e58;
  --line-soft: #2a2c40;
  --ink: #EDF2F4;
  --ink-2: #b7bfcc;
  --ink-3: #96a1b5;
  --accent: #ff5a6c;
  --accent-hover: #ff7583;
  --accent-soft: rgba(255, 90, 108, 0.14);
  --accent-ink: #ffffff;
  --primary: #D90429;
  --primary-hover: #ef233c;
  --navy: #0c0d13;
  --navy-2: #14151e;
  --navy-line: #2B2D42;
  --navy-ink: #EDF2F4;
  --navy-ink-2: #b7bfcc;
  --good: #8fd3a8;
  --warn: #f0c674;
  --bad: #ff5a6c;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --measure: 70ch;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; color: var(--ink); letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-family: var(--body); font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 0.15em; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--raised); border: 1px solid var(--line-soft); border-radius: 5px; padding: 0.05em 0.35em; color: var(--ink); }
pre { margin: 0; overflow: auto; padding: 1rem 1.1rem; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; font-size: 0.9rem; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--raised); color: #fff; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.rule { height: 1px; background: var(--line); margin: 1rem 0 1.5rem; }
.stripe { display: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.site-header .bar { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.wordmark .gem { width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { color: var(--ink-2); font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.cta { color: var(--accent-ink); background: var(--primary); padding: 0.45rem 0.95rem; border-radius: var(--radius); font-weight: 600; }
.site-nav a.cta:hover { background: var(--primary-hover); }
@media (max-width: 640px) { .site-nav a:not(.cta):not(.keep) { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; padding: 0.6rem 1.1rem; border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-3); background: var(--raised); text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--accent-ink); border-color: var(--primary); font-weight: 600; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* Forms */
.field { display: grid; gap: 0.35rem; }
.field label { color: var(--ink-2); font-weight: 500; }
input[type="email"], input[type="text"], input[type="search"] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.8rem; width: 100%; }
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--ink-3); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--ink-2); font-size: 0.95rem; }
.check input { margin-top: 0.25rem; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { color: var(--ink-3); font-size: 0.95rem; }
.form-status { min-height: 1.5em; font-weight: 500; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); background: var(--raised); font-size: 0.9rem; }
tbody tr:last-child td { border-bottom: 0; }

/* Code blocks: the one dark element on a light page */
.codeblock { position: relative; background: var(--navy); color: var(--navy-ink); border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0 1.5rem; }
.codeblock pre { padding-right: 4.5rem; }
.codeblock .copy { position: absolute; top: 0.55rem; right: 0.55rem; font: inherit; font-size: 0.8rem; color: var(--navy-ink-2); background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 5px; padding: 0.15rem 0.5rem; cursor: pointer; }
.codeblock .copy:hover { color: var(--navy-ink); }

/* Callouts */
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0 1.5rem; }
.callout.example { border-left-color: var(--good); }
.callout.warn { border-left-color: var(--warn); }
.callout-title { font-weight: 600; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.4rem; }
.callout p:last-child { margin-bottom: 0; }
blockquote { margin: 1rem 0; padding: 0.2rem 0 0.2rem 1rem; border-left: 3px solid var(--line); color: var(--ink-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0 2.5rem; color: var(--ink-3); font-size: 0.95rem; background: var(--bg-2); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer .cols div a { display: block; color: var(--ink-2); margin-bottom: 0.35rem; }
.site-footer .legal { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.site-footer .legal a { color: var(--ink-3); }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; gap: 1.25rem; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
