/* ===== CV Student — style.css ===== */

:root {
  /* Layout: 2-col desktop, 1-col mobile. Sidebar sticky on desktop. */

  /* Color tokens */
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --fg: #1a1a2e;
  --fg-muted: #5c5c7a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #e5e5ea;
  --sidebar-bg: #1a1a2e;
  --sidebar-fg: #ffffff;
  --sidebar-muted: #a0a0b8;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 200ms ease;

  /* Type tokens */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d14;
    --bg-elevated: #14141f;
    --fg: #f0f0f5;
    --fg-muted: #9a9ab8;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-light: #1e3a5f;
    --border: #2a2a3e;
    --sidebar-bg: #08080f;
    --sidebar-fg: #ffffff;
    --sidebar-muted: #7a7a9a;
    --card-bg: #14141f;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d14;
  --bg-elevated: #14141f;
  --fg: #f0f0f5;
  --fg-muted: #9a9ab8;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-light: #1e3a5f;
  --border: #2a2a3e;
  --sidebar-bg: #08080f;
  --sidebar-fg: #ffffff;
  --sidebar-muted: #7a7a9a;
  --card-bg: #14141f;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.25);
  color-scheme: dark;
}

/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  padding-block: var(--space-6);
}

/* ===== Page Layout ===== */
.cv-page {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .cv-page {
    grid-template-columns: 280px 1fr;
    gap: 0;
    padding-inline: var(--space-6);
  }
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .sidebar {
    position: sticky;
    top: calc(var(--space-6) + env(safe-area-inset-top, 0px));
    max-height: calc(100vh - var(--space-6) - env(safe-area-inset-top, 0px));
    border-radius: var(--radius);
  }
}

.profile {
  text-align: center;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-6);
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: white;
  box-shadow: var(--shadow-lg);
}

.name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.title {
  font-size: 0.9rem;
  color: var(--sidebar-muted);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.85rem;
  color: var(--sidebar-muted);
  transition: color var(--transition);
}
.contact-item:hover { color: var(--sidebar-fg); }

.contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

.contact-item a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}
.contact-item a:hover { color: var(--accent); }

/* Sidebar sections */
.sidebar-section { margin-bottom: var(--space-6); }
.sidebar-section:last-child { margin-bottom: 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-tag {
  background: rgba(255,255,255,0.08);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sidebar-muted);
  transition: all var(--transition);
  border: 1px solid transparent;
}
.skill-tag:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lang-item:last-child { border-bottom: none; }

.lang-name { font-size: 0.85rem; font-weight: 500; }
.lang-level {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
}

/* ===== Main Content ===== */
.main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.section-icon {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  flex-shrink: 0;
}

.section-title-main {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ===== Timeline ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.timeline-item {
  position: relative;
  padding-left: var(--space-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 4px var(--accent);
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.role {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.company {
  color: var(--accent);
  font-weight: 500;
}

.period {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
  white-space: nowrap;
}

.location {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.description {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

.achievements {
  list-style: none;
  margin-top: var(--space-3);
  padding-left: var(--space-4);
}

.achievements li {
  position: relative;
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.7;
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
}

.achievements li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ===== Projects Grid ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.project-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.project-links {
  display: flex;
  gap: var(--space-2);
}

.project-link {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  text-decoration: none;
  transition: all var(--transition);
}

.project-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.project-link svg { width: 16px; height: 16px; }

.project-desc {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tech-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ===== Print Styles ===== */
@media print {
  body { background: white; color: black; padding: 0; }
  .cv-page { max-width: none; padding: 0; gap: 0; }
  .sidebar { box-shadow: none; page-break-inside: avoid; }
  .section { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  .project-card { box-shadow: none; border: 1px solid #ddd; }
  .project-link { display: none; }
  .avatar { background: #2563eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section-title { color: #2563eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .timeline-item::before { background: #2563eb !important; box-shadow: 0 0 0 3px white, 0 0 0 4px #2563eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .skill-tag { background: #e0e7ff !important; color: #2563eb !important; border: 1px solid #2563eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tech-tag { background: #dbeafe !important; color: #2563eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }