/* ==========================================================
   Public CV — ink sidebar identity + paper reading column
   ========================================================== */
:root {
  --ink: #1c2b4a;
  --ink-2: #26385e;
  --ink-soft: #c9d3e6;
  --paper: #f5f6f2;
  --surface: #ffffff;
  --text: #22262e;
  --muted: #5b6472;
  --rule: #d8dbd3;
  --marigold: #e2a336;
  --marigold-deep: #8a5a08;
  --danger: #a12a2a;
  --success: #1f6b45;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --side-w: 24rem;
  --gutter: clamp(1rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (min-width: 64em) { html { scroll-padding-top: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--marigold); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 2px; }

.icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--marigold); color: var(--ink); padding: .6rem 1rem; font-family: var(--font-ui); font-weight: 600; }
.skip-link:focus { top: 1rem; }

.preview-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: center;
  padding: .55rem 1rem; background: var(--marigold); color: var(--ink);
  font-family: var(--font-ui); font-size: .9rem; text-align: center;
}
.preview-bar a { font-weight: 700; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; }
@media (min-width: 64em) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
}

/* ---------- Mobile top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem 1rem; background: var(--ink); color: #fff;
  font-family: var(--font-ui);
}
.preview-bar + .topbar { top: 2.4rem; }
.topbar-name { color: #fff; text-decoration: none; font-weight: 700; font-stretch: 80%; font-size: 1.1rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-button {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 2.75rem; padding: 0 .9rem; border: 1px solid rgba(255,255,255,.35); border-radius: 6px;
  background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
@media (min-width: 64em) { .topbar { display: none; } }

/* ---------- Identity column ---------- */
.identity { background: var(--ink); color: var(--ink-soft); font-family: var(--font-ui); }
.identity-inner { padding: 2.25rem var(--gutter) 2.5rem; max-width: 40rem; }
@media (min-width: 64em) {
  .identity-inner { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 3rem 2.25rem 2.5rem; }
  .preview-bar ~ .layout .identity-inner { top: 2.4rem; max-height: calc(100vh - 2.4rem); }
}

.portrait {
  width: 8.5rem; height: 8.5rem; object-fit: cover;
  border-radius: 50%; border: 3px solid var(--marigold);
  margin-bottom: 1.5rem; background: var(--ink-2);
}
@media (min-width: 64em) { .portrait { width: 10.5rem; height: 10.5rem; } }

.name {
  margin: 0; color: #fff;
  font-family: var(--font-display);
  font-weight: 800; font-stretch: 72%;
  font-size: clamp(2.6rem, 9vw, 3.4rem);
  line-height: .95; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.role { margin: .7rem 0 0; color: var(--marigold); font-weight: 600; font-size: 1.05rem; line-height: 1.35; }
.intro { margin: 1.1rem 0 0; color: var(--ink-soft); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; }

.contact-list { list-style: none; margin: 1.6rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid rgba(201,211,230,.22); display: grid; gap: .55rem; font-size: .93rem; }
.contact-list li { display: flex; gap: .65rem; align-items: center; min-width: 0; }
.contact-list .icon { color: var(--marigold); }
.contact-list a, .contact-list span { color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; text-decoration-color: var(--marigold); }

.cv-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: 6px; border: 1.5px solid transparent;
  font-family: var(--font-ui); font-size: .95rem; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.button-primary { background: var(--marigold); color: var(--ink); }
.button-primary:hover { background: #edb54e; text-decoration: none; }
.button-primary:disabled { opacity: .55; cursor: not-allowed; }
.button-quiet { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.button-quiet:hover { border-color: #fff; }

/* Section navigation: in the sidebar on desktop, a drop-down panel on small screens */
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; text-decoration: none; }
@media (min-width: 64em) {
  .site-nav { margin-top: 2.2rem; padding-top: 1.1rem; border-top: 1px solid rgba(201,211,230,.22); }
  .site-nav a { color: var(--ink-soft); padding: .35rem 0 .35rem .9rem; border-left: 2px solid transparent; font-size: .95rem; }
  .site-nav a:hover { color: #fff; }
  .site-nav a[aria-current="true"] { color: #fff; border-left-color: var(--marigold); font-weight: 600; }
}
@media (max-width: 63.99em) {
  .site-nav { position: fixed; z-index: 49; left: 0; right: 0; top: 3.85rem; background: var(--ink); border-top: 1px solid rgba(255,255,255,.15); box-shadow: 0 14px 24px rgba(16,24,40,.25); display: none; }
  .preview-bar ~ .layout .site-nav { top: 6.25rem; }
  .site-nav.is-open { display: block; }
  .site-nav a { color: #fff; padding: .85rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 600; }
  .no-js .site-nav { position: static; display: block; box-shadow: none; margin-top: 1.5rem; }
}

/* ---------- Content column ---------- */
.content { padding: 0 var(--gutter) 2rem; min-width: 0; }
.content:focus { outline: none; }
.content > * { max-width: 48rem; }

.notice { margin: 1.5rem 0 0; padding: .85rem 1rem; border-left: 4px solid var(--ink); background: var(--surface); font-family: var(--font-ui); font-size: .95rem; }
.notice-success { border-color: var(--success); }
.notice-error { border-color: var(--danger); }

.section { padding: 3.25rem 0 1rem; }
.section + .section { border-top: 1px solid var(--rule); }
@media (min-width: 64em) { .section { padding-top: 4rem; } }

.section h2 {
  margin: 0 0 1.6rem;
  font-family: var(--font-display); font-weight: 750; font-stretch: 75%;
  font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1; color: var(--ink); letter-spacing: -.005em;
}
.section h3 { font-family: var(--font-ui); color: var(--ink); }

.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.about-grid { display: grid; gap: 1.75rem; margin-top: 2rem; }
@media (min-width: 40em) { .about-grid { grid-template-columns: 1.2fr 1fr; gap: 2.5rem; } }
.about-grid h3 { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 700; }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li { padding: .45rem 0; border-bottom: 1px solid var(--rule); font-family: var(--font-ui); font-size: .98rem; }
.spec-list li:first-child { border-top: 1px solid var(--rule); }

/* ---------- Timeline (experience & education) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: .34rem; top: .6rem; bottom: .5rem; width: 2px; background: var(--rule); }
.tl-item { position: relative; padding: 0 0 2.1rem 2rem; }
.tl-item:last-child { padding-bottom: .5rem; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: .42rem;
  width: .75rem; height: .75rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--marigold);
}
.tl-item.is-current::before { background: var(--marigold); box-shadow: 0 0 0 4px rgba(226,163,54,.22); }
.tl-period { margin: 0; font-family: var(--font-ui); font-size: .85rem; font-weight: 600; color: var(--marigold-deep); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.tl-title { margin: .1rem 0 0; font-size: 1.22rem; font-weight: 700; line-height: 1.3; }
.tl-org { margin: .1rem 0 0; font-style: italic; color: var(--muted); }
.tl-points { margin: .7rem 0 0; padding-left: 1.1rem; }
.tl-points li { margin: .3rem 0; padding-left: .2rem; }
.tl-points li::marker { color: var(--marigold-deep); }
.tl-text { margin-top: .6rem; }

.sub-h { margin: 2.4rem 0 .9rem; font-size: 1.15rem; font-weight: 700; }

.cert-list, .ach-list { list-style: none; margin: 0; padding: 0; }
.cert-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--rule); }
.cert-list li:last-child { border-bottom: 1px solid var(--rule); }
.cert-main { display: flex; flex-direction: column; min-width: 0; }
.cert-name { font-family: var(--font-ui); font-weight: 650; color: var(--ink); }
.cert-issuer { color: var(--muted); font-size: .95rem; }
.cert-desc { font-size: .95rem; margin-top: .15rem; }
.cert-date { flex: none; font-family: var(--font-ui); font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; gap: 2rem; }
@media (min-width: 46em) { .skill-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; } }
.skill-group h3 { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 700; }
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-family: var(--font-ui); font-size: .97rem; }
.skill-name { min-width: 0; overflow-wrap: anywhere; }
.meter { display: inline-flex; gap: 3px; flex: none; }
.meter .seg { width: 1.05rem; height: .45rem; border-radius: 1px; background: var(--rule); }
.meter .seg.on { background: var(--marigold); }

/* ---------- Projects ---------- */
.project { display: grid; gap: 1.1rem; padding: 0 0 2.2rem; }
.project + .project { padding-top: 2.2rem; border-top: 1px solid var(--rule); }
@media (min-width: 40em) { .project.has-image { grid-template-columns: 15rem minmax(0, 1fr); gap: 1.75rem; align-items: start; } }
.project-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--rule); }
.project-title { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.project-title a { text-decoration: none; }
.project-title a:hover { text-decoration: underline; }
.project-meta { margin: .2rem 0 .6rem; font-family: var(--font-ui); font-size: .88rem; color: var(--muted); }
.text-link { display: inline-block; margin-top: .7rem; font-family: var(--font-ui); font-weight: 650; font-size: .95rem; }

.achievements { display: grid; gap: 0 3rem; }
@media (min-width: 46em) { .achievements { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ach-list li { padding: .8rem 0; border-top: 1px solid var(--rule); }
.ach-title { margin: 0; font-family: var(--font-ui); font-weight: 650; color: var(--ink); line-height: 1.35; }
.ach-meta { margin: .15rem 0 0; color: var(--muted); font-size: .93rem; }
.ach-desc { margin: .3rem 0 0; font-size: .97rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.25rem; }
@media (min-width: 52em) { .contact-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3rem; } }
.contact-direct > p { margin-top: 0; }
.contact-dl { margin: 1rem 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem 1.25rem; font-family: var(--font-ui); font-size: .97rem; }
.contact-dl dt { color: var(--muted); }
.contact-dl dd { margin: 0; overflow-wrap: anywhere; }

.contact-form { display: grid; gap: 1rem; background: var(--surface); padding: 1.5rem; border: 1px solid var(--rule); border-radius: 6px; }
.field { display: grid; gap: .35rem; }
.field label { font-family: var(--font-ui); font-weight: 600; font-size: .93rem; color: var(--ink); }
.optional { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; min-height: 2.9rem; padding: .65rem .8rem;
  border: 1.5px solid #b9bfc9; border-radius: 5px; background: #fff; color: var(--text);
  font: 400 1rem/1.5 var(--font-ui);
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus { outline: 3px solid rgba(226,163,54,.55); outline-offset: 0; border-color: var(--ink); }
.contact-form .button { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { margin-top: 3rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); font-family: var(--font-ui); font-size: .88rem; color: var(--muted); }
.site-footer p { margin: 0; }

/* ---------- Print: the browser's "Print" produces a clean CV ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .topbar, .preview-bar, .skip-link, .cv-actions, .site-nav, .contact-form, .site-footer, .notice, .text-link { display: none !important; }
  .layout { display: block; }
  .identity { background: #fff; color: var(--text); border-bottom: 2px solid var(--ink); }
  .identity-inner { position: static; padding: 0 0 1rem; max-width: none; display: grid; grid-template-columns: auto 1fr; column-gap: 1.25rem; }
  .portrait { grid-row: span 4; width: 6rem; height: 6rem; margin: 0; }
  .name { color: var(--ink); font-size: 26pt; }
  .role { color: var(--marigold-deep); }
  .intro { color: var(--text); }
  .contact-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; border: 0; padding-top: .5rem; margin-top: .5rem; }
  .contact-list a, .contact-list span { color: var(--text); }
  .content { padding: 0; }
  .content > * { max-width: none; }
  .section { padding: 1.1rem 0 0; break-inside: auto; }
  .section h2 { font-size: 16pt; margin-bottom: .6rem; }
  .tl-item, .project, .cert-list li, .ach-list li { break-inside: avoid; }
  .project.has-image { grid-template-columns: 8rem 1fr; }
  .contact-grid { display: block; }
  a { text-decoration: none; color: inherit; }
}
