/* lexisvar.me: public CV page. Hand-written, no framework. */

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --accent-text: #065f56;
  --radius: 10px;
  --maxw: 880px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark colours: automatic (visitor's device) unless the admin forces a theme
   with data-theme="light" or data-theme="dark" on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --surface: #111a2e;
    --border: #1f2a40;
    --text: #e2e8f0;
    --muted: #a5b4c8;
    --subtle: #8796ab;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --accent-text: #5eead4;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111a2e;
  --border: #1f2a40;
  --text: #e2e8f0;
  --muted: #a5b4c8;
  --subtle: #8796ab;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.1);
  --accent-text: #5eead4;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Top navigation */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topnav .container { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.topnav .brand { font-weight: 600; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.topnav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; overflow-x: auto; }
.topnav ul a { color: var(--muted); font-size: 14px; white-space: nowrap; }
.topnav ul a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero-inner { display: flex; gap: 28px; align-items: center; }
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.hero h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 8px; }
.hero .headline { font-size: 18px; color: var(--muted); margin: 0 0 12px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--subtle); font-size: 14px; margin: 0 0 20px; padding: 0; list-style: none; }
.badge-available {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 20px;
}
.badge-available::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text); background: var(--bg);
}
.btn:hover { text-decoration: none; border-color: var(--subtle); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #04201d; } }
:root[data-theme="dark"] .btn-primary { color: #04201d; }
.btn svg { width: 16px; height: 16px; }

/* Key facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.facts strong { display: block; font-size: 20px; letter-spacing: -0.01em; }
.facts span { color: var(--subtle); font-size: 13px; }

/* Sections */
section.block { padding: 40px 0; border-top: 1px solid var(--border); }
section.block > .container > h2 {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--subtle); margin: 0 0 24px;
}
.lead { font-size: 17px; color: var(--text); }
.lead p { margin: 0 0 12px; }

.rich-text p { margin: 0 0 10px; }
.rich-text p:last-child, .rich-text ul:last-child { margin-bottom: 0; }
.rich-text ul { margin: 6px 0 10px; padding-left: 20px; }
.rich-text li { margin-bottom: 4px; color: var(--muted); }
.rich-text li::marker { color: var(--accent); }

/* Timeline entries (experience, education) */
.entry { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 0 0 28px; }
.entry:last-child { padding-bottom: 0; }
.entry .when { color: var(--subtle); font-size: 14px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.entry h3 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.entry .org { color: var(--muted); margin: 2px 0 10px; font-size: 15px; }
.entry .rich-text { font-size: 15px; }
.entry.compact { padding-bottom: 14px; }
.entry.compact .org { margin-bottom: 0; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.project { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg); display: flex; flex-direction: column; }
.project.featured { grid-column: 1 / -1; background: var(--surface); }
.project header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.project h3 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.project .role { color: var(--accent-text); font-size: 13px; font-weight: 500; margin: 2px 0 10px; }
.project .when { color: var(--subtle); font-size: 13px; }
.project .rich-text { font-size: 15px; flex: 1; }
.project .links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
.chips li {
  font-size: 12.5px; padding: 3px 10px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.project.featured .chips li { background: var(--bg); }

/* Skills */
.skills { display: grid; gap: 14px; margin: 0; }
.skills > div { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: baseline; }
.skills dt { font-weight: 600; font-size: 14px; }
.skills dd { margin: 0; }
.skills .chips { margin: 0; }

/* Contact */
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.contact-card p { margin: 0; color: var(--muted); max-width: 460px; }
.contact-card h3 { margin: 0 0 6px; font-size: 20px; }

footer.site { padding: 32px 0 48px; color: var(--subtle); font-size: 13px; }
footer.site .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Responsive */
@media (max-width: 680px) {
  .hero { padding: 40px 0 28px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .avatar { width: 84px; height: 84px; }
  .entry, .skills > div { grid-template-columns: 1fr; gap: 4px; }
  .topnav ul { gap: 14px; }
  .topnav .brand { display: none; }
  .projects { grid-template-columns: 1fr; }
}

/* Print: a clean CV straight from the browser */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme] { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --subtle: #555; --border: #ccc; --accent: #0f766e; }
  .topnav, .actions, .avatar, .contact-card .btn, footer.site { display: none !important; }
  .hero { padding: 0 0 12px; }
  section.block { padding: 14px 0; break-inside: auto; }
  .entry, .project { break-inside: avoid; }
  .projects { grid-template-columns: 1fr; }
  body { font-size: 11pt; }
  a { color: #000; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
