/* ─── CSS Variables — Light Mode ────────────────────── */
:root {
  --ink:       #0f0e0d;
  --paper:     #f5f2ec;
  --cream:     #eae6dd;
  --rule:      #c8c2b4;
  --accent:    #c0392b;
  --accent2:   #2c3e50;
  --muted:     #7a7268;
  --body-text: #3a3630;
  --col-gap:   2.5rem;
  --max-w:     960px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

/* ─── CSS Variables — Dark Mode ─────────────────────── */
/* Triggered by system preference OR manual toggle (data-theme="dark") */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #e8e4dc;
    --paper:     #0e1117;
    --cream:     #1a1f2b;
    --rule:      #2e3545;
    --accent:    #e05a4a;
    --accent2:   #7eb8e8;
    --muted:     #6b7280;
    --body-text: #c9c3b8;
  }
}

/* Manual override — dark */
[data-theme="dark"] {
  --ink:       #e8e4dc;
  --paper:     #0e1117;
  --cream:     #1a1f2b;
  --rule:      #2e3545;
  --accent:    #e05a4a;
  --accent2:   #7eb8e8;
  --muted:     #6b7280;
  --body-text: #c9c3b8;
}

/* Manual override — light (beats system dark preference) */
[data-theme="light"] {
  --ink:       #0f0e0d;
  --paper:     #f5f2ec;
  --cream:     #eae6dd;
  --rule:      #c8c2b4;
  --accent:    #c0392b;
  --accent2:   #2c3e50;
  --muted:     #7a7268;
  --body-text: #3a3630;
}

/* ─── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ─── Page Wrapper ──────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.7s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Masthead ──────────────────────────────────────── */
.masthead {
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 2.4rem 0 2rem;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
}

.masthead__name {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--ink);
}

.masthead__name em {
  font-style: italic;
  color: var(--accent);
}

.masthead__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 0.6rem;
}

.masthead__contact {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.9;
}

.masthead__contact a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
  transition: color 0.2s, border-color 0.2s;
}

.masthead__contact a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Layout Grid ───────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 var(--col-gap);
  border-top: 1px solid var(--rule);
  padding-top: 2.2rem;
  margin-top: 2rem;
}

/* ─── Sidebar ───────────────────────────────────────── */
.sidebar {
  padding-right: 1rem;
  border-right: 1px solid var(--rule);
}

.sidebar-block { margin-bottom: 2.4rem; }

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--cream);
}

.sidebar-text {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.7;
}

.skill-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--cream);
  border: 1px solid var(--rule);
  color: var(--accent2);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
  margin: 0.18rem 0.15rem 0.18rem 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.skill-tag:hover {
  background: var(--accent2);
  color: var(--paper);
  border-color: var(--accent2);
}

.lang-bar {
  margin-bottom: 0.65rem;
}

.lang-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.lang-bar__track {
  height: 3px;
  background: var(--cream);
  border-radius: 2px;
  overflow: hidden;
}

.lang-bar__fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Dark Mode Toggle Button ───────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border-radius: 2px;
  z-index: 200;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Main Content ──────────────────────────────────── */
.main { min-width: 0; }

/* ─── Section ───────────────────────────────────────── */
.section { margin-bottom: 2.8rem; }

.section__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  white-space: nowrap;
}

.section__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ─── Summary ───────────────────────────────────────── */
.summary {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-style: italic;
  color: var(--accent2);
  line-height: 1.75;
  border-left: 3px solid var(--accent);
  padding-left: 1.1rem;
  margin-bottom: 0.3rem;
}

/* ─── Experience Entry ──────────────────────────────── */
.entry {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--rule);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.entry:last-child { border-bottom: none; }
.entry.visible { opacity: 1; transform: translateY(0); }

.entry__header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.entry__role {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.entry__date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry__company {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.entry__desc {
  font-size: 0.85rem;
  color: var(--body-text);
  line-height: 1.75;
}

.entry__bullets {
  list-style: none;
  margin-top: 0.55rem;
}

.entry__bullets li {
  font-size: 0.84rem;
  color: var(--body-text);
  line-height: 1.7;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.entry__bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ─── Education ─────────────────────────────────────── */
.edu-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 1rem;
  margin-bottom: 1.4rem;
  align-items: start;
}

.edu-entry__degree {
  font-weight: 500;
  font-size: 0.93rem;
}

.edu-entry__school {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.edu-entry__year {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  padding-top: 0.15rem;
}

.edu-entry__note {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  grid-column: 1;
}

/* ─── Print Button ──────────────────────────────────── */
.print-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.15s;
  z-index: 100;
}

.print-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

/* ─── Print Styles ──────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; font-size: 13px; }
  .page { padding: 1.5rem; opacity: 1 !important; transform: none !important; }
  .print-btn, .theme-toggle { display: none; }
  .entry { opacity: 1 !important; transform: none !important; }
  .lang-bar__fill { transform: scaleX(1) !important; }
  .entry__desc, .entry__bullets li { color: #3a3630; }
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 660px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem var(--col-gap);
  }
  .masthead {
    grid-template-columns: 1fr;
  }
  .masthead__contact { text-align: left; }
  .theme-toggle { top: 1rem; right: 1rem; }
}
