/* =========================================================
   Krishna Balaga — Resume CSS
   Visual celebration, humble voice, 2-page A4, print-ready
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fraunces:ital,wght@0,400;0,600;0,800;1,400&display=swap');

:root {
  --bg:       #F8F7F4;   /* warm off-white */
  --ink:      #0E1A2B;   /* deep navy (primary text) */
  --ink-2:    #2B3A55;   /* secondary navy */
  --muted:    #6B7280;   /* cool gray */
  --accent:   #1E3A5F;   /* enterprise navy */
  --warm:     #D97757;   /* terracotta (Anthropic-adjacent) */
  --warm-deep:#7A3A1D;
  --rule:     #E5E3DD;   /* hairline gray-beige */
  --card:     #FFFFFF;
  --shadow:   0 1px 2px rgba(14,26,43,0.04), 0 4px 12px rgba(14,26,43,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10pt;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Page ---------- */
.page {
  width: 210mm;
  padding: 8mm 7mm 6mm 7mm;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

/* Let content flow naturally across pages — Chrome paginates based on overflow */

/* Keep logical blocks together when possible */
.hero, .dashboard, .section-title,
.ship-card, .metric, .recog-col li {
  break-inside: avoid;
}

/* Timeline: header+first bullet stay together, rest can flow */
.node .icon-box, .node .year, .node h4, .node .role-sub {
  break-inside: avoid;
  break-after: avoid;
}

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: 34mm 1fr;
  gap: 8mm;
  align-items: center;
  margin-bottom: 4mm;
}

.photo-wrap {
  position: relative;
  width: 32mm;
  height: 32mm;
  margin: 2mm auto;
}

.photo {
  width: 32mm;
  height: 32mm;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(14,26,43,0.08), 0 6px 20px rgba(14,26,43,0.06);
}

.photo-ring {
  position: absolute;
  top: -2.5mm;
  left: -2.5mm;
  width: 37mm;
  height: 37mm;
  pointer-events: none;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 8pt;
  color: var(--muted);
  margin-bottom: 3mm;
  letter-spacing: 0.1px;
  padding-bottom: 2mm;
  border-bottom: 1px solid var(--rule);
}

.contact-strip span,
.contact-strip a { white-space: nowrap; }

.contact-strip a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.contact-strip a:hover {
  color: var(--warm);
  text-decoration: underline;
}

.name-primary {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 24pt;
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 1mm;
  color: var(--ink);
}

.title-primary {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 13pt;
  color: var(--warm-deep);
  margin-bottom: 2mm;
  letter-spacing: -0.2px;
}

.tenure-line {
  font-size: 8.5pt;
  color: var(--warm-deep);
  margin: 2mm 0 2mm 0;
  letter-spacing: 0.2px;
  padding-left: 10px;
  border-left: 2px solid var(--warm);
}
.tenure-line strong { color: var(--ink); }

.tagline {
  font-size: 8.75pt;
  color: var(--ink-2);
  max-width: 98%;
  line-height: 1.4;
  margin-bottom: 2mm;
}

.tagline.weekends {
  text-indent: 6mm;
}

.tagline.weekends strong {
  color: var(--ink);
}

.node .year em {
  font-style: normal;
  font-size: 7.5pt;
  color: var(--warm-deep);
  font-weight: 600;
  opacity: 0.85;
}

/* ---------- DASHBOARD ---------- */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5mm;
  margin: 2mm 0 3mm;
}

.metric {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2mm;
  padding: 2mm 2.5mm;
  box-shadow: var(--shadow);
  position: relative;
}

.metric.accent {
  background: linear-gradient(135deg, var(--warm) 0%, #C9644F 100%);
  border-color: var(--warm-deep);
  color: #fff;
}

.metric-value {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 13pt;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.3px;
  margin-bottom: 1mm;
}

.metric-value small {
  font-size: 60%;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 1px;
}

.metric.accent .metric-value { color: #fff; }

.metric-label {
  font-size: 8pt;
  color: var(--muted);
  line-height: 1.35;
  display: block;
}

.metric-label em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-2);
}

.metric.accent .metric-label,
.metric.accent .metric-label em {
  color: rgba(255,255,255,0.92);
}

/* ---------- SECTION TITLE ---------- */
.section-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 12.75pt;
  color: var(--ink);
  margin-bottom: 2mm;
  margin-top: 0;
  letter-spacing: -0.3px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-title em {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 8pt;
  color: var(--muted);
  letter-spacing: 0;
}

/* ---------- SPECIALTIES ---------- */
.specialties { margin-bottom: 3.5mm; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 7px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 8.5pt;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
}

.tag:hover {
  border-color: var(--warm);
  color: var(--ink);
}

.tag small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
  font-size: 7.5pt;
}

.tag-pinned {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 28px;
  background: linear-gradient(90deg, #B1331E 0%, #D14A2A 100%);
  color: #fff;
  border-radius: 6px;
  font-size: 8.5pt;
  box-shadow: 0 2px 6px rgba(177,51,30,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: rotate(-1deg);
  margin-left: 4px;
}

.tag-pinned .pin {
  position: absolute;
  left: 4px;
  top: -6px;
  width: 16px;
  height: 18px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.tag-pinned strong {
  font-weight: 700;
}

/* ---------- CAREER TIMELINE ---------- */
.career {
  margin-bottom: 4mm;
  margin-top: 6mm;
}

.career .section-title {
  margin-bottom: 4mm;
}

.pre-ibm {
  font-size: 8pt;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 3mm;
  font-style: italic;
}

.pre-ibm strong {
  color: var(--ink-2);
  font-style: normal;
}

.timeline {
  display: grid;
  grid-template-columns: 0.8fr 0.85fr 1.2fr 1.4fr;
  gap: 2mm;
  position: relative;
  margin-top: 2mm;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 3%;
  right: 3%;
  height: 1.5px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0,
    var(--accent) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.35;
  z-index: 0;
}

.node {
  position: relative;
  z-index: 1;
  padding-top: 38px;
}

.icon-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--card);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.node.current .icon-box {
  border-color: var(--warm);
  background: linear-gradient(135deg, #FFF 0%, #FFEFE8 100%);
}

.icon-box svg {
  width: 18px;
  height: 18px;
}

.year {
  display: block;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 9.5pt;
  color: var(--warm);
  margin-bottom: 1mm;
}

.node h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 10pt;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.5mm;
}

.role-sub {
  font-size: 8pt;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2mm;
  font-style: italic;
}

.node ul {
  list-style: none;
  padding: 0;
}

.node ul li {
  font-size: 7.75pt;
  line-height: 1.35;
  color: var(--ink-2);
  padding-left: 7px;
  position: relative;
  margin-bottom: 0.8mm;
}

.node ul li::before {
  content: '•';
  color: var(--warm);
  position: absolute;
  left: 0;
  font-weight: 700;
}

.node ul li strong {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================
   PAGE 2
   ========================================================== */

/* ---------- SHIPPED CARDS ---------- */
.shipped {
  margin-bottom: 4mm;
  margin-top: 8mm;
  padding-top: 6mm;
  break-before: page;
  page-break-before: always;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5mm;
  margin-bottom: 2.5mm;
  align-items: stretch;
}

.ship-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2.5mm;
  padding: 2.5mm 3mm;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}

.ship-tag {
  display: inline-block;
  background: var(--bg);
  color: var(--accent);
  font-size: 7pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  margin-bottom: 2mm;
}

.ship-card h4 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 11pt;
  color: var(--ink);
  letter-spacing: -0.2px;
  margin-bottom: 1mm;
}

.ship-meta {
  font-size: 7.5pt;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2mm;
  font-family: 'Inter', monospace;
}

.ship-card p:not(.ship-meta) {
  font-size: 8pt;
  line-height: 1.4;
  color: var(--ink-2);
}

.ship-examples,
.brilliance {
  margin-top: 1.5mm !important;
  padding-top: 1.5mm;
  border-top: 1px dashed var(--rule);
  font-size: 7.5pt !important;
  line-height: 1.4 !important;
  color: var(--muted) !important;
}

.brilliance em {
  color: var(--warm) !important;
  font-style: italic !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
}

.brilliance strong { color: var(--ink) !important; }

.ship-card strong { color: var(--ink); font-weight: 600; }
.ship-card em { color: var(--warm); font-style: italic; font-weight: 500; }

.plus-more {
  font-size: 7.5pt;
  color: var(--muted);
  line-height: 1.35;
  padding: 1.5mm 2.5mm;
  background: linear-gradient(90deg, transparent 0%, rgba(217,119,87,0.05) 100%);
  border-left: 2px solid var(--warm);
  font-style: italic;
  break-inside: auto;
  page-break-inside: auto;
}

/* ---------- SKILLS ---------- */
.skills {
  margin-bottom: 3mm;
  margin-top: 0;
  padding-top: 3mm;
  break-before: page;
  page-break-before: always;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3mm 10mm;
}

.skill-grid > div {
  display: grid;
  grid-template-columns: 32mm 1fr;
  gap: 5mm;
  padding: 1mm 0;
}

.skill-grid dt {
  font-weight: 700;
  font-size: 8.5pt;
  color: var(--accent);
}

.skill-grid dd {
  font-size: 8pt;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- RECOGNITION ---------- */
.recognition { margin-bottom: 3.5mm; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm 7mm;
  position: relative;
}

.two-col::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 1mm;
  bottom: 1mm;
  width: 1px;
  background: var(--rule);
  transform: translateX(-3.5mm);
}

.recog-col {
  list-style: none;
  padding: 0;
}

.recog-col li {
  font-size: 8pt;
  line-height: 1.4;
  color: var(--ink-2);
  margin-bottom: 1mm;
  padding-left: 10px;
  position: relative;
}

.recog-col li::before {
  content: '▸';
  color: var(--warm);
  position: absolute;
  left: 0;
  font-size: 7pt;
  top: 3px;
}

.recog-col strong {
  color: var(--ink);
  font-weight: 600;
}

.recog-col em {
  color: var(--warm-deep);
  font-style: italic;
}

/* ---------- SPEAKING ---------- */
.speaking { margin-bottom: 3.5mm; }

.speaking p {
  font-size: 8pt;
  line-height: 1.4;
  color: var(--ink-2);
  margin-bottom: 1.5mm;
}

.speaking strong { color: var(--ink); font-weight: 600; }

/* ---------- PRE-IBM ---------- */
.pre-ibm { margin-bottom: 3.5mm; }

.pre-ibm p {
  font-size: 8.5pt;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 1.5mm;
}

.pre-ibm strong { color: var(--ink); font-weight: 600; }

/* ---------- EDUCATION ---------- */
.education { margin-bottom: 3.5mm; }

.education ul {
  list-style: none;
  padding: 0;
}

.education li {
  font-size: 8.25pt;
  line-height: 1.4;
  color: var(--ink-2);
  margin-bottom: 1.5mm;
  padding-left: 10px;
  position: relative;
}

.education li::before {
  content: '▸';
  color: var(--warm);
  position: absolute;
  left: 0;
  font-size: 7pt;
  top: 3px;
}

.education strong { color: var(--ink); font-weight: 600; }

/* ---------- CLOSING ---------- */
.closing {
  margin-top: 2mm;
  padding-top: 1mm;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 9pt;
  color: var(--accent);
  text-align: center;
  break-before: avoid;
  page-break-before: avoid;
  position: relative;
}

.closing::before {
  content: '';
  display: none;
}

.closing strong {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 700;
  color: var(--warm);
}

/* ---------- Print ---------- */
@media print {
  html, body { background: var(--bg); }
  .page {
    margin: 0;
    padding: 14mm 14mm 12mm 14mm;
    page-break-after: always;
    box-shadow: none;
  }
  .page:last-child { page-break-after: auto; }
}

@page {
  size: A4;
  margin: 0;
}
