/* ==========================================================================
   Andrew R. Tawfeek — Personal Website Stylesheet
   Custom CSS only — no frameworks
   Font: Inter (body), JetBrains Mono (code/badges)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties — Dark Mode (default)
   -------------------------------------------------------------------------- */
:root {
  /* Background layers */
  --bg-base:        #0f1117;
  --bg-surface:     #161b27;
  --bg-elevated:    #1e2433;
  --bg-overlay:     #252c3d;

  /* Borders */
  --border-subtle:  #2a3147;
  --border-medium:  #374160;

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #9aa5be;
  --text-muted:     #5f6b85;
  --text-inverse:   #0f1117;

  /* Accent — muted teal/slate-blue */
  --accent:         #5b8fa8;
  --accent-hover:   #7ab0cb;
  --accent-subtle:  rgba(91, 143, 168, 0.12);
  --accent-border:  rgba(91, 143, 168, 0.35);

  /* Publication left border accent */
  --pub-accent:     #4a7c91;

  /* Tag / badge */
  --badge-bg:       #1e2d3a;
  --badge-text:     #7ab0cb;
  --badge-border:   rgba(91, 143, 168, 0.25);

  /* Nav */
  --nav-bg:         rgba(15, 17, 23, 0.92);
  --nav-border:     #1e2433;

  /* Sidebar */
  --sidebar-width:  300px;

  /* Typography */
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;
  --font-size-html:     15px;       /* 0. Root (html) font size — rem units scale from this */
  --font-size-body:     15px;       /* 1. Global body text size */
  --font-size-bio:      0.95rem;    /* 2. About/bio section text size */
  --font-size-pyscript: 0.9rem;     /* 3. PyScript output text size */
  --font-size-code:     0.85em;     /* 4. Inline code / code block text size */

  /* Spacing */
  --nav-height:     60px;

  /* Transitions */
  --transition:     0.2s ease;
  --transition-slow: 0.35s ease;
}

/* --------------------------------------------------------------------------
   Light Mode overrides
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-base:        #f8f7f4;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f2f1ee;
  --bg-overlay:     #e8e7e3;

  --border-subtle:  #e0ddd8;
  --border-medium:  #c8c5bf;

  --text-primary:   #1a1d26;
  --text-secondary: #4a5068;
  --text-muted:     #8a90a2;
  --text-inverse:   #f8f7f4;

  --accent:         #3d7a96;
  --accent-hover:   #2a6282;
  --accent-subtle:  rgba(61, 122, 150, 0.08);
  --accent-border:  rgba(61, 122, 150, 0.3);

  --pub-accent:     #3d7a96;

  --badge-bg:       #e8f0f4;
  --badge-text:     #2a6282;
  --badge-border:   rgba(61, 122, 150, 0.2);

  --nav-bg:         rgba(248, 247, 244, 0.94);
  --nav-border:     #e0ddd8;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: var(--font-size-html);
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

code, .mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-code);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Navigation Bar
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Site wordmark / logo */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.nav-brand:hover { color: var(--accent); }

/* Animated logo next to name */
.nav-logo {
  height: 35px;
  width: auto;
  vertical-align: middle;
  background: transparent;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .nav-logo {
  filter: invert(1);
  mix-blend-mode: screen;
}

/* Spacer pushes links right */
.nav-spacer { flex: 1; }

/* Page tab links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Social icons in nav */
.nav-social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-subtle);
}

.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.nav-social a:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

.nav-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 0.25rem;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.theme-toggle .icon-sun {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Icon visibility: show sun in dark mode, moon in light */
.icon-sun  { display: block; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Hamburger button — mobile only */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 0.5rem;
  transition: color var(--transition), background var(--transition);
}

.nav-hamburger:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Mobile nav drawer */
.nav-mobile-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem 1rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-mobile-drawer.open { display: flex; }

.nav-mobile-drawer a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-mobile-drawer a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-mobile-drawer a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* --------------------------------------------------------------------------
   Page Layout — Offset for fixed nav
   -------------------------------------------------------------------------- */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.page-content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* --------------------------------------------------------------------------
   Home Page — Sidebar + Main Two-Column Layout
   -------------------------------------------------------------------------- */
.home-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 3rem;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

/* Profile photo / avatar */
.sidebar-photo {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.sidebar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Initials avatar — shown when no photo */
.avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 3rem;
  font-weight: 600;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-overlay));
  letter-spacing: -0.02em;
  user-select: none;
}

.sidebar-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.sidebar-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.sidebar-affiliation {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Sidebar social icons */
.sidebar-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.sidebar-social a:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

.sidebar-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

/* CV download button */
.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}

.btn-cv:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-cv svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.main-content {
  min-width: 0; /* prevent grid blowout */
}

/* Section headings */
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.content-section {
  margin-bottom: 2.75rem;
}

/* --------------------------------------------------------------------------
   Bio
   -------------------------------------------------------------------------- */
.bio-text {
  font-size: var(--font-size-bio);
  line-height: 1.75;
  color: var(--text-secondary);
}

.bio-text p { margin-bottom: 0.85rem; }

/* --------------------------------------------------------------------------
   Research Interest Badges
   -------------------------------------------------------------------------- */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.interest-tag:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

/* --------------------------------------------------------------------------
   News Timeline
   -------------------------------------------------------------------------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.05rem;
}

.news-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.news-text a { color: var(--accent); }
.news-text a:hover { color: var(--accent-hover); }

/* --------------------------------------------------------------------------
   Publication Cards
   -------------------------------------------------------------------------- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pub-card {
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--pub-accent);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.pub-card:hover {
  border-color: var(--accent-border);
  border-left-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateX(2px);
}

.pub-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.pub-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.pub-title a:hover { color: var(--accent); }

.pub-authors {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.pub-venue {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.55rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-link {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: 5px;
  font-size: 0.73rem;
  font-family: var(--font-mono);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

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

/* Status badge */
.pub-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 500;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.pub-status.in-prep {
  background: rgba(94, 108, 150, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(94, 108, 150, 0.25);
}

.pub-status.under-revision {
  background: rgba(180, 140, 70, 0.12);
  color: #b8975a;
  border: 1px solid rgba(180, 140, 70, 0.25);
}

.pub-status.submitted {
  background: rgba(100, 140, 200, 0.12);
  color: #7a9ec7;
  border: 1px solid rgba(100, 140, 200, 0.25);
}

.pub-status.accepted {
  background: rgba(70, 160, 110, 0.12);
  color: #5aab7d;
  border: 1px solid rgba(70, 160, 110, 0.25);
}

[data-theme="light"] .pub-status.accepted {
  color: #2e7d5a;
}

[data-theme="light"] .pub-status.submitted {
  color: #3a6a9e;
}

[data-theme="light"] .pub-status.under-revision {
  color: #8a6020;
}

/* --------------------------------------------------------------------------
   Projects Page — Card Grid
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

[data-theme="light"] .project-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Project thumbnail area */
.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 8;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.project-thumb-placeholder svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.5;
}

.project-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: 5px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.btn-project {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-project-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-project-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-project-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-project-secondary:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

.btn-project svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Tutorials Page
   -------------------------------------------------------------------------- */
.tutorials-note {
  padding: 0.85rem 1.1rem;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.tutorials-note strong { color: var(--text-primary); }

.tutorials-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tutorial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.tutorial-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-elevated);
  transform: translateX(3px);
}

.tutorial-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tutorial-date {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.tutorial-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tutorial-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.tutorial-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.tutorial-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tutorial-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.25rem;
  transition: gap var(--transition), color var(--transition);
}

.tutorial-read-more:hover {
  color: var(--accent-hover);
  gap: 0.5rem;
}

.tutorial-coming-soon {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: rgba(94, 108, 150, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(94, 108, 150, 0.2);
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   CV Page
   -------------------------------------------------------------------------- */
.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cv-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cv-embed-area {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  min-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-embed-area iframe {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

.cv-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  text-align: center;
}

.cv-placeholder svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.5;
}

.cv-placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-inner a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (max 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar-photo {
    width: 140px;
    height: 140px;
    margin-bottom: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (max 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --nav-height: 56px;
  }

  .nav-links { display: none; }
  .nav-social { display: none; }
  .nav-hamburger { display: flex; }

  .page-content {
    padding: 1.75rem 1rem 3rem;
  }

  .home-layout {
    gap: 1.5rem;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar-photo {
    width: 110px;
    height: 110px;
  }

  .news-item {
    grid-template-columns: 70px 1fr;
    gap: 0.5rem;
  }

  .pub-card {
    padding: 0.85rem 0.85rem 0.85rem 0.9rem;
  }

  .cv-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cv-embed-area { min-height: 500px; }
  .cv-embed-area iframe { height: 600px; }

  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.15rem; }

  .page-header h1 { font-size: 1.45rem; }
}

/* --------------------------------------------------------------------------
   Print styles
   -------------------------------------------------------------------------- */
@media print {
  .site-nav,
  .nav-mobile-drawer,
  .theme-toggle { display: none !important; }

  .page-wrapper { padding-top: 0; }

  body {
    background: white;
    color: black;
  }
}
