/* ============================================================
   Jun Wen Leong — Personal Site
   Single-page thesis-first layout
   Brand: dark, monospace, cyan = findings only, no curves/shadows
   ============================================================ */

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

:root {
  --bg: #080b0f;
  --text: #b0b8bd;
  --text-bright: #d8dee3;
  --text-dim: #7a868c;
  --cyan: #00e5ff;
  --border: #1a2024;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  padding: 80px 24px 48px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Selection */
::selection {
  background: rgba(0, 229, 255, 0.15);
  color: var(--text-bright);
}

/* Focus */
a:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 3px;
}

/* Layout */
.site {
  max-width: 680px;
  margin: 0 auto;
}

/* Header / Thesis */
.site__header {
  margin-bottom: 64px;
}

.site__name {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 1vw + 0.9rem, 1.35rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 2px;
}

.site__role {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.site__thesis {
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.site__stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.site__method {
  font-size: 0.82rem;
  color: var(--text);
  margin-top: 16px;
  line-height: 1.55;
}

/* Findings — cyan reserved for empirical numbers */
.finding {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Sections */
.site__section {
  margin-bottom: 56px;
}

.site__section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.site__section-bridge {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Papers */
.paper {
  margin-bottom: 28px;
  padding-left: 14px;
  margin-left: -14px;
  border-left: 2px solid transparent;
  transition: border-color 150ms ease;
}

.paper__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 120ms;
}

.paper__link:hover {
  color: var(--text-bright);
}

.paper__title {
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 4px;
  margin-bottom: 6px;
  transition: color 150ms ease;
}

.paper__detail {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 4px;
}

.paper__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.paper__links {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-top: 6px;
}

.paper__links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 120ms;
}

.paper__links a:hover {
  color: var(--cyan);
}

/* Paper hover interaction */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .paper {
    transition: border-color 150ms ease, transform 150ms ease;
  }

  .paper:hover {
    border-left-color: var(--cyan);
    transform: translateX(2px);
  }

  .paper:hover .paper__title {
    color: #fff;
  }
}

/* Forthcoming papers */
.paper--upcoming {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.paper__upcoming-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.paper__upcoming-item {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 4px;
  padding-left: 12px;
  position: relative;
}

.paper__upcoming-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  background: var(--text-dim);
}

/* Systems */
.system {
  margin-bottom: 20px;
}

.system__title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.system__detail {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 4px;
}

.system__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Footer */
.site__footer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 56px;
}

.site__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.site__contacts a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 120ms;
  padding: 6px 0;
  display: inline-block;
}

.site__contacts a:hover {
  color: var(--text-bright);
}

.site__footer-links {
  display: flex;
  gap: 16px;
}

.site__footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  text-decoration: none;
  padding: 6px 0;
  display: inline-block;
}

.site__footer-links a:hover {
  text-decoration: underline;
}

.site__experiments-link {
  color: var(--text-dim);
}

.site__experiments-link:hover {
  color: var(--cyan);
  text-decoration: none;
}

/* Font size floor for metadata */
.site__section-title,
.paper__meta,
.paper__links,
.system__meta,
.site__stats {
  font-size: 0.72rem;
}

/* Responsive */
@media (max-width: 500px) {
  body {
    padding: 44px 18px 34px;
  }

  .site__header {
    margin-bottom: 52px;
  }

  .site__thesis {
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  }

  .paper {
    margin-bottom: 32px;
  }

  .site__contacts {
    gap: 12px;
  }
}

/* Print */
@media print {
  @page {
    margin: 0.65in;
  }

  html {
    font-size: 11pt;
  }

  body {
    background: #fff;
    color: #1a1a1a;
    padding: 0;
  }

  .site__name { color: #000; }
  .site__thesis { color: #111; }
  .site__role, .site__stats, .paper__meta, .system__meta { color: #555; }
  .paper__link { color: #0066cc; }
  .site__section-title { border-bottom-color: #ddd; color: #333; }
  .site__footer { border-top-color: #ddd; }
  .site__contacts a { color: #333; }
  .site__footer-links a { color: #0066cc; }

  :root {
    --border: #ddd;
    --cyan: #0066cc;
  }

  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.75em;
    color: #555;
    word-break: break-all;
  }

  .paper, .system {
    break-inside: avoid;
  }

  .site__experiments-link,
  script {
    display: none;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (forced-colors: active) {
  .paper__link { color: LinkText; }
  .paper__upcoming-item::before { background: CanvasText; }
}
