/* Resume Studio. Uses the site's theme tokens so light and dark both work. */

/* The studio replaces the old resume blocks. Only the header, the studio and the credentials wall stay. */
article.resume.studio-on > *:not(header):not(#resume-studio):not(section.certificates) { display: none !important; }

.rs { --rs-paper: #fffdf6; --rs-line: var(--border-subtle); display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; margin-top: 8px; }
.rs > *, .cv-stage > *, .dt > * { min-width: 0; }
body[data-theme="dark"] .rs { --rs-paper: #1d2036; }

.rs-top { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-end; justify-content: space-between; }
.rs-lede { margin: 0 0 6px; font: 800 clamp(20px, 2.6vw, 28px)/1.25 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); max-width: 30ch; }
.rs-sub { margin: 0; color: var(--ink-secondary); font-size: 15px; max-width: 52ch; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rs-h { margin: 0 0 18px; font: 800 20px/1.2 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); }
.rs-sec-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.rs-sec-head .rs-h { margin: 0; }

/* ---------- 1. paper sheet with margin notes ---------- */
.cv-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.cv-sheet {
  position: relative; background: var(--rs-paper); color: var(--ink-primary);
  border: 1.5px solid var(--border-strong); border-radius: 6px; box-shadow: var(--shadow-offset);
  padding: clamp(20px, 4vw, 44px); font-size: 14.5px; line-height: 1.55; max-width: 760px;
  transform: rotate(-0.4deg);
}
.cv-tape { position: absolute; top: -12px; left: 50%; width: 96px; height: 24px; transform: translateX(-50%) rotate(-2deg); background: var(--tape-bg, rgba(253, 230, 138, 0.7)); }
.cv-name { margin: 0; font: 800 26px/1.1 'Plus Jakarta Sans', sans-serif; }
.cv-contact { margin: 4px 0 18px; font-size: 12.5px; color: var(--ink-secondary); overflow-wrap: anywhere; }
.cv-h { margin: 20px 0 6px; padding-bottom: 3px; border-bottom: 1.5px solid var(--border-strong); font: 800 15px/1.2 'Plus Jakarta Sans', sans-serif; }
.cv-sheet p { margin: 0 0 6px; }
.cv-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px !important; }
.cv-row span { color: var(--ink-secondary); font-size: 13px; white-space: nowrap; }
.cv-sub { color: var(--ink-secondary); font-size: 13px; font-style: italic; }
.cv-b { padding-left: 14px; position: relative; }
.cv-b::before { content: ''; position: absolute; left: 2px; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-muted); }

.cv-mark {
  display: inline !important; width: auto !important; line-height: inherit; font: inherit; color: inherit; padding: 0 2px; margin: 0; border: 0; cursor: pointer; text-align: inherit;
  background: linear-gradient(transparent 55%, var(--tint-3, #fde68a) 55%); border-radius: 2px;
  transition: background-size 0.2s ease, box-shadow 0.2s ease;
}
body[data-theme="dark"] .cv-mark { background: linear-gradient(transparent 55%, rgba(165, 176, 255, 0.35) 55%); }
.cv-mark:hover, .cv-mark:focus-visible { background: var(--tint-3, #fde68a); }
body[data-theme="dark"] .cv-mark:hover, body[data-theme="dark"] .cv-mark:focus-visible { background: rgba(165, 176, 255, 0.4); }
.cv-mark:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 2px; }

.cv-notes { position: relative; }
.cv-note {
  font: 700 21px/1.15 'Caveat', cursive; color: var(--accent-text, var(--accent-purple)); margin: 0;
  /* Narrow screens: notes are written under the sheet and shown only for the active highlight. */
  display: none; padding: 10px 4px 0;
}
.cv-note.is-on { display: block; }

@media (min-width: 980px) {
  .cv-stage { grid-template-columns: minmax(0, 760px) minmax(180px, 1fr); gap: 0 48px; }
  .cv-notes { min-height: 100%; }
  .cv-note {
    display: block; position: absolute; left: 0; width: 100%; max-width: 230px; padding: 0 0 0 16px;
    color: var(--ink-secondary); transform: translateX(-6px) rotate(-1deg); transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    border-left: 2px dashed var(--border-subtle);
  }
  .cv-note.is-on { color: var(--accent-text, var(--accent-purple)); transform: none; border-left-color: var(--accent-purple); }
}

/* ---------- 2. timeline ---------- */
.lens { display: inline-flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; align-items: center; }
.lens legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lens-opt { position: relative; cursor: pointer; }
.lens-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lens-opt span {
  display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border-subtle);
  font: 700 13px 'Plus Jakarta Sans', sans-serif; color: var(--ink-secondary); background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lens-opt:hover span { border-color: var(--border-strong); color: var(--ink-primary); }
.lens-opt input:checked + span { background: var(--accent-pill-bg); color: var(--accent-pill-text); border-color: var(--border-strong); box-shadow: 0 2px 0 var(--border-strong); }
.lens-opt input:focus-visible + span { outline: 3px solid var(--accent-purple); outline-offset: 2px; }
.lens-note { min-height: 1.5em; margin: 10px 0 14px; font-size: 14px; color: var(--ink-secondary); }

/* The trail: a pen-drawn path, notes taped alongside it. */
.trail { position: relative; width: 100%; min-height: 400px; }
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trail-marks { position: absolute; inset: 0; pointer-events: none; }
.tr-main { fill: none; stroke: var(--ink-primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tr-branch { fill: none; stroke-width: 3; stroke-linecap: round; transition: opacity 0.2s ease; }
.tr-proj { stroke: var(--accent-purple); }
.tr-work { stroke: #d08a1c; }
body[data-theme="dark"] .tr-work { stroke: #f2b84b; }
.tr-branch.is-dim { opacity: 0.2; }
.tr-branch.is-selected { stroke-width: 5; }
.tr-conn { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0; transition: opacity 0.35s ease; }
.tr-conn.is-drawn { opacity: 0.7; }
.tr-dot { fill: var(--surface-card); stroke: var(--ink-primary); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tr-dot.is-drawn { transform: scale(1); }
.tr-dot.tr-proj { fill: var(--accent-purple); }
.tr-dot.tr-work { fill: #f6c75a; }
.tr-pen { fill: var(--ink-primary); transition: opacity 0.2s ease; }
.tr-pen rect { fill: var(--accent-purple); }

.tl-year, .tl-pin {
  position: absolute; transform: translateX(-50%) rotate(-3deg); padding: 0 10px;
  font: 700 24px/1.2 'Caveat', cursive; color: var(--ink-primary); background: var(--surface-card); border-radius: 6px;
  opacity: 0; transition: opacity 0.4s ease;
}
.tl-year.is-drawn, .tl-pin.is-drawn { opacity: 1; }
.tl-pin { color: var(--accent-text, var(--accent-purple)); font-size: 28px; }
.tl-pin::before { content: ''; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; background: var(--accent-purple); }

.trail-notes { list-style: none; margin: 0; padding: 0; }
.tl-item {
  position: absolute; min-height: 60px; opacity: 0; transform: translateY(10px) rotate(var(--tilt, 0deg));
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tl-item:nth-child(3n+1) { --tilt: -0.8deg; }
.tl-item:nth-child(3n+2) { --tilt: 0.7deg; }
.tl-item.is-drawn { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
.tl-item.is-drawn.is-dim { opacity: 0.3; }
.tl-hit {
  position: relative; display: block; width: 100%; min-height: 60px; padding: 12px 14px 10px; margin: 0; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink-primary); background: var(--tint-1, #e0e7ff); border: 1.5px solid var(--border-strong); border-radius: 6px;
  box-shadow: 3px 4px 0 var(--border-strong); transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.tl-proj .tl-hit { background: var(--tint-2, #fde2e4); }
.tl-work .tl-hit { background: var(--tint-3, #fde68a); }
.tl-win .tl-hit { background: var(--tint-4, #d1fae5); }
.tl-edu .tl-hit { background: var(--rs-paper); }
body[data-theme="dark"] .tl-hit { background: #2a2f55; color: #eef0ff; }
body[data-theme="dark"] .tl-proj .tl-hit { background: #3a2a46; }
body[data-theme="dark"] .tl-work .tl-hit { background: #3d3624; }
body[data-theme="dark"] .tl-win .tl-hit { background: #1f3a33; }
body[data-theme="dark"] .tl-edu .tl-hit { background: #1d2036; }
.tl-item.approx .tl-hit { border-style: dashed; }
.tl-tape { position: absolute; top: -9px; left: 18px; width: 46px; height: 16px; transform: rotate(-3deg); background: var(--tape-bg, rgba(253, 230, 138, 0.7)); }
.tl-item.is-left .tl-tape { left: auto; right: 18px; transform: rotate(3deg); }
.tl-when { display: block; font: 700 19px/1 'Caveat', cursive; color: var(--ink-secondary); }
body[data-theme="dark"] .tl-when { color: #c9cdf3; }
.tl-text { display: block; margin-top: 3px; font: 700 14.5px/1.3 'Plus Jakarta Sans', sans-serif; }
.tl-hit:hover, .tl-item.is-peek .tl-hit { box-shadow: 5px 7px 0 var(--border-strong); transform: translate(-1px, -2px); }
.tl-hit:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 3px; }
.tl-item.is-selected .tl-hit { background: var(--accent-purple) !important; color: #fff; }
.tl-item.is-selected .tl-when { color: #e6e3ff; }
.tl-item.is-lit .tl-hit { outline: 3px solid var(--accent-purple); outline-offset: 3px; }
.is-left .tl-hit { text-align: right; }

.dt { scroll-margin-top: 96px; }
.dt-head { display: grid; gap: 4px; justify-items: start; }
.dt-back { margin-top: 8px; padding: 6px 12px; border: 1.5px dashed var(--border-subtle); border-radius: 999px; background: transparent; cursor: pointer; font: 600 13px 'Plus Jakarta Sans', sans-serif; color: var(--ink-secondary); }
.dt-back:hover { color: var(--ink-primary); border-color: var(--border-strong); }
.dt-back:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 2px; }

.tl-hint { margin: 10px 2px 0; font-size: 13px; color: var(--ink-muted); }
.also-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.also-list li a, .also-list li span { display: inline-block; padding: 6px 12px; border: 1.5px dashed var(--border-subtle); border-radius: 999px; font: 600 13px 'Plus Jakarta Sans', sans-serif; color: var(--ink-secondary); text-decoration: none; }
.also-list li a:hover { color: var(--ink-primary); border-color: var(--border-strong); }
.also-list li a:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 2px; }

/* ---------- 3. detail pane ---------- */
.dt { margin-top: 22px; padding: clamp(18px, 3vw, 30px); border: 1.5px solid var(--border-strong); border-radius: 16px; background: var(--surface-card); box-shadow: var(--shadow-offset); display: grid; gap: 16px; }
.dt-title { margin: 0; font: 800 20px/1.25 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); }
.dt-meta, .dt-facts { margin: 4px 0 0; color: var(--ink-secondary); font-size: 14px; }
.dt-facts { font-weight: 700; color: var(--ink-primary); }
.dt-bullets { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-secondary); font-size: 14.5px; line-height: 1.6; max-width: 80ch; }
.dt-stack { margin: 0; font-size: 13.5px; color: var(--ink-secondary); }
.dt-stack span { font-weight: 700; color: var(--ink-primary); margin-right: 4px; }
.dt-links { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.dt-links a { padding: 7px 14px; border: 1.5px solid var(--border-strong); border-radius: 999px; font: 700 13px 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); text-decoration: none; box-shadow: 0 2px 0 var(--border-strong); }
.dt-links a:hover { background: var(--accent-pill-bg); color: var(--accent-pill-text); }
.dt-links a:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 2px; }

.st { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.st li { min-width: 140px; }
.st-v { display: block; font: 800 clamp(30px, 4vw, 40px)/1 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.st-v > span, .st-v small { display: inline !important; }
.st-v small { font-size: 0.5em; margin-left: 2px; color: var(--ink-secondary); }
.st-l { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-secondary); }
.st-bar { display: block; margin-top: 8px; height: 6px; border-radius: 3px; background: var(--border-subtle); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: var(--w); background: var(--accent-purple); border-radius: 3px; transform-origin: left; animation: rsGrow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rsGrow { from { transform: scaleX(0); } }

/* pipeline */
.fl { display: grid; gap: 12px; }
.fl-line { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 0; align-items: center; }
.fl-step {
  position: relative; padding: 7px 12px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--rs-paper);
  font: 600 13px 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); margin-right: 22px;
  animation: rsStep 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i) * 70ms);
}
.fl-step:not(:last-child)::after { content: ''; position: absolute; left: 100%; top: 50%; width: 22px; border-top: 1.5px solid var(--border-strong); }
.fl-step:last-child { margin-right: 0; }
@keyframes rsStep { from { opacity: 0; transform: translateY(6px); } }
.fl-fork { display: grid; gap: 8px; padding-left: 14px; border-left: 2px solid var(--accent-purple); }
.fl-fork-label { margin: 0; font: 700 13px 'Plus Jakarta Sans', sans-serif; color: var(--accent-text, var(--accent-purple)); }
.fl-note { margin: 0; font-size: 13px; color: var(--ink-muted); max-width: 70ch; }

/* ---------- 4. skills ---------- */
.sk { display: grid; gap: 18px; }
.sk-group { display: grid; gap: 8px; }
.sk-label { margin: 0; font: 700 14px 'Plus Jakarta Sans', sans-serif; color: var(--ink-secondary); }
.sk-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sk-chip {
  padding: 8px 14px; min-height: 36px; border: 1.5px solid var(--border-subtle); border-radius: 999px; background: var(--surface-card);
  font: 600 13.5px 'Plus Jakarta Sans', sans-serif; color: var(--ink-primary); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}
.sk-chip:hover { border-color: var(--border-strong); background: var(--accent-pill-bg); color: var(--accent-pill-text); }
.sk-chip[aria-pressed="true"] { background: var(--accent-purple); border-color: var(--border-strong); color: #fff; box-shadow: 0 2px 0 var(--border-strong); }
.sk-chip.is-off { opacity: 0.4; }
.sk-chip:focus-visible { outline: 3px solid var(--accent-purple); outline-offset: 2px; }
.sk-status { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--ink-secondary); }

@media (max-width: 640px) {
  .rs { gap: 40px; }
  .cv-sheet { transform: none; font-size: 14px; }
  .cv-row { flex-direction: column; gap: 0; }
  .cv-row span { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-item, .tr-dot, .tr-conn, .tl-year, .tl-pin, .tl-hit, .cv-note, .fl-step, .st-bar i { transition: none !important; animation: none !important; }
}

/* Print: the Resume tab prints as the annotated paper only (one clean sheet, no site chrome). */
@page { size: A4; margin: 10mm; }
@media print {
  html, body { background: #fff !important; }
  canvas, .sidebar, .navbar, .theme-switcher, #ai-chat-btn, #ai-chat-panel, .notebook-ruler, .modal,
  .project-modal-container, .toast-container, .craft-pal, .craft-pal-toast, .craft-footer,
  .rs-top, .rs-sec:not(:first-of-type), #resume-credentials, .cv-notes, .cv-note,
  .resume > header { display: none !important; }
  main, .main-content, .resume, .rs { margin: 0 !important; padding: 0 !important; max-width: none !important; background: #fff !important; box-shadow: none !important; border: 0 !important; }
  .cv-sheet { box-shadow: none !important; border: 0 !important; transform: none !important; margin: 0 auto !important; }
  .cv-tape { display: none !important; }
  .cv-sheet { zoom: .82; }
  .cv-mark { background: none !important; border: 0 !important; color: #000 !important; text-decoration: none !important; }
}
