/* Modern Tech Minimal Styling (v1.2.0) */

:root {
  --bg: #090a0f;
  --surface: #12141a;
  --surface-hover: #181b24;
  --border: #1f2330;
  --border-focus: #3b82f6;
  --text: #f1f5f9;
  --text-muted: #8b92a5;
  --text-faint: #4e5569;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --badge-bg: rgba(59, 130, 246, 0.12);
  --badge-text: #93c5fd;
  --max-width: 760px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard Variable", Pretendard, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Header & Navigation */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.site-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background-color: var(--surface);
  border: 1px solid var(--border);
}

.lang-switch a,
.lang-switch .active {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.2;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lang-switch a {
  color: var(--text-muted);
}

.lang-switch a:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

.lang-switch .active {
  color: var(--accent);
  background-color: var(--badge-bg);
  font-weight: 700;
}

.lang-switch .sep {
  display: none;
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#theme-toggle:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-focus);
}

#theme-icon {
  width: 17px;
  height: 17px;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.hero-bio h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-bio p {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sections & Repositories */
.section-title {
  margin: 48px 0 16px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.group-title {
  margin: 32px 0 12px;
  font-size: 17px;
  font-weight: 600;
}

.group-title a {
  color: var(--text);
}

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

/* Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14.5px;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

th {
  background-color: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: var(--surface-hover);
}

td a {
  font-weight: 600;
  color: var(--accent);
}

td a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.col-repo {
  white-space: nowrap;
  width: 220px;
}

.col-desc {
  color: var(--text-muted);
}

.talk-heading {
  font-weight: 500;
  line-height: 1.5;
}

.talk-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.talk-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.talk-title {
  color: var(--text);
  font-weight: 500;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  color: var(--text-muted);
  margin-left: 4px;
  padding: 2px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pdf-btn:hover {
  color: var(--accent);
  background-color: var(--badge-bg);
  text-decoration: none;
}

.talk-subtitle {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}

.talk-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 2px;
  white-space: nowrap;
}

.talk-event {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.talks-wrapper {
  border: none;
  background: transparent;
  border-radius: 0;
  overflow-x: visible;
}

.talks-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.talks-table .year-header {
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  text-align: left;
  padding: 40px 10px 12px;
  border-top: none;
  border-bottom: 1px solid var(--border);
}

.talks-table tr:first-child .year-header {
  padding-top: 8px;
}

.talks-table tbody tr.year-row:hover {
  background: transparent;
}

.talks-table tr.talk-row td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  background: transparent;
  transition: background-color 0.15s ease;
}

.talks-table tr.talk-row:hover td {
  background-color: var(--surface-hover);
}

.talks-table tr.talk-row:hover td:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.talks-table tr.talk-row:hover td:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.talks-table .col-event {
  width: 32%;
  min-width: 180px;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .col-repo {
    width: auto;
  }
  .talks-table,
  .talks-table tbody,
  .talks-table tr,
  .talks-table td,
  .talks-table th {
    display: block;
  }
  .talks-table .year-header {
    padding: 32px 0 10px;
  }
  .talks-table tr:first-child .year-header {
    padding-top: 8px;
  }
  .talks-table tr.talk-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .talks-table tr.talk-row:hover {
    background: transparent;
  }
  .talks-table tr.talk-row td {
    padding: 0;
    border-bottom: none;
  }
  .talks-table tr.talk-row:hover td {
    background: transparent;
  }
  .talks-table .col-event {
    width: 100%;
    min-width: 0;
    margin-top: 6px;
  }
  .talks-table .talk-date {
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 0;
  }
  .talks-table .talk-date::after {
    content: " · ";
  }
  .talks-table .talk-event {
    display: inline;
  }
}
