/* Joseon — project page. Dark like the app, one accent, system fonts, no third-party assets. */

:root {
  --bg: #070A12;
  --bg-2: #0B1020;
  --panel: rgba(14, 19, 34, 0.72);
  --panel-line: rgba(140, 170, 230, 0.14);
  --text: #CCD6EA;
  --text-dim: #8A97B3;
  --text-bright: #F2F5FB;
  --accent: #3D8CFF;
  --accent-2: #39C7F0;
  --warn: #FFA626;
  --ok: #58D68D;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text-bright); letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 650; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: rgba(255, 255, 255, 0.06); padding: 0.1em 0.4em; border-radius: 5px; }
pre {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1em;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); }

/* The field sits behind the hero only and scrolls away with it. */
#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
#veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.72) 0%, rgba(7, 10, 18, 0.25) 30%, rgba(7, 10, 18, 0.15) 62%, rgba(7, 10, 18, 0.85) 92%, var(--bg) 100%);
}
#readout {
  position: fixed;
  left: 0; top: 0;
  z-index: 3;
  pointer-events: none;
  font: 12px/1 var(--mono);
  color: var(--text-bright);
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  padding: 6px 8px;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}
#readout.on { opacity: 1; }

/* Layout */
main { position: relative; z-index: 2; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 72px 0; }
.hero .lede, .hero .sub, .hero h1, .hero .eyebrow { text-shadow: 0 1px 12px rgba(7, 10, 18, 0.9), 0 0 2px rgba(7, 10, 18, 1); }
section + section { border-top: 1px solid rgba(140, 170, 230, 0.08); }

nav {
  position: sticky; top: 0; z-index: 4;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 10, 18, 0.55);
  border-bottom: 1px solid rgba(140, 170, 230, 0.08);
}
nav .wrap { display: flex; align-items: center; gap: 22px; height: 58px; }
nav .brand { display: flex; align-items: center; gap: 10px; color: var(--text-bright); font-weight: 650; font-size: 17px; }
nav .brand img { width: 28px; height: 28px; border-radius: 7px; }
nav .links { margin-left: auto; display: flex; gap: 18px; font-size: 14.5px; }
nav .links a { color: var(--text); white-space: nowrap; }
nav .links a:hover { color: var(--text-bright); text-decoration: none; }
nav .links a.gh { display: inline-flex; align-items: center; gap: 6px; color: var(--text-bright); padding: 6px 10px; border: 1px solid var(--panel-line); border-radius: 8px; }
nav .links a.gh svg { width: 15px; height: 15px; fill: currentColor; }
@media (max-width: 640px) { nav .links a.optional { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 92px 0 72px; min-height: 92vh; display: flex; align-items: center; }
.hero .wrap { position: relative; z-index: 2; width: 100%; }
.hero .lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--text); max-width: 640px; margin-bottom: 30px; }
.hero .lede b { color: var(--text-bright); font-weight: 600; }
.hero .sub { color: var(--text-dim); font-size: 15px; margin-top: 18px; }
.hero .sub span + span::before { content: "·"; margin: 0 10px; color: var(--text-dim); }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 18px; }

.downloads { display: flex; flex-wrap: wrap; gap: 14px; }
.download { display: flex; flex-direction: column; gap: 6px; min-width: 250px; }
.on-win .download[data-download="win"], .on-mac .download[data-download="mac"] { order: -1; }
.btn {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 58px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #4C97FF, #2F7BEC);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  box-shadow: 0 8px 28px rgba(61, 140, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 34px rgba(61, 140, 255, 0.33), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn .btn-sub { font: 12.5px/1.3 var(--mono); opacity: 0.85; font-weight: 400; margin-top: 3px; }
.download.pending .btn, .download.failed .btn { background: linear-gradient(180deg, #2A3650, #202A40); box-shadow: none; color: var(--text-bright); }
.download .meta { font-size: 13px; color: var(--text-dim); min-height: 1.2em; }
.download .meta a { color: var(--text); }
.tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); border: 1px solid rgba(255, 166, 38, 0.4); border-radius: 4px; padding: 3px 5px; vertical-align: 1px; }

/* Sound controls */
#sound {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  max-width: 760px;
}
#sound .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(140, 170, 230, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
#sound .chip:hover { background: rgba(255, 255, 255, 0.08); }
#sound .chip:disabled { opacity: 0.5; cursor: default; }
#sound .chip.active { border-color: var(--accent); background: rgba(61, 140, 255, 0.2); }
#sound .chip svg { width: 15px; height: 15px; fill: currentColor; }
#sound-status { flex-basis: 100%; font-size: 13px; color: var(--text-dim); padding: 2px 4px 0; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 20px 22px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--text); font-size: 15.5px; }
.card .k { color: var(--text-dim); font: 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }

.shots { display: grid; gap: 18px; margin-top: 28px; }
.shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--panel-line); background: #090C16; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 10px 14px; font-size: 14px; color: var(--text-dim); }

.intro { max-width: 720px; font-size: 18px; margin-bottom: 28px; }

/* Signal chain diagram */
.chain { width: 100%; height: auto; display: block; margin: 20px 0 10px; }
.chain text { font-family: var(--sans); font-size: 13px; fill: var(--text); }
.chain .box { fill: rgba(14, 19, 34, 0.9); stroke: rgba(140, 170, 230, 0.35); }
.chain .tap { fill: rgba(61, 140, 255, 0.18); stroke: var(--accent); }
.chain .wire { stroke: rgba(140, 170, 230, 0.6); stroke-width: 2; fill: none; }
.chain .copy { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 5; fill: none; }
.chain .small { font-size: 11.5px; fill: var(--text-dim); font-family: var(--mono); }

/* Claims table */
.claims {
  width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 24px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.claims th, .claims td { text-align: left; vertical-align: top; padding: 12px 14px; border-top: 1px solid var(--panel-line); }
.claims thead th { border-top: 0; }
.claims th { color: var(--text-dim); font: 600 12px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.claims td:first-child { color: var(--text-bright); font-weight: 600; width: 28%; }
.claims td:last-child { color: var(--text-dim); font-size: 14px; }
.claims code { white-space: nowrap; }
@media (max-width: 720px) {
  .claims thead { display: none; }
  .claims tr { display: block; padding: 10px 14px; border-top: 1px solid var(--panel-line); }
  .claims td { display: block; border: 0; padding: 4px 0; width: auto !important; }
  .claims code { white-space: normal; }
}

.callout {
  border-left: 3px solid var(--warn);
  background: rgba(255, 166, 38, 0.07);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 20px 0;
  font-size: 15.5px;
}
.callout.ok { border-color: var(--ok); background: rgba(88, 214, 141, 0.07); }
.callout.info { border-color: var(--accent); background: rgba(61, 140, 255, 0.08); }
.callout p:last-child { margin: 0; }

.statement {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 26px 28px;
  margin: 24px 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.statement h3 { font-size: 22px; margin-bottom: 14px; }
.statement .big { font-size: 19px; color: var(--text-bright); margin-bottom: 12px; }
.statement ul { padding-left: 22px; margin: 0 0 12px; }
.statement li { margin-bottom: 6px; }
.statement .signed { color: var(--text-dim); font: 13px/1.5 var(--mono); margin-top: 14px; }
.statement ul.plain { list-style: none; padding: 0; margin: 0 0 10px; }
.statement ul.plain li { padding: 9px 0; border-top: 1px solid var(--panel-line); font-size: 17px; }
.statement ul.plain li:first-child { border-top: 0; padding-top: 0; }
.statement ul.plain b { color: var(--text-bright); }
.statement .more { margin: 10px 0 0; font-size: 15.5px; }

/* The details page */
body.details .page-head { padding: 60px 0 10px; }
body.details .page-head h1 { font-size: clamp(34px, 5vw, 54px); }
body.details .page-head .lede { font-size: 18px; max-width: 680px; }
body.details .crumb { font: 14px/1 var(--mono); margin-bottom: 20px; }

/* Install steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.steps ol { padding-left: 20px; margin: 10px 0 0; }
.steps li { margin-bottom: 6px; font-size: 15px; }
.req { font: 13px/1.5 var(--mono); color: var(--text-dim); margin-top: 10px; }

footer { position: relative; z-index: 2; padding: 36px 0 48px; border-top: 1px solid rgba(140, 170, 230, 0.08); font-size: 14px; color: var(--text-dim); }
footer .wrap { display: grid; gap: 10px; }
footer a { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero { padding-top: 56px; min-height: 0; }
  .download { min-width: 0; flex: 1 1 100%; }
  .btn { width: 100%; }
}
