/* ============================================================
   LEE CHUN YONG — PORTFOLIO DESIGN SYSTEM
   Concept: the trust boundary. Every panel is drawn like an
   enclave diagram — a sealed region with a labelled perimeter —
   because that is the actual shape of the work (TEE/FHE,
   biometric data that stays encrypted while it's computed on).
   ============================================================ */

:root {
  /* Color */
  --bg: #0b0f14;
  --bg-panel: #121821;
  --bg-panel-raised: #171f2b;
  --border: #26313f;
  --border-strong: #3a4a5c;
  --text: #e7edf3;
  --text-muted: #8a97a6;
  --text-dim: #5b6672;
  --accent: #5eead4;       /* cyan — encrypted trace */
  --accent-dim: #2e5f58;
  --accent-2: #f2b84b;     /* amber — status / flagged */
  --ok: #6ee7a0;

  /* Type */
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Scale */
  --content-width: 880px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(94, 234, 212, 0.05), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(242, 184, 75, 0.03), transparent 40%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
  display: inline-block;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-id {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.nav-id span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-link:hover { color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--accent); }

.status-pill {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 20px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(110, 231, 160, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 10px;
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
}

.boot-log {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  min-height: 4.2em;
  margin-bottom: 28px;
}
.boot-log .line { display: block; opacity: 0; animation: reveal-line 0.3s forwards; }
.boot-log .line.ok { color: var(--ok); }
.boot-log .line:nth-child(1) { animation-delay: 0.1s; }
.boot-log .line:nth-child(2) { animation-delay: 0.55s; }
.boot-log .line:nth-child(3) { animation-delay: 1.0s; }
@keyframes reveal-line {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-log .line { opacity: 1; animation: none; }
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero .role {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 22px;
}

.hero p.lede {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #0b0f14;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #7ff0dc; }

/* ---------- Trust-boundary panel (signature element) ---------- */

.boundary {
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px;
  margin: 20px 0 0;
  background: linear-gradient(180deg, var(--bg-panel), rgba(18, 24, 33, 0.4));
}

.boundary::before,
.boundary::after,
.boundary .corner-tl,
.boundary .corner-br {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
}
.boundary::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.boundary::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.boundary-tag {
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--bg);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ---------- Sections ---------- */

section { padding: 72px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: 1.5rem; margin-top: 8px; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}
.fact-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.82rem; }
.fact-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.fact-list li:last-child { border-bottom: none; }
.fact-list .k { color: var(--text-dim); }
.fact-list .v { color: var(--text); text-align: right; }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}
.timeline-entry { position: relative; padding-bottom: 40px; }
.timeline-entry:last-child { padding-bottom: 0; }
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.timeline-role { font-size: 1.05rem; font-weight: 600; }
.timeline-org { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
}
.timeline-entry ul { margin: 10px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 0.94rem; }
.timeline-entry li { margin-bottom: 6px; }

/* Skills */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg-panel);
}
.skill-group h3 {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-muted);
}

/* Featured project teasers */
.teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.teaser-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.teaser-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.teaser-tag { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent-2); letter-spacing: 0.08em; }
.teaser-card h3 { font-size: 1rem; margin: 8px 0 8px; }
.teaser-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.teaser-link { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: 0.76rem; }

/* Contact */
.contact-block {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  display: grid;
  gap: 12px;
}
.contact-row { display: flex; gap: 16px; }
.contact-row .k { color: var(--text-dim); width: 90px; flex-shrink: 0; }

footer {
  padding: 32px 0 60px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Projects page ---------- */

.page-head { padding: 56px 0 20px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 10px 0 12px; }
.page-head p { color: var(--text-muted); max-width: 620px; margin: 0; }

.project-log { padding-bottom: 90px; display: grid; gap: 22px; }

.case-file {
  position: relative;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 26px 28px;
  background: var(--bg-panel);
  transition: border-left-color 0.15s ease;
}
.case-file:hover { border-left-color: var(--accent); }

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.case-id { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-2); letter-spacing: 0.08em; }
.case-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.case-file h2 { font-size: 1.15rem; margin-bottom: 4px; }
.case-role { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); margin-bottom: 14px; }
.case-file p.summary { color: var(--text-muted); font-size: 0.94rem; margin: 0 0 14px; }
.case-file ul { margin: 0 0 16px; padding-left: 20px; color: var(--text-muted); font-size: 0.9rem; }
.case-file li { margin-bottom: 5px; }
.case-links { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 0.78rem; }

.empty-slot {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 28px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .status-pill { display: flex; }
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .skill-groups { grid-template-columns: 1fr; }
  .teaser-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--border); }
  .nav-link { display: block; padding: 14px 24px; }
  .nav-toggle { display: block; }
}
