@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Syne:wght@500;600;700;800&family=JetBrains+Mono:wght@300;400;500&family=Source+Sans+3:wght@300;400;500;600&display=swap');

:root {
  --bg:           #f2f4f8;
  --surface:      #ffffff;
  --card:         #f7f8fc;
  --card-hover:   #eef1f8;
  --border:       rgba(0,0,0,0.08);
  --border-warm:  rgba(37,99,200,0.22);
  --text:         #1a2133;
  --text-dim:     #6b7a99;
  --text-mid:     #4a5874;
  --accent:       #2563c8;
  --accent-soft:  rgba(37,99,200,0.07);
  --accent-glow:  rgba(37,99,200,0.15);
  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-head:    'Syne', system-ui, sans-serif;
  --ff-body:    'Source Sans 3', system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.72;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(37,99,200,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* ── SIDEBAR ── */
.sidebar {
  position: sticky;
  top: 36px;
  height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeUp 0.45s ease both;
}

.profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.profile-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
  transition: transform 0.3s ease;
}

.profile-img:hover { transform: scale(1.05); }

.profile-name {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-align: center;
  color: #0f172a;
}

.profile-role {
  font-family: var(--ff-mono);
  font-size: 0.67rem;
  color: var(--accent);
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.profile-location {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.03em;
}

.socials { display: flex; justify-content: center; gap: 8px; }

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.social-link:hover {
  border-color: var(--border-warm);
  color: var(--accent);
  background: var(--accent-soft);
}

.sb-section { display: flex; flex-direction: column; gap: 10px; }

.sb-label {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sb-text { font-size: 0.875rem; color: var(--text-mid); line-height: 1.68; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 400;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-warm);
  color: var(--accent);
  background: var(--accent-soft);
  letter-spacing: 0.02em;
  transition: background 0.15s;
}

.tag:hover { background: var(--accent-glow); }

.sb-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }

.sb-list li {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-mid);
  gap: 6px;
}

.sb-list .meta {
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-left: auto;
  letter-spacing: 0.03em;
}

/* ── MAIN ── */
.main-content { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  animation: fadeUp 0.5s ease both;
}

.card:nth-child(1) { animation-delay: 0.07s; }
.card:nth-child(2) { animation-delay: 0.14s; }
.card:nth-child(3) { animation-delay: 0.21s; }

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

.section-hd { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }

.section-title {
  font-family: var(--ff-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* ── Project grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.22s, transform 0.22s, background 0.22s;
}

.proj-card:hover {
  border-color: var(--border-warm);
  transform: translateY(-4px);
  background: var(--card-hover);
}

.proj-img {
  width: 100%;
  height: 144px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

.proj-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.proj-title {
  font-family: var(--ff-head);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.proj-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.65; flex: 1; }

.proj-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-top: 2px;
}

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--border-warm);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
}

.more-btn:hover { background: var(--accent-glow); border-color: var(--accent); }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; }

.tl-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 16px 0 16px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tl-entry:last-child { border-bottom: none; padding-bottom: 0; }

.tl-entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.tl-entry:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 31px;
  bottom: -1px;
  width: 1px;
  background: linear-gradient(to bottom, var(--border-warm), var(--border));
}

.tl-title { font-family: var(--ff-head); font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.tl-desc { font-size: 0.84rem; color: var(--text-dim); line-height: 1.68; margin-bottom: 8px; }
.tl-desc a { color: var(--accent); text-decoration: none; }
.tl-desc a:hover { text-decoration: underline; }

.tl-date {
  font-family: var(--ff-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 3px;
  letter-spacing: 0.02em;
}

/* ── DETAIL PAGES ── */
.details-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 32px 36px;
  animation: fadeUp 0.45s ease both;
}

.back-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-arrow:hover { color: var(--accent); }

.details-block h2 {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 20px;
}

.details-block h3 {
  font-family: var(--ff-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.details-block h4 {
  font-family: var(--ff-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin: 18px 0 10px;
}

.project-link-row {
  margin: 6px 0 14px;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #3a2b00;
  border: 1px solid #e2a900;
  background: linear-gradient(135deg, #ffd85a 0%, #ffcb2f 100%);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  box-shadow: 0 4px 12px rgba(255, 203, 47, 0.35);
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.project-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 7px 14px rgba(255, 203, 47, 0.42);
  text-decoration: none;
}

.project-link-icon {
  height: 18px;
  width: auto;
  display: block;
}

.details-block p { font-size: 0.9rem; color: var(--text-mid); line-height: 1.78; margin-bottom: 12px; }
.details-block p strong { color: var(--text); font-weight: 600; }
.details-block p em { font-style: italic; }
.details-block a { color: var(--accent); text-decoration: none; }
.details-block a:hover { text-decoration: underline; }

.details-block ul, .details-block ol {
  padding-left: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.details-block li { font-size: 0.875rem; color: var(--text-mid); line-height: 1.7; }
.details-block li strong { color: var(--text); }

.details-block code {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  background: var(--accent-soft);
  border: 1px solid var(--border-warm);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

.details-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 16px 0 20px;
  display: block;
}

.figure-grid { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 20px; }

.figure { flex: 1 1 46%; text-align: center; }

.figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.caption {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 7px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.table-wrapper {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.styled-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }

.styled-table thead tr { background: transparent; color: var(--text); text-align: left; border-bottom: 2px solid var(--text); }

.styled-table th {
  padding: 11px 14px;
  font-family: var(--ff-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.styled-table td { padding: 10px 14px; color: var(--text-mid); font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-child(even) { background: var(--card); }

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 16px 0 20px;
}

.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px 32px;
  font-family: var(--ff-mono);
  font-size: 0.67rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

footer::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--border);
  margin: 0 auto 20px;
  max-width: 1160px;
}

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  .container { grid-template-columns: 1fr; padding: 20px 16px 48px; gap: 16px; }
  .sidebar { position: static; }
  .projects-grid { grid-template-columns: 1fr; }
  .card, .details-block { padding: 22px 18px 20px; }
  .figure { flex: 1 1 100%; }
  .details-block h2 { font-size: 1.5rem; }
}
