/* ============================================================
   Dilashma — CV
   A light, print-first document that matches the portfolio.
   ============================================================ */

:root {
  --ink: #0f1a15;
  --ink-2: #2f3d36;
  --muted: #62716a;
  --line: #e3e9e5;
  --line-strong: #cfd8d2;
  --accent: #0e8a5f;
  --accent-soft: #e9f7f0;
  --paper: #ffffff;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(14, 138, 95, 0.16), transparent 65%),
    #080b09;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10pt;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Screen toolbar ────────────────────────────────────────── */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 11, 9, 0.88);
  color: #dfe8e3;
  backdrop-filter: blur(12px);
}

.toolbar-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9b8b0;
  transition: color 0.2s ease;
}

.toolbar-back:hover {
  color: #7ef0b4;
}

.toolbar-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7d8f86;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #dfe8e3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.toolbar-btn:hover {
  border-color: rgba(126, 240, 180, 0.45);
  background: rgba(126, 240, 180, 0.08);
  color: #7ef0b4;
}

.toolbar-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-btn--primary {
  border-color: rgba(126, 240, 180, 0.34);
  background: rgba(126, 240, 180, 0.12);
  color: #b8ffd9;
}

/* ── A4 sheet ──────────────────────────────────────────────── */

.sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 26px auto 56px;
  padding: 13mm 14mm 11mm;
  background: var(--paper);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
}

/* ── Header ────────────────────────────────────────────────── */

.cv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 11px;
  border-bottom: 2px solid var(--ink);
}

.cv-kicker {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 7.5pt;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.cv-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28pt;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.cv-role {
  margin: 5px 0 0;
  font-size: 9.5pt;
  font-weight: 500;
  color: var(--ink-2);
}

.cv-contact {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  text-align: right;
  font-size: 8.2pt;
  line-height: 1.65;
  color: var(--ink-2);
}

.cv-contact li {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.cv-contact svg {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cv-contact a:hover {
  color: var(--accent);
}

/* ── Body grid ─────────────────────────────────────────────── */

.cv-body {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
  gap: 0 24px;
  margin-top: 15px;
}

.cv-main > .cv-section:last-child,
.cv-side > .cv-section:last-child {
  margin-bottom: 0;
}

.cv-side {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.cv-section {
  margin-bottom: 15px;
}

.cv-section > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 7.5pt;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink);
}

.cv-section > h2::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Profile ───────────────────────────────────────────────── */

.cv-summary {
  margin: 0;
  font-size: 9pt;
  line-height: 1.62;
  color: var(--ink-2);
}

/* ── Entries ───────────────────────────────────────────────── */

.entry {
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line);
  break-inside: avoid;
}

.entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.entry h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10.2pt;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.entry-date {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 7.2pt;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.entry-sub {
  margin: 2px 0 5px;
  font-size: 8.4pt;
  font-weight: 500;
  color: var(--accent);
}

.entry ul {
  margin: 0;
  padding-left: 12px;
}

.entry li {
  margin-bottom: 2px;
  font-size: 8.5pt;
  line-height: 1.52;
  color: var(--ink-2);
}

.entry li::marker {
  color: var(--accent);
}

.entry-tech {
  margin: 5px 0 0;
  font-family: var(--font-mono);
  font-size: 7pt;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.entry-tech span {
  color: var(--accent);
}

/* ── Sidebar lists ─────────────────────────────────────────── */

.skill-group {
  margin-bottom: 9px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group dt {
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 7pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-group dd {
  margin: 0;
  font-size: 8.4pt;
  line-height: 1.5;
  color: var(--ink-2);
}

.coursework {
  margin: 0;
  padding-left: 12px;
}

.coursework li {
  margin-bottom: 3px;
  font-size: 8.4pt;
  line-height: 1.45;
  color: var(--ink-2);
}

.coursework li::marker {
  color: var(--accent);
}

.side-note {
  margin: 0;
  font-size: 8.4pt;
  line-height: 1.55;
  color: var(--ink-2);
}

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

/* ── Footer ────────────────────────────────────────────────── */

.cv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 6.8pt;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cv-foot span:last-child {
  color: var(--accent);
}

/* ── Responsive screen view ────────────────────────────────── */

@media screen and (max-width: 880px) {
  .toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .toolbar-title {
    display: none;
  }

  .sheet {
    width: auto;
    min-height: 0;
    margin: 16px;
    padding: 26px 22px 22px;
  }

  .cv-head {
    flex-direction: column;
    gap: 12px;
  }

  .cv-contact {
    text-align: left;
  }

  .cv-contact li {
    justify-content: flex-start;
  }

  .cv-body {
    grid-template-columns: 1fr;
  }

  .cv-side {
    margin-top: 6px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .cv-name {
    font-size: 32pt;
  }
}

/* ── Embedded viewer (?embed=1) ────────────────────────────── */

html.cv-embed body {
  background: #eef3ef;
}

html.cv-embed .toolbar {
  display: none;
}

html.cv-embed .sheet {
  margin: 22px auto;
  box-shadow: none;
}

@media screen and (max-width: 880px) {
  html.cv-embed .sheet {
    margin: 0;
    padding: 26px 20px 24px;
  }
}

/* ── Print ─────────────────────────────────────────────────── */

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

@media print {
  body {
    background: #fff;
    font-size: 10pt;
  }

  .toolbar {
    display: none !important;
  }

  .sheet {
    width: 210mm;
    min-height: 0;
    margin: 0;
    padding: 10mm 14mm 8mm;
    box-shadow: none;
  }

  .cv-body {
    margin-top: 12px;
  }

  .entry {
    margin-bottom: 10px;
    padding-bottom: 9px;
  }

  .entry,
  .cv-section {
    break-inside: avoid;
  }

  .cv-foot {
    margin-top: 12px;
    padding-top: 6px;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .cv-side {
    border-left-color: var(--line);
  }
}
