/* ==========================================================================
   hycard-resume.css — hyCard résumé / CV templates
   Owner: agent-d. Consumed by hycard-public.html (agent-c) and hycard.html
   (agent-b) résumé tab. Rendered by js/hycard/resume-render.js (window.HyCardResume).

   Root contract (must match tech.md):
     <div class="hc-resume hc-resume-<template>"> … </div>
   Resume templates: classic, luxury, cyberpunk, crypto, clean, modern, minimal.

   Conventions:
     - All classes prefixed hc-  (résumé-internal classes prefixed hc-r-).
     - Card theme vars: --hc-accent, --hc-bg, --hc-font, --hc-text, --hc-muted.
       Resume derives its own --hcr-* vars from those, with safe fallbacks so the
       sheet still reads well when printed on white.
     - Never hardcodes the Hypatia brand green; the single accent is always driven
       by --hc-accent (falling back to the global --accent theme var). Template
       palettes below are the template's own design identity, not brand colors.
     - Two display modes:
         .hc-resume            → full A4-style sheet (standalone / export / print)
         .hc-resume--embedded  → compact, on-card variant (inside the public card)
   ========================================================================== */

.hc-resume {
  /* Derived résumé vars (overridable by template + theme) */
  --hcr-accent: var(--hc-accent, var(--accent, #2b6cb0));
  --hcr-bg: var(--hc-bg, #ffffff);
  --hcr-text: var(--hc-text, #1a1f2b);
  --hcr-muted: var(--hc-muted, #5b6472);
  --hcr-line: rgba(0, 0, 0, .12);
  --hcr-font: var(--hc-font, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif);
  --hcr-head-font: var(--hcr-font);
  --hcr-maxw: 820px;
  --hcr-pad: 40px;
  --hcr-gap: 22px;
  --hcr-name-size: 30px;
  --hcr-h2-size: 13px;
  --hcr-radius: 0px;

  box-sizing: border-box;
  width: 100%;
  max-width: var(--hcr-maxw);
  margin: 0 auto;
  padding: var(--hcr-pad);
  background: var(--hcr-bg);
  color: var(--hcr-text);
  font-family: var(--hcr-font);
  font-size: 14px;
  line-height: 1.5;
  border-radius: var(--hcr-radius);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hc-resume *,
.hc-resume *::before,
.hc-resume *::after { box-sizing: border-box; }

/* ── Header / basics ── */
.hc-r-header { margin-bottom: var(--hcr-gap); }
.hc-r-name {
  margin: 0 0 4px;
  font-family: var(--hcr-head-font);
  font-size: var(--hcr-name-size);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--hcr-text);
}
.hc-r-label {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--hcr-accent);
}
.hc-r-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--hcr-muted);
}
.hc-r-contact li { display: inline-flex; align-items: center; gap: 5px; }
.hc-r-contact a { color: inherit; text-decoration: none; }
.hc-r-contact a:hover { text-decoration: underline; }
.hc-r-contact iconify-icon { font-size: 14px; color: var(--hcr-accent); }

/* ── Sections ── */
.hc-r-section { margin-bottom: var(--hcr-gap); }
.hc-r-section:last-child { margin-bottom: 0; }
.hc-r-h2 {
  margin: 0 0 10px;
  font-family: var(--hcr-head-font);
  font-size: var(--hcr-h2-size);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hcr-accent);
  border-bottom: 2px solid var(--hcr-line);
  padding-bottom: 5px;
}
.hc-r-summary { margin: 0; color: var(--hcr-text); }

/* ── Item (experience / education / project / etc.) ── */
.hc-r-item { margin-bottom: 14px; }
.hc-r-item:last-child { margin-bottom: 0; }
.hc-r-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}
.hc-r-item-title { font-size: 14.5px; font-weight: 700; color: var(--hcr-text); }
.hc-r-item-sub { font-size: 13.5px; font-weight: 600; color: var(--hcr-accent); }
.hc-r-item-meta {
  font-size: 12px;
  color: var(--hcr-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hc-r-item-loc { font-size: 12px; color: var(--hcr-muted); }
.hc-r-item-summary { margin: 4px 0 0; color: var(--hcr-text); }
.hc-r-bullets { margin: 6px 0 0; padding-left: 18px; }
.hc-r-bullets li { margin-bottom: 3px; }

/* ── Skills ── */
.hc-r-skills { display: flex; flex-direction: column; gap: 8px; }
.hc-r-skill { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.hc-r-skill-name { font-weight: 700; }
.hc-r-skill-level { font-size: 12px; color: var(--hcr-muted); }
.hc-r-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-r-tag {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hcr-accent);
  background: color-mix(in srgb, var(--hcr-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--hcr-accent) 30%, transparent);
  border-radius: 999px;
}

/* ── Two-column grids for compact sections ── */
.hc-r-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
}
.hc-r-kv { display: flex; justify-content: space-between; gap: 12px; }
.hc-r-kv b { font-weight: 700; }
.hc-r-kv span { color: var(--hcr-muted); font-size: 12.5px; }
.hc-r-link { color: var(--hcr-accent); text-decoration: none; word-break: break-word; }
.hc-r-link:hover { text-decoration: underline; }

.hc-r-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--hcr-muted);
  font-style: italic;
}

/* ==========================================================================
   TEMPLATE: classic — serif, conservative, ATS-safe
   ========================================================================== */
.hc-resume-classic {
  --hcr-accent: var(--hc-accent, #1f3a5f);
  --hcr-font: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --hcr-head-font: Georgia, "Times New Roman", serif;
  --hcr-line: rgba(0, 0, 0, .25);
}
.hc-resume-classic .hc-r-name { letter-spacing: 0; }
.hc-resume-classic .hc-r-h2 { letter-spacing: .1em; }

/* ==========================================================================
   TEMPLATE: luxury — cream + gold, refined serif headings
   ========================================================================== */
.hc-resume-luxury {
  --hcr-accent: var(--hc-accent, #9a7b2f);
  --hcr-bg: var(--hc-bg, #fbf8f1);
  --hcr-text: var(--hc-text, #2a2419);
  --hcr-muted: var(--hc-muted, #877b5f);
  --hcr-line: rgba(154, 123, 47, .35);
  --hcr-font: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --hcr-head-font: "Cormorant Garamond", Georgia, serif;
  --hcr-name-size: 36px;
  --hcr-radius: 4px;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(154, 123, 47, .25);
}
.hc-resume-luxury .hc-r-name { font-weight: 700; letter-spacing: .01em; }
.hc-resume-luxury .hc-r-h2 {
  border-bottom: 1px solid var(--hcr-line);
  font-weight: 600;
}
.hc-resume-luxury .hc-r-tag {
  border-radius: 2px;
  background: color-mix(in srgb, var(--hcr-accent) 10%, transparent);
}

/* ==========================================================================
   TEMPLATE: cyberpunk — dark, neon accent, mono headings
   ========================================================================== */
.hc-resume-cyberpunk {
  --hcr-accent: var(--hc-accent, #00e5ff);
  --hcr-bg: var(--hc-bg, #0b0f1a);
  --hcr-text: var(--hc-text, #e6f7ff);
  --hcr-muted: var(--hc-muted, #7da2b8);
  --hcr-line: rgba(0, 229, 255, .3);
  --hcr-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --hcr-head-font: "Space Mono", "JetBrains Mono", ui-monospace, monospace;
  --hcr-radius: 6px;
}
.hc-resume-cyberpunk .hc-r-name {
  text-shadow: 0 0 14px color-mix(in srgb, var(--hcr-accent) 55%, transparent);
}
.hc-resume-cyberpunk .hc-r-h2 {
  border-bottom: 1px solid var(--hcr-line);
  text-shadow: 0 0 8px color-mix(in srgb, var(--hcr-accent) 45%, transparent);
}
.hc-resume-cyberpunk .hc-r-tag {
  background: color-mix(in srgb, var(--hcr-accent) 14%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--hcr-accent) 25%, transparent);
}

/* ==========================================================================
   TEMPLATE: crypto — deep slate, gradient accent rule, mono numerics
   ========================================================================== */
.hc-resume-crypto {
  --hcr-accent: var(--hc-accent, #7c5cff);
  --hcr-bg: var(--hc-bg, #11131c);
  --hcr-text: var(--hc-text, #eef0ff);
  --hcr-muted: var(--hc-muted, #9aa0c0);
  --hcr-line: rgba(124, 92, 255, .35);
  --hcr-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --hcr-head-font: "Sora", "Inter", system-ui, sans-serif;
  --hcr-radius: 10px;
}
.hc-resume-crypto .hc-r-h2 {
  border: 0;
  position: relative;
  padding-bottom: 8px;
}
.hc-resume-crypto .hc-r-h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 56px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--hcr-accent), transparent);
}
.hc-resume-crypto .hc-r-item-meta { font-family: ui-monospace, "SF Mono", monospace; }

/* ==========================================================================
   TEMPLATE: clean — neutral, airy, sans-serif (default-ish)
   ========================================================================== */
.hc-resume-clean {
  --hcr-accent: var(--hc-accent, #2563eb);
  --hcr-line: rgba(0, 0, 0, .1);
  --hcr-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hcr-pad: 44px;
}
.hc-resume-clean .hc-r-h2 {
  border: 0;
  color: var(--hcr-muted);
  font-size: 11.5px;
  letter-spacing: .18em;
}

/* ==========================================================================
   TEMPLATE: modern — accent sidebar band on the name, bold sans
   ========================================================================== */
.hc-resume-modern {
  --hcr-accent: var(--hc-accent, #0ea5a4);
  --hcr-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --hcr-head-font: "Sora", "Inter", system-ui, sans-serif;
  --hcr-name-size: 32px;
}
.hc-resume-modern .hc-r-header {
  padding-left: 16px;
  border-left: 5px solid var(--hcr-accent);
}
.hc-resume-modern .hc-r-h2 {
  border-bottom: 0;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  color: #fff;
  background: var(--hcr-accent);
  letter-spacing: .1em;
}

/* ==========================================================================
   TEMPLATE: minimal — type-only, hairline rules, maximum whitespace
   ========================================================================== */
.hc-resume-minimal {
  --hcr-accent: var(--hc-accent, #111111);
  --hcr-muted: var(--hc-muted, #777777);
  --hcr-line: rgba(0, 0, 0, .14);
  --hcr-font: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --hcr-name-size: 26px;
  --hcr-gap: 26px;
}
.hc-resume-minimal .hc-r-label { color: var(--hcr-muted); font-weight: 500; }
.hc-resume-minimal .hc-r-h2 {
  border: 0;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--hcr-muted);
}
.hc-resume-minimal .hc-r-item-sub { color: var(--hcr-text); }
.hc-resume-minimal .hc-r-tag {
  background: transparent;
  border-color: var(--hcr-line);
  color: var(--hcr-text);
}

/* ==========================================================================
   EMBEDDED (on-card) MODE — compact résumé preview inside the public card
   ========================================================================== */
.hc-resume--embedded {
  --hcr-pad: 18px;
  --hcr-gap: 16px;
  --hcr-name-size: 22px;
  --hcr-maxw: 100%;
  font-size: 13px;
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--hcr-line);
}
.hc-resume--embedded .hc-r-h2 { font-size: 11px; }
.hc-resume--embedded .hc-r-grid { grid-template-columns: 1fr; }

/* ==========================================================================
   RESPONSIVE — phone breakpoint (mobile-first; no horizontal overflow)
   ========================================================================== */
@media (max-width: 640px) {
  .hc-resume {
    --hcr-pad: 22px;
    --hcr-name-size: 24px;
    font-size: 13.5px;
  }
  .hc-r-grid { grid-template-columns: 1fr; }
  .hc-r-item-head { flex-direction: column; gap: 2px; }
  .hc-r-item-meta { white-space: normal; }
}

/* ==========================================================================
   PRINT — force a clean, ink-friendly, light document regardless of template
   theme so PDF/print output is legible. Used by the client print-to-PDF path.
   ========================================================================== */
@media print {
  /* Neutralize dark template palettes for paper. */
  .hc-resume,
  .hc-resume-cyberpunk,
  .hc-resume-crypto {
    --hcr-bg: #ffffff;
    --hcr-text: #111111;
    --hcr-muted: #555555;
    --hcr-line: rgba(0, 0, 0, .25);
    box-shadow: none !important;
    text-shadow: none !important;
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
  }
  .hc-resume * { text-shadow: none !important; box-shadow: none !important; }
  .hc-resume-modern .hc-r-h2 { color: var(--hcr-accent); background: transparent; border-bottom: 2px solid var(--hcr-line); padding: 0 0 5px; }
  .hc-r-section { page-break-inside: avoid; }
  .hc-r-item { page-break-inside: avoid; }
  .hc-r-h2 { page-break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Dedicated print page sizing applied to the standalone export window. */
.hc-resume--print-page {
  --hcr-bg: #ffffff;
  --hcr-text: #111111;
  --hcr-muted: #555555;
  box-shadow: none;
}
@page { margin: 14mm; }
