/* ken jiang — personal site
   One quiet column of text on pure black, over a full-page ASCII ocean (ocean.js). */

:root {
  color-scheme: dark;
  --paper: #000000;
  --paper-rgb: 0, 0, 0;
  --ink: #edebe6;
  --muted: #a09d95;
  --heading: #dedbd3;
  --rule: #2b2a28;
  --card: #111110;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  --ico-ring: rgba(255, 255, 255, 0.18);
  --col: 640px;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100lvh;
  margin: 0;
  padding: 0 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

/* ── backdrop ─────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh; /* don't resize when a phone's toolbar slides away */
  display: block;
  pointer-events: none;
  /* the engine draws its glyphs in whatever face the canvas is set in */
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Nothing is laid over the backdrop to keep the words readable: the backdrop itself goes quiet
   under them (textCover in site.js; the engine fades the fish there and draws a passing animal as
   a faint ghost of itself). */

/* ── column ───────────────────────────────────────────────────────────── */

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  padding: 84px 0 96px;
  transition: opacity 0.5s ease;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2.5px;
  text-decoration-color: var(--muted);
  transition: color 0.15s ease;
}
a:hover { color: var(--muted); }

a:focus-visible,
button:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

p { margin: 0 0 16px; }
.muted { color: var(--muted); }

/* ── masthead ─────────────────────────────────────────────────────────── */

.masthead { margin-bottom: 18px; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.7rem;
  line-height: 1.08;
  letter-spacing: -0.022em;
}

/* ── tabs ─────────────────────────────────────────────────────────────── */

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 22px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.13rem;
}
nav a {
  color: #b4b1a9;
  text-decoration: none;
}
nav a:hover,
nav a[aria-current="page"] { color: var(--ink); }

/* With JS on, the sections behave like pages. Without it they simply stack. */
.js[data-tab="about"] [data-panel]:not([data-panel="about"]),
.js[data-tab="competitions"] [data-panel]:not([data-panel="competitions"]) { display: none; }

.panel-title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
}
.js .panel-title { display: none; }
[data-panel] > :first-child,
.js [data-panel] > .panel-title + * { margin-top: 0; }
/* Stacked (no JS): give each section room, and drop the control that needs JS. */
html:not(.js) [data-panel] + [data-panel] { margin-top: 44px; }
html:not(.js) #zen-on { display: none; }

/* A small heading for the list under it: more air above than below, so it reads as
   belonging to what follows. */
.label {
  margin: 30px 0 4px;
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.3;
  color: var(--heading);
}
/* the first heading on a tab takes its space from the rule under the tabs */
.js [data-panel] > .panel-title + .label { margin-top: 4px; }
/* a new group after a list of entries */
.honors + .label { margin-top: 36px; }

/* ── about ────────────────────────────────────────────────────────────── */

.bullets {
  margin: 0 0 20px;
  padding: 0 0 0 17px;
  list-style: none;
  border-left: 2px solid var(--rule);
}
.bullets li {
  padding: 1px 0;
  line-height: 1.5;
}
.bullets li + li { margin-top: 13px; }
.bullets .sub {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

/* A logo never parts from the first word of its name at a line break, and a pair of words that
   belong together stays together. */
.org,
.nb { white-space: nowrap; }

/* Every logo sits in the same small chip: same size, same corner, same hairline ring, the same
   gap to its name. Full-colour marks get a little padding inside it; the three that bring their
   own dark tile simply fill it. */
.ico {
  width: 1.18em;
  height: 1.18em;
  margin-right: 0.36em;
  padding: 0.14em;
  vertical-align: -0.24em;
  object-fit: contain;
  border-radius: 0.28em;
  background: #141413;
  box-shadow: 0 0 0 1px var(--ico-ring);
}
.ico.tile { padding: 0; }

/* ── competitions ────────────────────────────────────────────────────────── */

.honor {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.honor:first-child { padding-top: 0; }
.honor:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.honor .desc {
  margin: 2px 0 0;
  color: var(--muted);
}
.honor .what { margin: 0; }
.honors { margin: 0 0 26px; }
.honors:last-child { margin-bottom: 0; }

/* ── footer ───────────────────────────────────────────────────────────── */

footer {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: #b0ada5;
  font-size: 0.92rem;
}
.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin-bottom: 12px;
}
.socials a,
.socials .quiet { color: var(--ink); }
.socials a:hover,
.socials .quiet:hover { color: var(--muted); }
.email { margin: 0; }

.quiet {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2.5px;
  text-decoration-color: var(--muted);
}

/* ── "hide the words": step aside and let the ocean have the page ─────── */

.zen .wrap {
  opacity: 0;
  pointer-events: none;
}

.zen-exit {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.zen-exit:hover { color: var(--muted); }
.zen-exit[hidden] { display: none; }

/* ── small screens, motion, print ─────────────────────────────────────── */

@media (max-width: 480px) {
  .wrap { padding: 56px 0 72px; }
  h1 { font-size: 2.35rem; }
  nav { gap: 6px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .backdrop, .zen-exit, #zen-on { display: none !important; }
  .js [data-panel] { display: block !important; margin-top: 28px; }
  .js .panel-title { display: block; }
  nav { display: none; }
  html, body { background: #fff; color: #000; }
  .muted, .label, .honor .desc, footer { color: #444; }
}

/* the little blueberry cat beside the name */
.mascot {
  width: 1em;
  height: 1em;
  margin-left: 0.28em;
  vertical-align: -0.16em;
}
