:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --panel-light: #121212;
  --white: #ffffff;
  --white-bright: #ffffff;
  --dim: #555555;
  --dim-line: #222222;
  --text: #d0d0d0;
  --text-bright: #ffffff;
  --muted: #808080;
  --border: #242424;
  --border-bright: #444444;
  --glow: 0 0 12px rgba(255, 255, 255, 0.06);
  --radius: 0px;

  --font: "Fira Code", "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  
  --s-xs: 0.5rem;
  --s-sm: 0.75rem;
  --s-md: 1rem;
  --s-lg: 1.5rem;
  --s-xl: 2rem;
  --s-2xl: 3rem;
}

body.light-mode,
body[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f5f5f5;
  --panel-light: #eeeeee;
  --white: #000000;
  --white-bright: #000000;
  --dim: #777777;
  --dim-line: #dcdcdc;
  --text: #1a1a1a;
  --text-bright: #000000;
  --muted: #666666;
  --border: #d0d0d0;
  --border-bright: #888888;
  --glow: 0 0 12px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

::selection {
  background: var(--white);
  color: var(--bg);
}

a {
  color: var(--white-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease, background 0.15s ease;
}

a:hover {
  background: var(--white);
  color: var(--bg);
  text-decoration: none;
}

/* Controls */
.site-controls {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

body.light-mode .site-controls {
  background: rgba(255, 255, 255, 0.95);
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-link, a.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--border-bright);
  background: var(--panel);
  border-radius: var(--radius);
  text-decoration: none;
}

.back-link:hover, a.back:hover {
  background: var(--white);
  color: var(--bg);
  border-color: var(--white);
}

.language-switch {
  display: inline-flex;
  gap: 4px;
}

.language-switch button,
.theme-toggle,
button.lang-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.language-switch button:hover,
.theme-toggle:hover,
button.lang-btn:hover {
  color: var(--white);
  border-color: var(--white);
}

.language-switch button.is-active,
.language-switch button[aria-pressed="true"] {
  background: var(--white);
  color: var(--bg);
  border-color: var(--white);
  font-weight: 600;
}

/* Content */
.wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.article-header {
  margin-bottom: 36px;
  padding: 20px 22px;
  border: 1px solid var(--border-bright);
  background: var(--panel);
  border-radius: var(--radius);
  position: relative;
  box-shadow: var(--glow);
}

.article-header::before {
  content: "╔═[ DOCUMENT_VIEWER ]═══════════════════════════════════════════════════════╗";
  display: block;
  font-size: 0.72rem;
  color: var(--dim);
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.article-title {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 600;
  color: var(--white-bright);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.article-date {
  color: var(--white);
  font-weight: 600;
}

.article-meta span::before {
  content: "[ ";
  color: var(--dim);
}
.article-meta span::after {
  content: " ]";
  color: var(--dim);
}

.section-heading {
  margin: 44px 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading::before {
  content: "┌──[ ";
  color: var(--dim);
}
.section-heading::after {
  content: " ]";
  color: var(--dim);
}

p {
  margin-bottom: 18px;
  color: var(--text);
}

p strong {
  color: var(--text-bright);
  font-weight: 600;
}

em {
  color: var(--text-bright);
  font-style: italic;
}

blockquote, .quote-box {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--white);
  background: var(--panel);
  border-radius: var(--radius);
  color: var(--text);
  font-style: normal;
}

blockquote::before {
  content: ":: ";
  color: var(--dim);
  font-weight: bold;
}

pre.ascii-diagram, pre.ascii-box {
  background: #050505;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0 26px;
  font-family: var(--font);
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  line-height: 1.45;
  color: var(--white);
  overflow-x: auto;
}

body.light-mode pre.ascii-diagram,
body.light-mode pre.ascii-box {
  background: #f0f0f0;
  color: #000000;
  border-color: #cccccc;
}

.cv-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.cv-item:hover {
  border-color: var(--white);
  box-shadow: var(--glow);
}

.cv-title {
  color: var(--white-bright);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cv-title::before {
  content: "➜ ";
  color: var(--dim);
}

.cv-detail {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.6;
}

.project {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project::before {
  content: "[✓] ";
  color: var(--dim);
}

.skill-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 8px;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.skill-name {
  color: var(--white);
  font-weight: 500;
}
.skill-name::before {
  content: "$ ";
  color: var(--dim);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.footer-glow, .ascii-eof {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.ascii-eof::before {
  content: "└──[ END OF FILE // EOF ]";
  color: var(--dim);
}

@media (max-width: 600px) {
  .site-controls {
    padding: 8px 12px;
  }
  .wrapper {
    padding: 24px 14px 60px;
  }
  .skill-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .article-title {
    font-size: 1.3rem;
  }
  .section-heading {
    font-size: 0.95rem;
  }
}
