/* resume.chrisquek.my — Direction C "Systems Timeline"
   Fonts: Inter and JetBrains Mono, self-hosted (SIL Open Font Licence 1.1). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Colour tokens ---------- */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F8FAFC;
  --text: #0F172A;
  --muted: #475569;
  --link: #0B6B53;
  --line: #E2E8F0;
  --wash: #EEF2F6;
  --input: #7B8696;
  --btn-bg: #0F172A;
  --btn-text: #FFFFFF;
  --error: #B42318;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1117;
    --surface: #131A23;
    --text: #E6EAF0;
    --muted: #9AA6B5;
    --link: #4FD49B;
    --line: #253041;
    --wash: #172130;
    --input: #66748A;
    --btn-bg: #4FD49B;
    --btn-text: #0D1117;
    --error: #FF8A80;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1117;
  --surface: #131A23;
  --text: #E6EAF0;
  --muted: #9AA6B5;
  --link: #4FD49B;
  --line: #253041;
  --wash: #172130;
  --input: #66748A;
  --btn-bg: #4FD49B;
  --btn-text: #0D1117;
  --error: #FF8A80;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip {
  position: absolute; left: 12px; top: -60px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--btn-bg); color: var(--btn-text); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 920px; margin: 0 auto; padding: clamp(18px, 5vw, 48px); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px 12px; margin-bottom: clamp(16px, 3vw, 28px);
}
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; font-size: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--link); text-decoration: none; font: inherit; font-size: 15px; cursor: pointer;
}
.chip:hover { border-color: var(--link); }
.theme-btn { color: var(--text); }
.theme-btn .i-sun { display: none; }
.theme-btn[data-current="dark"] .i-sun { display: block; }
.theme-btn[data-current="dark"] .i-moon { display: none; }

/* ---------- Header ---------- */
.hero {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 28px;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.photo {
  display: block; width: 128px; height: 128px; flex: none; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line); background: var(--wash);
}
/* Larger screens: photo on the right, so the portrait faces the name and details */
@media (min-width: 720px) {
  .hero { align-items: center; }
  .photo { order: 2; width: 168px; height: 168px; }
}
.hero-text { flex: 1 1 260px; min-width: 0; }
h1 { margin: 0; font-size: clamp(32px, 6vw, 46px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.title { margin: 8px 0 0; font-size: clamp(17px, 2.6vw, 20px); font-weight: 500; }
.open { margin: 6px 0 0; font-size: 15px; }
.loc { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
/* Contact buttons sit on their own full-width row under the name and photo */
.contacts { order: 3; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }

.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px;
  margin: 20px 0 0; padding: 6px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px;
}
.notice a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---------- Sections ---------- */
.section { margin-top: clamp(32px, 6vw, 52px); }
h2 {
  margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--link);
}
.summary, .lead { margin: 0; max-width: 68ch; }
.lead { margin-bottom: 16px; }

.skills {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.skill { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.skill-name { margin: 0; font-size: 14px; font-weight: 500; }
.skill-detail { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.employer { margin-top: 28px; }
.employer:first-of-type { margin-top: 0; }
h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.emp-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.role { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 18px; }
.role-dates { flex: 0 0 168px; margin: 0; padding-top: 2px; font-size: 13px; color: var(--muted); }
.role-body { flex: 1 1 400px; min-width: 0; }
h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.role-place { margin: 0; font-size: 14px; color: var(--muted); }
.role ul { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.role li { margin: 4px 0; }
h3.group { margin: 28px 0 0; font-size: 17px; }
h3.group:first-of-type { margin-top: 0; }
.cred-id { margin: 6px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Contact form ---------- */
.form {
  display: flex; flex-direction: column; gap: 14px; max-width: 640px;
  padding: clamp(18px, 4vw, 28px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  position: relative;
}
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form input[type="text"], .form input[type="email"], .form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--input); border-radius: 8px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 400;
}
.form textarea { min-height: 120px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.status { margin: 0; min-height: 1.4em; font-size: 14px; }
.status.ok { color: var(--link); font-weight: 600; }
.status.error { color: var(--error); font-weight: 600; }
.btn {
  align-self: flex-start; min-height: 44px; padding: 0 22px; border: 0; border-radius: 8px;
  background: var(--btn-bg); color: var(--btn-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.form-note { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}

/* ---------- 404 page ---------- */
.nf { max-width: 640px; margin: 0 auto; padding: clamp(24px, 8vw, 96px) clamp(18px, 5vw, 48px); }
.nf-code { margin: 0; font-size: 13px; color: var(--link); letter-spacing: 0.06em; }
.nf h1 { margin-top: 8px; }
.nf p { max-width: 60ch; }

/* ---------- Print summary (hidden on screen) ---------- */
.print-summary { display: none; }

@media print {
  @page { size: A4; margin: 11mm 15mm; }
  html { color-scheme: light !important; }
  html, body { background: #FFFFFF !important; color: #0F172A !important; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .screen { display: none !important; }
  .print-summary { display: block; color: #0F172A; }

  .ps-head { padding-bottom: 12pt; border-bottom: 1.5pt solid #0F172A; }
  .ps-name { margin: 0; font-size: 24pt; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
  .ps-title { margin: 2pt 0 0; font-size: 12pt; font-weight: 500; }
  .ps-open { margin: 2pt 0 0; font-size: 10pt; }
  .ps-contact { margin: 4pt 0 0; font-size: 9pt; color: #475569; }

  .ps-sec { margin-top: 10pt; break-inside: avoid; }
  .ps-label { margin: 0 0 6pt; font-size: 9pt; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #0B6B53; }
  .ps-summary { margin: 0; font-size: 10.5pt; line-height: 1.45; }

  .ps-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4pt 20pt; margin: 0; padding: 0; list-style: none; }
  .ps-skill p { margin: 0; }
  .ps-skill-name { font-size: 10.5pt; font-weight: 600; }
  .ps-skill-detail { font-size: 9.5pt; color: #475569; }

  .ps-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .ps-table th { text-align: left; font-weight: 600; padding: 4pt 6pt 4pt 0; border-bottom: 1pt solid #0F172A; }
  .ps-table td { padding: 2.5pt 6pt 2.5pt 0; border-bottom: 0.75pt solid #CBD5E1; vertical-align: top; }
  .ps-emp { font-weight: 500; }
  .ps-yrs { text-align: right; white-space: nowrap; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9pt; padding-right: 0; }
  .ps-edu { margin: 4pt 0 0; font-size: 9.5pt; color: #475569; }
  .ps-edu strong { color: #0F172A; font-weight: 600; }

  .ps-box {
    margin-top: 10pt; padding: 7pt 12pt; border: 1pt solid #0B6B53; border-radius: 6pt;
    background: #E8F3EE; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid;
  }
  .ps-box p { margin: 0; font-size: 9.5pt; }
  .ps-box .ps-box-title { font-size: 11pt; font-weight: 600; }
}
