/* Java4Shell disclosure — fonts and palette from the seashell site, stripped to a reading layout. */

@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-1.500.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Routed Gothic";
  src: url("fonts/routed-gothic.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Routed Gothic Narrow";
  src: url("fonts/routed-gothic-narrow.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Route One";
  src: url("fonts/route-one.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0031;
}
@font-face {
  font-family: "Route One Narrow";
  src: url("fonts/route-one-narrow.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0031;
}

:root {
  color-scheme: dark;
  --black: #000;
  --bright: #eeebff;
  --dim: #86779d;
  --violet: #b29bff;
  --cyan: #69e0eb;
  --pink: #f38bbb;
  --green: #b9ef76;
  --red: #ff7894;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --pixel: "Departure Mono", ui-monospace, monospace;
  --routed: "Route One", "Routed Gothic", sans-serif;
  --routed-narrow: "Route One Narrow", "Routed Gothic Narrow", "Route One", "Routed Gothic", sans-serif;
  --page-max: 1040px;
  --read-max: 760px;
  --gutter: clamp(20px, 6vw, 80px);
  font-synthesis: none;
  font-kerning: none;
  font-variant-ligatures: none;
}

* { box-sizing: border-box; }
html { background: #000; scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--bright);
  font-family: var(--pixel);
  font-size: 16.5px;
  line-height: 1.6;
  overflow-x: hidden;
}
em, i, cite, var { font-style: normal; }
.doc em, .hero-dek em, .summary-card em { font-style: italic; font-synthesis: style; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }
::selection { color: #000; background: var(--green); }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; background: var(--green); color: #000; font: 11px/22px var(--pixel); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.wrap { width: calc(100% - 2 * var(--gutter)); max-width: var(--page-max); margin-inline: auto; }
.read { max-width: var(--read-max); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  height: 64px; padding: 0 var(--gutter);
  background: rgba(0,0,0,.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid #16121f;
}
.brand { color: var(--bright); font: 15px/1 var(--pixel); letter-spacing: -.03em; white-space: nowrap; }
.brand span { color: var(--cyan); }
.header-link { color: #b5a6cb; font: 11px/22px var(--pixel); letter-spacing: .03em; white-space: nowrap; text-decoration: underline; text-decoration-color: #4b3b5d; text-underline-offset: 3px; }
.header-link:hover { color: var(--cyan); text-decoration-color: var(--cyan); }
.header-link .arrow { text-decoration: none; }

/* Hero */
.hero { padding: clamp(46px, 8vw, 92px) 0 clamp(26px, 3vw, 40px); }
.hero-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px, 360px); gap: clamp(28px, 5vw, 64px); align-items: start; }
.hero-eyebrow { margin: 0 0 22px; color: #a398bb; font: 11px/22px var(--pixel); letter-spacing: .03em; }
.hero-title { margin: 0; color: #f1ecff; font: 400 clamp(56px, 9vw, 104px)/.9 var(--routed-narrow); letter-spacing: .01em; }
.hero-tagline { margin: 20px 0 0; color: var(--cyan); font: 400 clamp(21px, 2.6vw, 30px)/1.2 var(--routed); letter-spacing: .01em; }
.hero-byline { margin: 14px 0 0; color: #8d80a0; font-family: var(--routed); font-size: clamp(15px, 1.3vw, 18px); letter-spacing: .004em; }
.hero-byline a { color: var(--green); text-decoration: underline; text-decoration-color: #5f7d3f; text-underline-offset: .16em; }
.hero-byline a:hover { color: var(--cyan); }
.hero-jump { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 32px 0 0; }
.hero-jump a { color: #a398bb; font: 12px/1.4 var(--pixel); letter-spacing: .02em; }
.hero-jump a:hover { color: var(--cyan); }
.hero-jump .arrow { color: var(--green); }
.hero-dek { margin: 26px 0 0; max-width: 60ch; color: #b4a7c6; font-family: var(--routed); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; letter-spacing: .004em; }
.hero-dek a { color: var(--green); text-decoration: underline; text-decoration-color: #5f7d3f; text-underline-offset: .16em; }
.hero-dek a:hover { color: var(--cyan); }
.hero-poster { margin: 0; }
.hero-poster img { display: block; width: 100%; height: auto; border: 1px solid #241a33; background: #0a0710; }
.hero-poster figcaption { margin-top: 10px; color: #6a5c7c; font: 11px/18px var(--pixel); }

/* Summary */
.summary { padding: 36px 0 10px; }
.summary-card { border: 1px solid #241a33; border-left: 4px solid var(--violet); background: linear-gradient(90deg,#0c0812,#060409 70%); padding: clamp(24px,4vw,40px); }
.summary-label { margin: 0 0 16px; color: var(--cyan); font: 11px/22px var(--pixel); letter-spacing: .04em; }
.summary-card p { margin: 0; color: #c3b8d6; font-family: var(--routed); font-size: clamp(18px,1.6vw,22px); line-height: 1.62; letter-spacing: .004em; }
.summary-card p + p { margin-top: 1em; }
.summary-card p a { color: var(--green); text-decoration: underline; text-decoration-color: #5f7d3f; text-underline-offset: .16em; }
.summary-card p a:hover { color: var(--cyan); }
.summary-card code { color: var(--cyan); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 26px 44px; margin: 34px 0 0; padding: 30px 0 0; border-top: 1px solid #241a33; }
.fact dt { margin: 0; color: var(--cyan); font: 11px/20px var(--pixel); letter-spacing: .03em; }
.fact dd { margin: 9px 0 0; color: #d3c9e3; font-family: var(--routed); font-size: 17px; line-height: 1.5; letter-spacing: .004em; }
.fact dd code { color: var(--cyan); font-size: 14.5px; }

/* Body layout: article column + sticky TOC rail */
.body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: clamp(30px, 4vw, 60px); }
.body-main { grid-column: 1; grid-row: 1; min-width: 0; }
.toc-rail { grid-column: 2; grid-row: 1; }
/* Writeup chapter: TOC on the left, article on the right. */
.body-toc-left { grid-template-columns: 220px minmax(0, 1fr); }
.body-toc-left .body-main { grid-column: 2; }
.body-toc-left .toc-rail { grid-column: 1; }

/* Table of contents */
.toc { position: sticky; top: 88px; }
.toc-label { margin: 0 0 14px; color: var(--cyan); font: 11px/22px var(--pixel); letter-spacing: .06em; }
.toc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #1c1528; }
.toc-list li { border-bottom: 1px solid #1c1528; }
.toc-list a { display: flex; align-items: baseline; gap: 12px; padding: 10px 2px; color: #8f82a0; font-family: var(--routed); font-size: 15px; line-height: 1.3; letter-spacing: .004em; transition: color .15s; }
.toc-list a:hover { color: var(--cyan); }
.toc-num { flex: none; min-width: 18px; color: var(--dim); font: 10px/1.5 var(--pixel); letter-spacing: .03em; }
.toc-list a:hover .toc-num { color: var(--green); }

@media (max-width: 1000px) {
  .body, .body-toc-left { grid-template-columns: 1fr; gap: 0; }
  .body-main, .toc-rail,
  .body-toc-left .body-main, .body-toc-left .toc-rail { grid-column: 1; grid-row: auto; }
  .toc { position: static; padding-top: clamp(28px, 5vw, 44px); }
  .toc-list { max-width: var(--read-max); }
}

/* Article (narrative + writeup) */
.doc { padding: clamp(40px,6vw,72px) 0 40px; }
#narrative { padding-top: clamp(30px, 3.5vw, 44px); }
#writeup-chapter { padding-top: clamp(44px, 6vw, 76px); }
#technical-writeup { padding-top: clamp(8px, 1.5vw, 16px); }

/* ---- Chapters: light narrative, dark writeup ---- */
.chapter-light { background: #f5f3ec; color: #2c2834; }
.chapter-dark { background: #000; }

.chapter-light .doc h2 { color: #16121d; }
.chapter-light .doc h3, .chapter-light .doc h4 { color: #5b3fa0; }
.chapter-light .doc p, .chapter-light .doc li { color: #3c3647; }
.chapter-light .doc strong { color: #16121d; }
.chapter-light .doc a { color: #a4392a; text-decoration-color: #d9b3ab; }
.chapter-light .doc a:hover { color: #7f2a1e; text-decoration-color: #a4392a; }
.chapter-light .doc li::before { background: #a4392a; }
.chapter-light .doc code { color: #9b2d6b; }
/* Narrative code blocks blend with the light page; no copy button here. */
.chapter-light .copy-btn { display: none; }
.chapter-light .doc pre { background: #ece7da; border-color: #ddd6c6; padding-right: 22px; }
.chapter-light .doc pre.pseudo { border-left-color: #1f6f7d; }
.chapter-light .doc pre code,
.chapter-light .doc pre code.hljs { color: #2c2834; }
.chapter-light .hljs-comment, .chapter-light .hljs-quote { color: #8a8270; }
.chapter-light .hljs-keyword, .chapter-light .hljs-literal, .chapter-light .hljs-type, .chapter-light .hljs-name, .chapter-light .hljs-selector-tag { color: #5b3fa0; }
.chapter-light .hljs-string, .chapter-light .hljs-regexp, .chapter-light .hljs-addition { color: #2f7d4f; }
.chapter-light .hljs-number, .chapter-light .hljs-link { color: #a4392a; }
.chapter-light .hljs-title, .chapter-light .hljs-title.function_, .chapter-light .hljs-section { color: #1f6f7d; }
.chapter-light .hljs-built_in, .chapter-light .hljs-title.class_, .chapter-light .hljs-params { color: #2a5a8a; }
.chapter-light .hljs-attr, .chapter-light .hljs-variable, .chapter-light .hljs-template-variable { color: #4b4535; }
.chapter-light .hljs-symbol, .chapter-light .hljs-bullet, .chapter-light .hljs-operator, .chapter-light .hljs-punctuation { color: #3c3647; }
.chapter-light .doc hr.sec { border-top-color: #ded8ca; }
.chapter-light .doc figure img { border-color: #ddd6c6; background: #ece7db; }
.chapter-light .doc figure figcaption { color: #6f685b; }
.chapter-light .doc .video-frame { border-color: #ddd6c6; background: #ece7db; }

.chapter-light .toc-label { color: #a4392a; }
.chapter-light .toc-list { border-top-color: #ded8ca; }
.chapter-light .toc-list li { border-bottom-color: #ded8ca; }
.chapter-light .toc-list a { color: #4b4535; }
.chapter-light .toc-list a:hover { color: #a4392a; }
.chapter-light .toc-num { color: #8d836f; }
.chapter-light .toc-list a:hover .toc-num { color: #a4392a; }
.doc-part-label { margin: 0 0 6px; color: var(--cyan); font: 11px/22px var(--pixel); letter-spacing: .06em; text-transform: uppercase; }
.doc h2 { clear: both; margin: 0 0 24px; color: #e6def2; font: 400 clamp(30px,3.4vw,44px)/1.15 var(--routed-narrow); letter-spacing: .008em; }
.doc h3 { margin: 56px 0 20px; color: var(--violet); font: 400 clamp(25px,2.4vw,32px)/1.2 var(--routed); letter-spacing: .006em; }
.doc h4 { margin: 44px 0 16px; color: var(--violet); font: 400 22px/1.3 var(--routed); letter-spacing: .006em; }
.doc p { margin: 0 0 1.05em; color: #b1a4c4; font-family: var(--routed); font-size: clamp(18px,1.45vw,21px); line-height: 1.64; letter-spacing: .004em; }
.doc ul { margin: 0 0 1.2em; padding: 0; list-style: none; }
.doc li { position: relative; margin: 0 0 .5em; padding-left: 26px; color: #b1a4c4; font-family: var(--routed); font-size: clamp(17px,1.4vw,20px); line-height: 1.55; letter-spacing: .004em; }
.doc li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 7px; height: 7px; background: var(--green); }
.doc a { color: var(--green); text-decoration: underline; text-decoration-color: #5f7d3f; text-decoration-thickness: 1.5px; text-underline-offset: .16em; transition: color .15s, text-decoration-color .15s; }
.doc a:hover { color: var(--cyan); text-decoration-color: var(--cyan); }
.doc strong { color: #ddd4ec; font-weight: 400; }
.doc code { color: var(--cyan); font-size: .86em; overflow-wrap: anywhere; }
.doc h2 code, .doc h3 code, .doc li code { font-size: inherit; }

/* Insight pull-quote */
.doc blockquote { max-width: var(--read-max); margin: 34px 0; padding: 4px 0 4px 30px; border-left: 3px solid var(--cyan); color: #ddd4ec; font-family: var(--routed); font-size: clamp(23px, 2.6vw, 31px); line-height: 1.3; letter-spacing: .006em; }
.doc blockquote em { font-style: italic; }
.chapter-light .doc blockquote { border-left-color: #1f6f7d; color: #2c2834; }

.doc-section { max-width: var(--read-max); }
.doc hr.sec { max-width: var(--read-max); margin: 10px 0; border: 0; }

/* Inline figures */
.doc figure.fig { margin: 0 0 1.4em; max-width: var(--read-max); }
.doc figure.fig-right { float: right; width: min(320px, 46%); margin: 4px -148px 18px 32px; }
.doc figure.fig-left { float: left; width: min(320px, 46%); margin: 4px 32px 18px -148px; }
.doc figure.fig-center { width: min(340px, 72%); margin: clamp(26px, 4vw, 44px) auto; }
.doc figure.fig-center figcaption { text-align: center; }
.doc figure img { display: block; width: 100%; height: auto; border: 1px solid #241a33; background: #0a0710; }
.doc figure figcaption { margin-top: 10px; color: #6a5c7c; font: 11px/18px var(--pixel); letter-spacing: .02em; }
@media (max-width: 1040px) {
  .doc figure.fig-right { margin-right: 0; width: min(300px, 42%); }
  .doc figure.fig-left { margin-left: 0; width: min(300px, 42%); }
}
@media (max-width: 640px) {
  .doc figure.fig-right, .doc figure.fig-left { float: none; width: 100%; max-width: 360px; margin: 18px 0; }
}

/* "Release timing" diagram (ported from the seashell source) */
.doc .rt-diagram { max-width: var(--read-max); margin: 26px 0; }
.rt-diagram svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--routed-narrow); }
.rt-diagram rect, .rt-diagram line, .rt-diagram path { vector-effect: non-scaling-stroke; }
.rt-diagram text { fill: #f4f7fa; text-anchor: middle; dominant-baseline: middle; font-size: 15px; letter-spacing: 0; }
.rt-diagram text[text-anchor="start"] { text-anchor: start; }
.rt-diagram text[text-anchor="end"] { text-anchor: end; }
.rt-grid { stroke: #26323d; fill: none; }
.rt-step { fill: #f4f7fa; font-size: 12px; }
.rt-sub { fill: #b7c1cb; font-size: 12px; }
.rt-col { fill: #b7c1cb; font-size: 9px; }
.rt-role { fill: #f4f7fa; font-size: 11px; }
.rt-cell-label { fill: #f4f7fa; font-size: 10px; }
.rt-wait { fill: #ffcb68; font-size: 9px; }
.rt-rule { fill: #72e3b6; font-size: 10px; }
.rt-caveat { fill: #b7c1cb; font-size: 10px; }
.rt-prefix { fill: #0a2b3a; stroke: #5fd0fb; stroke-width: 1.5; }
.rt-held { fill: #34260e; stroke: #ffcb68; stroke-width: 1.5; }
.rt-gate { stroke: #ffcb68; stroke-width: 2; fill: none; }
.rt-pad, .rt-decoder { fill: #0a2b3a; stroke: #5fd0fb; stroke-width: 1.5; }
.rt-writer { fill: #0b3429; stroke: #72e3b6; stroke-width: 1.5; }
.rt-reader { fill: #2d2440; stroke: #d2b8ff; stroke-width: 1.5; }

/* Video grid (2x2 YouTube players) */
.doc .video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(14px, 2vw, 22px); max-width: var(--read-max); margin: 12px 0 1.7em; }
.doc figure.video { margin: 0; }
.doc .video-frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid #241a33; background: #0a0710; }
.doc .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc figure.video figcaption { margin-top: 8px; color: #6a5c7c; font: 11px/18px var(--pixel); letter-spacing: .02em; }
@media (max-width: 620px) { .doc .video-grid { grid-template-columns: 1fr; } }

/* Code blocks */
.doc .code-block { position: relative; max-width: var(--read-max); margin: 0 0 1.4em; }
.doc pre { margin: 0; padding: 20px 64px 20px 22px; overflow-x: auto; border: 1px solid #241a33; background: #070409; color: #cfc3df; font-size: 13px; line-height: 1.7; tab-size: 4; }
.doc pre code { color: inherit; font-size: inherit; white-space: pre; }
/* Shell/unlabeled blocks wrap instead of scrolling; real code keeps its layout. */
.doc pre.wrap, .doc pre.wrap code { white-space: pre-wrap; overflow-wrap: anywhere; }
.doc pre.wrap { overflow-x: visible; width: 100%; }
.doc pre.pseudo { border-left: 4px solid #5fd0fb; }

/* Syntax highlighting: highlight.js tokens mapped to the site palette. */
.doc pre code.hljs { color: #cfc3df; background: none; padding: 0; }
.hljs-comment, .hljs-quote { color: #6f6180; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-name { color: var(--violet); }
.hljs-string, .hljs-meta .hljs-string, .hljs-regexp, .hljs-addition { color: var(--green); }
.hljs-number, .hljs-link { color: var(--pink); }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-selector-id { color: var(--cyan); }
.hljs-built_in, .hljs-title.class_, .hljs-class .hljs-title, .hljs-params { color: #7fd0ea; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-attr { color: #c9bfe0; }
.hljs-meta, .hljs-comment .hljs-doctag { color: #6f6180; }
.hljs-symbol, .hljs-bullet, .hljs-operator, .hljs-punctuation { color: #b4a7c6; }
.hljs-deletion { color: var(--red); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 5px 12px;
  border: 1px solid #2a2140; background: #0b0814; color: var(--dim);
  font: 10px/1 var(--pixel); letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* Asides, takeaways, notes */
.doc aside.margin-note { max-width: var(--read-max); margin: 10px 0 1.5em; padding: 14px 0 14px 20px; border-left: 2px solid #3a2d4e; }
.doc aside.margin-note .aside-label { display: block; margin-bottom: 6px; color: var(--cyan); font: 10px/18px var(--pixel); letter-spacing: .04em; text-transform: uppercase; }
.doc aside.margin-note p { margin: 0; color: #8d80a0; font-size: 15.5px; line-height: 1.55; }
.doc aside.margin-note p + p { margin-top: .6em; }
.doc aside.margin-note a { color: #b5a6cb; }

.doc aside.takeaway { position: relative; max-width: var(--read-max); margin: 26px 0 30px; padding: 22px 26px; border: 1px solid #2a2140; background: #0b0814; }
.doc aside.takeaway::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--cyan) 0 34%, var(--green) 34% 100%); }
.doc aside.takeaway .aside-label { display: block; margin-bottom: 12px; color: var(--cyan); font: 10px/20px var(--pixel); letter-spacing: .05em; }
.doc aside.takeaway p { margin: 0 0 .7em; color: #d5ccdf; font-size: 18px; line-height: 1.55; }
.doc aside.takeaway p:last-child { margin-bottom: 0; }
.doc aside.takeaway code { color: var(--cyan); }

.doc dl.notes { max-width: var(--read-max); margin: 0 0 1.4em; padding: 0; }
.doc dl.notes > div { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 10px 24px; padding: 13px 0; border-top: 1px solid #1c1528; }
.doc dl.notes > div:last-child { border-bottom: 1px solid #1c1528; }
.doc dl.notes dt { margin: 0; color: var(--cyan); font: 11px/20px var(--pixel); letter-spacing: .03em; }
.doc dl.notes dd { margin: 0; color: #a89bbb; font-family: var(--routed); font-size: 16px; line-height: 1.5; }

/* Case-study chip */
.doc .case-chip { display: inline-block; margin: 8px 0 18px; padding: 6px 14px; border: 1px solid #2a2140; color: var(--violet); font: 10px/18px var(--pixel); letter-spacing: .06em; text-transform: uppercase; }

/* Writeup header */
.writeup-kicker { margin: 0 0 6px; color: #8f82a0; font-family: var(--routed); font-size: clamp(20px,2vw,26px); letter-spacing: .01em; }
.writeup-byline { margin: 0 0 30px; color: #6f6180; font: 11px/22px var(--pixel); letter-spacing: .03em; }

/* Footer */
.site-footer { margin-top: 70px; padding: 48px 0 60px; border-top: 1px solid #16121f; }
.site-footer p { margin: 0; color: #675a74; font-family: var(--routed); font-size: 15px; line-height: 1.6; }
.site-footer a { color: #b5a6cb; text-decoration: underline; text-decoration-color: #4b3b5d; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--cyan); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0,1fr); }
  .hero-poster { grid-row: 1; max-width: 320px; }
  .doc dl.notes > div { grid-template-columns: minmax(0,1fr); gap: 4px; }
}
