/* nazirulhazim.com — design system */

/* ── Tokens ──────────────────────────────── */
:root {
  --paper:   #ffffff;
  --paper-2: #f0f5fb;
  --paper-3: #e3edf6;
  --ink:     #0a1f35;
  --ink-2:   #2c4a68;
  --ink-3:   #6b8fa8;
  --border:  #b8cdd9;
  --red:     #006dae;
  --red-dk:  #004f80;
  --red-fg:  #fff;

  --fd: 'Fraunces', Georgia, serif;
  --fb: 'IBM Plex Sans', system-ui, sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, monospace;

  --rail:  280px;
  --bw:    1.4px;
  --cgap:  16px;
  --cpad:  20px;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--fb);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Site layout ─────────────────────────── */
.site {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
}

/* ── Rail ────────────────────────────────── */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: var(--bw) solid var(--ink);
  display: flex;
  flex-direction: column;
  padding: 38px 18px 26px 30px;
  overflow: hidden;
}
.rail-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--fm);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.rail-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.rail-name {
  font-family: var(--fd);
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 500;
  margin-bottom: 9px;
}
.rail-name em { font-style: italic; font-weight: 400; }
.rail-role {
  font-family: var(--fm);
  font-size: 10px;
  line-height: 1.65;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.rail-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(10,31,53,.06) 9px 10px),
    var(--paper-2);
  border: var(--bw) solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fm); font-size: 10px; color: var(--ink-3);
  position: relative; overflow: hidden;
  margin-bottom: 18px; flex-shrink: 0;
}
.rail-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent calc(50% - .7px), rgba(10,31,53,.16) 50%, transparent calc(50% + .7px));
}
.rail-photo span { z-index: 1; position: relative; }
.rail-rule { border: none; border-top: var(--bw) solid var(--border); margin-bottom: 10px; }
.rail-nav {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }
.rail-nav a {
  display: grid;
  grid-template-columns: 26px 1fr 14px;
  gap: 4px; align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--fm); font-size: 11.5px;
  color: var(--ink); transition: color .15s;
}
.rail-nav a:hover, .rail-nav a.active { color: var(--red); }
.rail-nav a .n  { color: var(--ink-3); font-weight: 700; font-size: 10.5px; }
.rail-nav a.active .n, .rail-nav a:hover .n { color: var(--red); }
.rail-nav a .arr { color: var(--ink-3); font-size: 11px; text-align: right; }
.rail-nav a.ext .arr { color: var(--red); }
.rail-foot {
  font-family: var(--fm); font-size: 9.5px; color: var(--ink-3);
  letter-spacing: .07em; line-height: 1.85; text-transform: uppercase;
  border-top: var(--bw) solid var(--border); padding-top: 10px; margin-top: 10px;
}
.rail-foot a:hover { color: var(--red); }

/* ── Section ─────────────────────────────── */
.sec { padding: 48px 52px; }
.sec + .sec { border-top: var(--bw) solid var(--ink); }

/* ── Section head ───────────────────────── */
.sh {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px; align-items: end;
  padding-bottom: 10px;
  border-bottom: var(--bw) solid var(--ink);
  margin-bottom: 24px;
}
.sh-n  { font-family: var(--fm); font-size: 11px; color: var(--red); letter-spacing: .14em; font-weight: 700; padding-bottom: 3px; }
.sh-title { font-family: var(--fd); font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1; margin: 0; }
.sh-meta  { font-family: var(--fm); font-size: 11px; color: var(--ink-3); padding-bottom: 4px; }

/* ── Bento ───────────────────────────────── */
.bento { display: grid; gap: var(--cgap); }
.b2 { grid-template-columns: 1fr 1fr; }
.b3 { grid-template-columns: repeat(3, 1fr); }
.b4 { grid-template-columns: repeat(4, 1fr); }

/* ── Card ────────────────────────────────── */
.card {
  border: var(--bw) solid var(--ink);
  background: var(--paper);
  padding: var(--cpad);
  display: flex; flex-direction: column; gap: 8px;
  transition: background .15s;
}
.card:hover { background: var(--paper-2); }
.card.red-top { border-top: 3px solid var(--red); }
.card.dark { background: var(--ink); color: var(--paper); }
.card.dark:hover { background: var(--ink-2); }
.card.dark .card-meta { color: rgba(255,255,255,.5); }
.card.dark .card-body { color: rgba(255,255,255,.75); }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-tag  { font-family: var(--fm); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.card-date { font-family: var(--fm); font-size: 10px; color: var(--ink-3); }
.card-title { font-family: var(--fd); font-size: 19px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.card-body  { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); flex: 1; }
.card-meta  { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); }
.card-val   { font-family: var(--fm); font-size: 13px; font-weight: 700; color: var(--red); }

/* Image-topped card */
.card.img-card { padding: 0; }
.card.img-card .card-inner { padding: var(--cpad); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-img {
  height: 150px; width: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(10,31,53,.06) 9px 10px),
    var(--paper-2);
  border-bottom: var(--bw) solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fm); font-size: 10px; color: var(--ink-3);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent calc(50% - .7px), rgba(10,31,53,.13) 50%, transparent calc(50% + .7px));
}
.card-img span { z-index: 1; position: relative; }

/* ── Archive table ───────────────────────── */
.arc { width: 100%; border-collapse: collapse; }
.arc th {
  font-family: var(--fm); font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  text-align: left; padding: 0 6px 8px 6px;
  border-bottom: var(--bw) solid var(--ink);
}
.arc th:first-child { padding-left: 0; }
.arc td { padding: 10px 6px; border-bottom: 1px dashed var(--border); vertical-align: top; font-size: 14px; line-height: 1.5; }
.arc td:first-child { padding-left: 0; }
.arc tr:hover td { background: var(--paper-2); }
.arc .n   { font-family: var(--fm); font-size: 11px; color: var(--red); font-weight: 700; white-space: nowrap; }
.arc .yr  { font-family: var(--fm); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.arc .ttl { font-family: var(--fd); }
.arc .wh  { font-family: var(--fm); font-size: 11px; color: var(--ink-3); }

/* ── Chip ─────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center;
  border: 1.2px solid var(--border);
  font-family: var(--fm); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-3);
}
.chip.red { border-color: var(--red); color: var(--red); }
.chip.active, .chip:hover { background: var(--red); border-color: var(--red); color: var(--red-fg); }

/* ── Pill link ───────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1.2px solid var(--red); color: var(--red);
  font-family: var(--fm); font-size: 10px; padding: 5px 12px;
  border-radius: 999px; letter-spacing: .06em; text-transform: uppercase;
  transition: background .15s, color .15s;
}
.pill:hover { background: var(--red); color: var(--red-fg); }

/* ── TOC row ─────────────────────────────── */
.toc-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 8px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.toc-row .code { font-family: var(--fm); font-size: 12px; color: var(--red); }
.toc-row .dots { border-bottom: 2px dotted var(--border); height: .65em; }
.toc-row .name { font-family: var(--fd); font-style: italic; }

/* ── Stat strip ──────────────────────────── */
.stat-strip {
  background: var(--ink); color: var(--paper);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 28px;
}
.stat-strip .s-label { font-family: var(--fm); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; opacity: .65; }
.stat-strip .s-val   { font-family: var(--fd); font-size: 30px; letter-spacing: -.02em; line-height: 1; }
.stat-strip .s-note  { font-family: var(--fm); font-size: 10px; opacity: .45; margin-left: auto; }

/* ── View-all ────────────────────────────── */
.view-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--red);
  border-bottom: 1.4px solid var(--red); padding-bottom: 2px;
  transition: opacity .15s;
}
.view-all:hover { opacity: .7; }

/* ── Print ───────────────────────────────── */
@media print {
  .rail, .no-print { display: none !important; }
  .site { display: block; }
  .sec { padding: 28px 40px; }
  .sec + .sec { border-top: 1px solid #999; }
}

/* ── Mobile ──────────────────────────────── */
@media (max-width: 820px) {
  .site {
    display: flex; flex-direction: column;
  }
  .rail {
    position: sticky; top: 0; height: auto;
    border-right: none; border-bottom: var(--bw) solid var(--ink);
    padding: 12px 20px; flex-direction: row; align-items: center;
    justify-content: space-between; z-index: 100;
    background: var(--paper);
  }
  .rail-photo, .rail-role, .rail-rule, .rail-nav, .rail-foot, .rail-status { display: none !important; }
  .rail-name { font-size: 18px; margin: 0; }
  .main, .cv-main { padding: 24px 18px; }
  .sec  { padding: 24px 18px; }
  .arc th:nth-child(3), .arc td:nth-child(3) { display: none; }
  .arc td { font-size: 13px; }
  .grid-12 { display: flex; flex-direction: column; gap: 14px; }
}

