/* =====================================================================
   PAULINE LU — One-page resume
   Sticky identity sidebar (left) + concise stacked sections (right)
   ===================================================================== */

/* ---------- TOKENS ---------- */
:root {
  --paper:    #F2F0E8;
  --paper-2:  #E9E5D9;
  --ink-dark: #16160F;
  --ink:      #18180F;
  --ink-2:    #45443B;
  --ink-soft: #8A887C;
  --line:     rgba(24,24,15,0.16);
  --line-2:   rgba(24,24,15,0.30);

  --accent:     #5C6B38;
  --accent-2:   #47532A;
  --on-accent:  #F2F0E8;

  --side-bg: var(--paper-2);
  --side-fg: var(--ink);
  --side-line: var(--line);
  --side-soft: var(--ink-soft);

  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --side-w: 40%;
}

html[data-accent="olive"] { --accent:#5C6B38; --accent-2:#47532A; --on-accent:#F2F0E8; }
html[data-accent="mono"]  { --accent:#18180F; --accent-2:#000000; --on-accent:#F2F0E8; }
html[data-accent="clay"]  { --accent:#AC5C36; --accent-2:#8E4928; --on-accent:#F6F1EA; }

html[data-font="helvetica"] { --font-display:"Helvetica Neue",Helvetica,Arial,sans-serif; }
html[data-font="archivo"]   { --font-display:"Archivo",Helvetica,Arial,sans-serif; }
html[data-font="grotesk"]   { --font-display:"Space Grotesk",Helvetica,Arial,sans-serif; }

/* dark sidebar */
html[data-side="dark"] { --side-bg:#16160F; --side-fg:#F2F0E8; --side-line:rgba(242,240,232,0.18); --side-soft:rgba(242,240,232,0.55); }

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: none;
}
@media (max-width: 920px){ body { cursor: auto; } }
img { display:block; max-width:100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

/* =====================================================================
   CURSOR
   ===================================================================== */
.cursor {
  position: fixed; top:0; left:0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%); transition: width .2s, height .2s, opacity .2s;
}
.cursor.ring { width: 34px; height: 34px; background: transparent; border: 1px solid var(--accent); }
.cursor.click { width: 7px; height: 7px; }
@media (max-width: 920px){ .cursor{ display:none; } }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.resume { display: grid; grid-template-columns: var(--side-w) 1fr; align-items: start; }

/* ---------- SIDEBAR ---------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: var(--side-fg);
  border-right: 1px solid var(--side-line);
  padding: clamp(24px, 2.6vw, 40px);
  display: flex; flex-direction: column; gap: clamp(12px, 1.7vw, 22px);
  scrollbar-width: thin;
}
.side-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--side-soft); }
.side-id { display: flex; align-items: center; gap: 8px; }
.side-id .dot { width: 11px; height: 11px; background: var(--accent); display: inline-block; }

.side-name {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.045em; line-height: 0.86;
  font-size: clamp(30px, 3.2vw, 50px);
}
.side-name .ln { display: block; }
.side-tagline {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(15px, 1.3vw, 19px); line-height: 1.25; max-width: 26ch; color: var(--side-fg);
}
.side-tagline b { color: var(--accent); font-weight: 700; }

.side-head { display: flex; align-items: center; gap: clamp(16px, 1.8vw, 26px); }
.side-intro { min-width: 0; display: flex; flex-direction: column; gap: clamp(8px, 1vw, 14px); }
.side-photo {
  position: relative; overflow: hidden; border: 1px solid var(--side-line);
  flex: 0 0 auto; width: clamp(118px, 12vw, 160px); aspect-ratio: 1 / 1;
  background: var(--paper-2);
}
.side-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
.side-photo .ptag {
  position: absolute; left: 10px; bottom: 10px; background: var(--paper); color: var(--ink);
  padding: 5px 9px; border-radius: 2px;
}

.side-facts { display: grid; gap: 0; border-top: 1px solid var(--side-line); }
.side-facts .f { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--side-line); font-size: 12.5px; align-items: baseline; }
.side-facts .fk { color: var(--side-soft); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.side-facts .fv { font-weight: 600; text-align: right; letter-spacing: -0.01em; }

.side-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; padding-top: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent); padding: 13px 20px; border-radius: 2px; border: 0; cursor: pointer;
  transition: background .2s, gap .2s;
}
.btn:hover { background: var(--accent-2); gap: 15px; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.side-links { display: flex; gap: 16px; }
.side-links a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-soft); transition: color .2s; position: relative; }
.side-links a:hover { color: var(--accent); }

/* ---------- RIGHT COLUMN ---------- */
.main-col { min-width: 0; }
.sec { padding: clamp(30px, 3.4vw, 52px) clamp(28px, 3.4vw, 60px); border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: clamp(18px, 2vw, 28px); }
.sec-head .idx { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; }
.sec-head h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; font-size: clamp(24px, 3vw, 38px); line-height: 0.95; }
.sec-head .note { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

/* ABOUT */
.statement { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.08; }
.statement .muted { color: var(--ink-soft); }
.about-sub { margin-top: 18px; max-width: 62ch; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.about-sub strong { color: var(--accent); font-weight: 700; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 22px 16px 4px 0; border-left: 1px solid var(--line); padding-left: 18px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .num { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.04em; line-height: 0.9; font-size: clamp(32px, 4vw, 56px); color: var(--accent); }
.stat .lab { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); line-height: 1.4; }

/* ROLES */
.roles-wrap { display: grid; grid-template-columns: 200px 1fr; gap: clamp(20px, 2.4vw, 40px); align-items: stretch; }
.role-tabs { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.role-tab {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 15px 2px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0;
  cursor: pointer; text-align: left; font-family: var(--font-display); width: 100%; color: var(--ink);
  transition: padding-left .25s, color .2s;
}
.role-tab .n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.role-tab .t { font-weight: 700; font-size: clamp(17px, 1.8vw, 22px); letter-spacing: -0.02em; }
.role-tab .chev { font-family: var(--font-mono); color: var(--ink-soft); opacity: 0; transition: opacity .2s; }
.role-tab:hover { padding-left: 10px; }
.role-tab.active { padding-left: 10px; }
.role-tab.active .t, .role-tab.active .n, .role-tab.active .chev { color: var(--accent); }
.role-tab.active .chev { opacity: 1; }

.role-panel { border: 1px solid var(--line); background: var(--paper-2); padding: clamp(22px, 2.4vw, 36px); position: relative; min-height: 280px; }
.role-panel .glyph { position: absolute; top: 24px; right: 24px; width: 48px; height: 48px; opacity: 0.55; color: var(--accent); }
.role-panel .glyph svg { width: 100%; height: 100%; }
.role-display { opacity: 1; }
.role-display .pre { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.role-display h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; font-size: clamp(28px, 3.4vw, 46px); line-height: 0.95; }
.role-display .desc { margin-top: 12px; font-size: clamp(14px, 1.4vw, 17px); color: var(--ink-2); line-height: 1.45; max-width: 42ch; }
.role-exp { margin-top: 18px; border-top: 1px solid var(--line); }
.role-exp .x { padding: 15px 0; border-bottom: 1px solid var(--line); position: relative; }
.role-exp .x:last-child { border-bottom: 0; }
.role-exp .x.has-prev { cursor: help; }
.role-exp .xtop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.role-exp .org { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.role-exp .date { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.role-exp .role-now { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 7px 0 5px; }
.role-exp .rn-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.role-exp .rn-tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.role-exp .xd { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; }

/* progression hint + hover popup */
.role-exp .prev-hint { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--ink-soft); transition: color .2s; }
.role-exp .prev-hint .ph-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; transition: opacity .2s; }
.role-exp .x.has-prev:hover .prev-hint,
.role-exp .x.has-prev:focus-within .prev-hint,
.role-exp .x.has-prev.open .prev-hint { color: var(--accent); }
.role-exp .x.has-prev:hover .ph-dot,
.role-exp .x.has-prev:focus-within .ph-dot,
.role-exp .x.has-prev.open .ph-dot { opacity: 1; }

.prev-pop {
  position: absolute; left: 0; right: 0; top: calc(100% - 4px); z-index: 40;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 3px;
  box-shadow: 0 20px 44px -14px rgba(20,20,12,0.45);
  padding: 14px 16px 15px; display: grid; gap: 13px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  pointer-events: none;
}
.prev-pop::before {
  content: ""; position: absolute; left: 22px; top: -5px; width: 9px; height: 9px;
  background: var(--paper); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  transform: rotate(45deg);
}
.role-exp .x.has-prev:hover .prev-pop,
.role-exp .x.has-prev:focus-within .prev-pop,
.role-exp .x.has-prev.open .prev-pop {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.prev-pop .pp-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.prev-pop .pp-step { display: grid; gap: 4px; }
.prev-pop .pp-step + .pp-step { border-top: 1px solid var(--line); padding-top: 11px; }
.prev-pop .pp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.prev-pop .pp-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.prev-pop .pp-date { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.prev-pop .pp-desc { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* progression popup close button */
.pp-close {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 0; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--ink-soft); padding: 4px 8px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  pointer-events: auto; z-index: 50;
}
.pp-close:hover { color: var(--accent); }

/* WRITING */
.writing-intro { max-width: 64ch; font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-bottom: 14px; }
.writing-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.articles { border-top: 1px solid var(--ink); }
.article { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); transition: padding-left .25s; }
.article:hover { padding-left: 10px; }
.article .tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.article h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(18px, 2vw, 24px); line-height: 1.1; margin: 6px 0 5px; }
.article p { color: var(--ink-2); font-size: 14px; line-height: 1.5; max-width: 70ch; }
.article .read { display: inline-block; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.article:hover .read { color: var(--accent); }

/* TOOLBOX */
.toolbox-cats { display: grid; gap: clamp(22px, 2.6vw, 36px); }
.cat { display: grid; grid-template-columns: 190px 1fr; gap: clamp(16px, 2vw, 32px); align-items: start; border-top: 1px solid var(--ink); padding-top: 18px; }
.cat-head { display: flex; flex-direction: column; gap: 10px; }
.cat-head .glyph { width: 32px; height: 32px; color: var(--accent); }
.cat-head .glyph svg { width: 100%; height: 100%; }
.cat-head h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.02em; line-height: 1; }
.cat-head .hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.skill {
  font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line-2); padding: 8px 13px; border-radius: 2px; cursor: pointer;
  background: transparent; color: var(--ink); transition: background .18s, color .18s, border-color .18s, transform .18s;
  display: inline-flex; align-items: center; gap: 8px;
}
.skill .has { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; }
.skill:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-2px); }
.skill:hover .has { background: var(--on-accent); opacity: 1; }

/* RIGHT-COLUMN FOOTER */
.col-foot { padding: 20px clamp(28px, 3.4vw, 60px); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.col-foot p { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.active { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(20,20,12,0.55); }
.modal-card { position: relative; z-index: 1; background: var(--paper); width: min(640px, 100%); max-height: 84vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 3px; }
.modal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px clamp(22px,3vw,34px) 16px; border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--paper); }
.modal-head h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(22px,3vw,30px); }
.modal-close { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 6px clamp(22px,3vw,34px) 26px; }
.proj { padding: 20px 0; border-bottom: 1px solid var(--line); }
.proj:last-child { border-bottom: 0; }
.proj h4 { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 7px; }
.proj h4::before { content: "→ "; color: var(--accent); }
.proj p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 920px){
  .resume { grid-template-columns: 1fr; }
  .side { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--side-line); }
  .side-cta { margin-top: 8px; }
  .roles-wrap { grid-template-columns: 1fr; }
  .role-tabs { flex-direction: row; flex-wrap: wrap; border-top: 0; gap: 0; }
  .role-tab { border: 1px solid var(--line); padding: 12px 14px; }
  .cat { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px){
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .stat:first-child, .stat:nth-child(2) { border-top: 0; }
}

/* counters: respect reduced motion handled in JS */
@media (prefers-reduced-motion: reduce){ .cursor { display: none !important; } }
