/* ==========================================================================
   Tufte-Inspired Academic Portfolio Theme
   A refined, scholarly aesthetic with et-book serif typography
   ========================================================================== */

/* --- Font Face Declarations --- */
@font-face {
  font-family: "et-book";
  src: url("/fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot");
  src: url("/fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"),
       url("/fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"),
       url("/fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "et-book";
  src: url("/fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot");
  src: url("/fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"),
       url("/fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"),
       url("/fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: "et-book";
  src: url("/fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot");
  src: url("/fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"),
       url("/fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"),
       url("/fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "et-book-roman-old-style";
  src: url("/fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot");
  src: url("/fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix") format("embedded-opentype"),
       url("/fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff"),
       url("/fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {

  /* Typography */
  --font-serif: "et-book", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: "Consolas", "Liberation Mono", Menlo, Courier, monospace;
  --font-sans: system-ui, -apple-system, sans-serif;
  /* Warm paper-like background */
  --color-bg: #fffff8;
  --color-bg-warm: #faf8f0;
  --color-bg-secondary: #f5f3e9;
  --color-bg-tertiary: #ede9d8;

  /* Rich ink-like text */
  --color-text: #1a1a1a;
  --color-text-secondary: #3a3a3a;
  --color-text-muted: #6b6560;
  --color-text-faint: #9a9490;

  /* Accent - deep academic blue */
  --color-accent: #2c5f8a;
  --color-accent-light: #3d7ab5;
  --color-accent-dark: #1e4266;
  --color-accent-subtle: rgba(44, 95, 138, 0.08);

  /* Borders and dividers */
  --color-border: #d4cfc4;
  --color-border-light: #e8e4d8;
  --color-border-strong: #8a8478;

  /* Cards and surfaces */
  --color-card-bg: #fffef9;
  --color-card-border: #e0dbd0;
  --color-card-shadow: rgba(30, 25, 18, 0.06);
  --color-card-shadow-hover: rgba(30, 25, 18, 0.12);

  /* Code */
  --color-code-bg: #f7f5ee;
  --color-code-text: #3a3a3a;
  --color-code-border: #ddd8cc;

  /* Timeline */
  --color-timeline: var(--color-accent);
  --color-timeline-bg: var(--color-bg-secondary);

  /* Typography */
  --font-serif: "et-book", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: "Consolas", "Liberation Mono", Menlo, Courier, monospace;
  --font-sans: system-ui, -apple-system, sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Layout */
  --max-width: 1400px;
  --content-width: 55%;
  --margin-width: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */
[data-theme="dark"] {
  --color-bg: #1a1814;
  --color-bg-warm: #1e1c16;
  --color-bg-secondary: #252320;
  --color-bg-tertiary: #2d2a25;

  --color-text: #e8e4dc;
  --color-text-secondary: #d4d0c8;
  --color-text-muted: #9a9490;
  --color-text-faint: #6b6560;

  --color-accent: #5a9fd4;
  --color-accent-light: #7bb8e0;
  --color-accent-dark: #3d7ab5;
  --color-accent-subtle: rgba(90, 159, 212, 0.1);

  --color-border: #3d3a35;
  --color-border-light: #2d2a25;
  --color-border-strong: #5a5650;

  --color-card-bg: #222019;
  --color-card-border: #33302a;
  --color-card-shadow: rgba(0, 0, 0, 0.2);
  --color-card-shadow-hover: rgba(0, 0, 0, 0.35);

  --color-code-bg: #252320;
  --color-code-text: #e8e4dc;
  --color-code-border: #3d3a35;

  --color-timeline-bg: var(--color-bg-secondary);
}

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

html {
  padding-left: calc(100vw - 100%);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  transition: background-color var(--transition), color var(--transition);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 5%;
  counter-reset: sidenote-counter;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  font-weight: 400;
}

h1::before {
  display: none;
}

h2 {
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h3 {
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
}

p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--color-text-secondary);
}

/* Subtle texture overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

[data-theme="dark"] body::before {
  opacity: 0.03;
}

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

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 1px;
  background: var(--color-border-strong);
  transition: width var(--transition);
}

h2:hover::after {
  width: 5rem;
}

h3 {
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
}

p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--color-text-secondary);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  font-weight: 400;
}

h1::before {
  display: none;
}

h2 {
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
  font-weight: 400;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 1px;
  background: var(--color-border-strong);
  transition: width var(--transition);
}

h1::before {
  display: none;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-style: italic;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2rem;
  height: 1px;
  background: var(--color-border-strong);
}

h3 {
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
}

p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--color-text-secondary);
}

h2 {
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
  font-weight: 400;
  font-family: var(--font-serif);
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.5rem;
  height: 1px;
  background: var(--color-border-strong);
  transition: width var(--transition);
}

h2:hover::after {
  width: 4.5rem;
}

h3 {
  font-style: italic;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

h4, h5, h6 {
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-secondary);
}

p {
  font-size: 1.15rem;
  line-height: 1.85;
  margin-top: 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--color-text-secondary);
  font-feature-settings: "onum" 1, "liga" 1, "kern" 1;
  hanging-punctuation: first last;
}

/* Drop cap disabled */
p:first-of-type::first-letter {
}

blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-accent);
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1.7;
}

blockquote::before {
  content: "❧";
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  opacity: 0.5;
}

blockquote p {
  margin: 0.5rem 0;
}

/* Drop cap disabled */
blockquote p:first-of-type::first-letter {
  all: initial;
}

/* Drop cap disabled */
h1 + p::first-letter,
h2 + p::first-letter,
h3 + p::first-letter {
  all: initial;
}

/* ==========================================================================
   Links - Tufte-style underline animation
   ========================================================================== */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* Underline effect for inline links */
p > a:not(.card):not(.btn),
li > a:not(.card):not(.btn) {
  background-image: linear-gradient(var(--color-bg), var(--color-bg)),
                    linear-gradient(var(--color-bg), var(--color-bg)),
                    linear-gradient(var(--color-border-strong), var(--color-border-strong));
  background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-position: 0% 93%, 100% 93%, 0% 93%;
  text-shadow: 0.03em 0 var(--color-bg), -0.03em 0 var(--color-bg),
               0 0.03em var(--color-bg), 0 -0.03em var(--color-bg),
               0.06em 0 var(--color-bg), -0.06em 0 var(--color-bg);
  transition: background var(--transition), color var(--transition);
}

p > a:hover::after,
li > a:hover::after {
  width: 100%;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  text-align: center;
  padding: 4rem 0 0;
  position: relative;
}

.header-title {
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  font-weight: 400;
  margin-bottom: 0.25rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.header-title a {
  color: var(--color-text);
  position: relative;
}

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

.header-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

/* Navigation */
.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  padding: 1.5rem 0;
  margin-bottom: 0;
  position: relative;
}

.site-nav a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition);
}

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

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

.header-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

/* Navigation */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.2rem 0;
  position: relative;
}

.site-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--color-border);
}

.site-nav a {
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.2s ease;
}

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

.site-nav a:hover::after {
  width: 100%;
}

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

.site-nav a.active::after {
  width: 100%;
}

.site-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.site-nav a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition);
}

.site-nav a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: all var(--transition);
  transform: translateX(-50%);
}

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

.site-nav a:hover::before {
  width: 100%;
}

.site-nav a.active {
  color: var(--color-text);
  font-weight: 600;
}

.site-nav a.active::before {
  width: 100%;
}

/* ==========================================================================
   Article / Content Area
   ========================================================================== */
article {
  padding: 3.5rem 0;
  position: relative;
  flex: 1;
}

article.full-width p,
article.full-width ul,
article.full-width ol {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Narrow content (Tufte-style) */
article.narrow {
  max-width: 720px;
  margin: 0 auto;
}

article.narrow p,
article.narrow ul,
article.narrow ol {
  width: 100%;
  padding-right: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 3rem 0 2rem;
  position: relative;
}

.site-footer hr {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: 0 0 1.5rem;
}

.site-footer .credits {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.site-footer .credits {
  font-size: 0.85rem;
  color: var(--color-text-faint);
  letter-spacing: 0.05em;
}

.site-footer a {
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 1px;
}

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

/* ==========================================================================
   Cards - Blog & Project listings
   ========================================================================== */
.card-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none !important;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 1px 3px var(--color-card-shadow);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--color-card-shadow-hover);
  border-color: var(--color-accent);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-body {
  padding: 1.75rem;
  flex: 1;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  line-height: 1.35;
  font-style: italic;
}

.card-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.card-footer {
  padding: 1rem 1.75rem;
  font-size: 0.8rem;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-border-light);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: auto;
}

/* ==========================================================================
   Badges / Tags
   ========================================================================== */
.badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  font-size: 0.7em;
  font-weight: 500;
  border-radius: 3px;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

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

/* ==========================================================================
   Blockquotes
   ========================================================================== */

/* ==========================================================================
   Code Blocks
   ========================================================================== */
pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  color: var(--color-code-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 2rem 0;
  position: relative;
}

pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 6px 6px 0 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background-color: var(--color-code-bg);
  color: var(--color-accent-dark);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--color-code-border);
}

[data-theme="dark"] code {
  color: var(--color-accent-light);
}

pre code {
  padding: 0;
  background: none;
  border: none;
  color: inherit;
}

/* ==========================================================================
   Tables
   ========================================================================== */
table {
  width: auto;
  margin: 2rem auto;
  border-spacing: 0;
  border-top: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  font-size: 0.95rem;
}

th {
  border-bottom: 1px solid var(--color-text);
  padding: 0.75ex 0.75em;
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

td {
  padding: 0.6em 0.75em;
  text-align: left;
  color: var(--color-text-secondary);
}

tr:hover td {
  background: var(--color-accent-subtle);
}

/* ==========================================================================
   Images
   ========================================================================== */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

article p img {
  display: inline !important;
  margin: 0 0.5rem !important;
  vertical-align: middle !important;
}

/* ==========================================================================
   Dark Mode Toggle
   ========================================================================== */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-card-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all var(--transition);
  z-index: 100;
  box-shadow: 0 2px 12px var(--color-card-shadow);
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 4px 20px var(--color-card-shadow-hover);
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline {
  position: relative;
  background-color: var(--color-timeline-bg);
  border-radius: 0 8px 8px 0;
  padding: 0.5rem 0;
  margin: 2.5rem 0;
  border: 1px solid var(--color-border-light);
  border-left: none;
}

.timeline::after {
  content: "";
  width: 3px;
  height: 100%;
  background-color: var(--color-timeline);
  position: absolute;
  left: -3px;
  top: 0;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 2rem 2.5rem;
}

.timeline-item::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--color-timeline);
  background-color: var(--color-bg);
  position: absolute;
  left: -9px;
  top: 2.3rem;
  z-index: 1;
  transition: all var(--transition);
}

.timeline-item:hover::after {
  background-color: var(--color-accent);
  transform: scale(1.3);
}

.timeline-item .date {
  font-size: 0.8rem;
  color: var(--color-text-faint);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Skill Bars
   ========================================================================== */
.skill {
  margin-bottom: 1.5rem;
  position: relative;
}

.skill-label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.skill-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
  transition: width 1s ease;
}

/* ==========================================================================
   Section Dividers
   ========================================================================== */
.section-divider {
  text-align: center;
  margin: 3rem 0;
  position: relative;
}

.section-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border-light);
}

.section-divider span {
  position: relative;
  background: var(--color-bg);
  padding: 0 1.5rem;
  color: var(--color-text-faint);
  font-size: 1.2rem;
  letter-spacing: 0.3em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  body {
    padding: 0 6%;
  }

  .site-header {
    padding: 2.5rem 0 0;
  }

  .header-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.25rem 0;
  }

  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
  }

  .card-group {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .theme-toggle {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  article {
    padding: 2rem 0;
  }

  h2::after {
    width: 2rem;
  }

  h2:hover::after {
    width: 3rem;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 1rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-footer {
    padding: 0.75rem 1.25rem;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .theme-toggle {
    display: none;
  }

  .site-header, .site-footer {
    display: none;
  }

  body {
    font-size: 12pt;
    background: white;
    color: black;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in-delay-1 { animation-delay: 0.08s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.16s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.24s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.32s; opacity: 0; }

/* Page load animation for header */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  animation: slideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Decorative ornament */
.ornament {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--color-text-faint);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  opacity: 0.5;
}

/* ==========================================================================
   Syntax Highlighting (Shiki)
   ========================================================================== */
.highlight {
  margin-bottom: 1.5rem;
}

.highlight .c { color: #998; font-style: italic; }
.highlight .err { color: #a61717; background-color: #e3d2d2; }
.highlight .k { font-weight: bold; }
.highlight .o { font-weight: bold; }
.highlight .cm { color: #998; font-style: italic; }
.highlight .cp { color: #999; font-weight: bold; }
.highlight .c1 { color: #998; font-style: italic; }
.highlight .cs { color: #999; font-weight: bold; font-style: italic; }
.highlight .gd { color: #000; background-color: #fdd; }
.highlight .gd .x { color: #000; background-color: #faa; }
.highlight .ge { font-style: italic; }
.highlight .gr { color: #a00; }
.highlight .gh { color: #999; }
.highlight .gi { color: #000; background-color: #dfd; }
.highlight .gi .x { color: #000; background-color: #afa; }
.highlight .go { color: #888; }
.highlight .gp { color: #555; }
.highlight .gs { font-weight: bold; }
.highlight .gu { color: #aaa; }
.highlight .gt { color: #a00; }
.highlight .kc { font-weight: bold; }
.highlight .kd { font-weight: bold; }
.highlight .kp { font-weight: bold; }
.highlight .kr { font-weight: bold; }
.highlight .kt { color: #458; font-weight: bold; }
.highlight .m { color: #099; }
.highlight .s { color: #d14; }
.highlight .na { color: #008080; }
.highlight .nb { color: #0086B3; }
.highlight .nc { color: #458; font-weight: bold; }
.highlight .no { color: #008080; }
.highlight .ni { color: #800080; }
.highlight .ne { color: #900; font-weight: bold; }
.highlight .nf { color: #900; font-weight: bold; }
.highlight .nn { color: #555; }
.highlight .nt { color: #000080; }
.highlight .nv { color: #008080; }
.highlight .ow { font-weight: bold; }
.highlight .w { color: #bbb; }
