/* ============================================================
   Luca Vinciguerra — lvinci.de
   Terminal / developer aesthetic. Monospace, 1px lines,
   no rounded corners, no blur, no shadows.
   ============================================================ */

/* Self-hosted webfont — no third-party requests */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
               'Cascadia Code', Consolas, 'Liberation Mono', monospace;

  --bg: #f6f6f1;
  --bg-alt: #ecece5;
  --text: #151515;
  --muted: #6a6a6a;
  --accent: #6d28d9;          /* purple */
  --accent-contrast: #ffffff;
  --ok: #1a9e5c;              /* status "live" dot */
  --border: #d5d5ce;
  --card: #fbfbf7;

  --maxw: 880px;
}

/* Dark theme (follows system unless overridden by the toggle) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --bg-alt: #181818;
    --text: #e7e7e7;
    --muted: #8a8a8a;
    --accent: #a78bfa;
    --accent-contrast: #0e0e0e;
    --ok: #34d399;
    --border: #2a2a2a;
    --card: #141414;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-alt: #181818;
  --text: #e7e7e7;
  --muted: #8a8a8a;
  --accent: #a78bfa;
  --accent-contrast: #0e0e0e;
  --ok: #34d399;
  --border: #2a2a2a;
  --card: #141414;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

h1, h2, h3 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { scroll-margin-top: 4.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.nav a { transition: color 0.15s ease; }
.nav a:hover { color: var(--accent); }

.controls { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  min-width: 2.1rem;
  padding: 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Theme icon swap */
#theme-toggle .icon-sun { display: none; }
#theme-toggle.is-dark .icon-sun { display: block; }
#theme-toggle.is-dark .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 5.5rem 0 4.5rem; }

.eyebrow {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tagline {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.status {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.dot { color: var(--ok); }

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { opacity: 0.88; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* ---------- Sections ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.lead {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 46rem;
}

/* ---------- Skills (terminal table grid) ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.skill {
  background: var(--card);
  padding: 1.3rem 1.3rem 1.4rem;
}
.skill h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.skill p {
  color: var(--muted);
  font-size: 0.87rem;
}

/* ---------- Projects (terminal table grid) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.project {
  background: var(--card);
  padding: 1.4rem 1.3rem 1.5rem;
  transition: background 0.15s ease;
}
.project:hover { background: var(--bg-alt); }

.project h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1rem;
}
.project-num { color: var(--accent); }
.project p {
  color: var(--muted);
  font-size: 0.87rem;
  margin-top: 0.5rem;
}

/* ---------- Contact ---------- */
.contact-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.social-links { display: flex; gap: 1.3rem; }

.social-links a {
  color: var(--accent);
  font-size: 0.88rem;
  transition: opacity 0.15s ease;
}
.social-links a:hover { opacity: 0.7; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner a { color: var(--accent); }
.footer-inner a:hover { opacity: 0.7; }
.footer-links { display: flex; gap: 1.25rem; }

/* ---------- Legal pages (Impressum / Datenschutz) ---------- */
.legal { padding-top: 3.5rem; }
.legal h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}
.legal h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}
.legal p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  max-width: 46rem;
}
.legal a { color: var(--accent); }
.legal-stand { margin-top: 2rem; }

/* ---------- CV page ---------- */
.cv { padding-top: 3rem; }

.cv-head { margin-bottom: 2.5rem; }
.cv-head h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.cv-subtitle { color: var(--accent); font-weight: 600; margin-top: 0.4rem; }

.cv-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
}

.cv h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2.5rem 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cv-sidebar h2:first-child,
.cv-main h2:first-child { margin-top: 0; }
.cv-main h2 { border-bottom-color: var(--accent); }

/* Sidebar */
.cv-sidebar .skill-label,
.cv-sidebar .skill-value { font-size: 0.88rem; }
.cv-sidebar .skill-label {
  color: var(--text);
  font-weight: 700;
  margin: 1rem 0 0.15rem;
}
.cv-sidebar .skill-value { color: var(--muted); margin: 0 0 0.5rem; }
.cv-sidebar ul { list-style: none; margin: 0; padding: 0; }
.cv-sidebar li { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.4rem; }
.cv-sidebar a { color: var(--accent); }
.cv-sidebar li strong { color: var(--text); font-weight: 700; }

/* Main column: timeline */
.cv-timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}
.cv-entry {
  position: relative;
  margin-bottom: 1.75rem;
}
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translateX(-50%);
}
.cv-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.cv-company { font-weight: 700; font-size: 1rem; }
.cv-dates { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.cv-entry-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.15rem;
}
.cv-role { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.cv-location { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.cv-entry ul { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.cv-entry li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.35rem;
}
.cv-entry li::before { content: '–'; position: absolute; left: 0; color: var(--accent); }

/* Responsive: collapse to single column */
@media (max-width: 720px) {
  .cv-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cv-entry-head, .cv-entry-sub { flex-wrap: wrap; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav { order: 3; width: 100%; gap: 1.1rem; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 3rem 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
