/* ── Tokens ── */
:root {
  --radius: 3px;
  --transition: 0.2s ease;
}

[data-theme='dark'] {
  --bg: #0d0d0d;
  --dark-icon-fix: invert(1);
  --pill-bg: #1e1e1e;
  --pill-bg-hover: #272727;
  --pill-border: rgba(255, 255, 255, 0.1);
  --pill-text: rgba(240, 237, 232, 0.75);
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --border: rgba(255, 255, 255, 0.07);
  --text: #f0ede8;
  --text-dim: rgba(240, 237, 232, 0.45);
  --text-mid: rgba(240, 237, 232, 0.7);
  --accent: #c8b89a;
  --accent-dim: rgba(200, 184, 154, 0.12);
}

[data-theme='light'] {
  --bg: #f7f5f1;
  --dark-icon-fix: none;
  --pill-bg: #ffffff;
  --pill-bg-hover: #f0ede8;
  --pill-border: rgba(0, 0, 0, 0.12);
  --pill-text: rgba(26, 26, 26, 0.7);
  --bg-2: #e2ddd6;
  --bg-3: #d6d0c7;
  --border: rgba(0, 0, 0, 0.14);
  --text: #1a1a1a;
  --text-dim: rgba(26, 26, 26, 0.8);
  --text-mid: rgba(26, 26, 26, 0.65);
  --accent: #7c5c3a;
  --accent-dim: rgba(124, 92, 58, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background-color: var(--bg);
  background-size: 20px 20px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.75;
  transition:
    background var(--transition),
    color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  transition: background var(--transition);
}

.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-name {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  text-transform: uppercase;
}

.topbar-name span {
  color: var(--accent);
}

.theme-btn {
  width: 90px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition:
    border-color var(--transition),
    color var(--transition);
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero ── */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-label {
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 13px;
  color: var(--text-mid);
  max-width: 520px;
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-link {
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}
.hero-link:hover {
  color: var(--accent);
}
.hero-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ── Sections ── */
section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 32px;
}

.section-prompt {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── About ── */
.about-text {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.85;
  max-width: 600px;
}

.about-text p + p {
  margin-top: 14px;
}

.about-text strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Experience / Projects ── */
.entry + .entry {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.entry-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.entry-period {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 2px;
}

.entry-sub {
  font-size: 11.5px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 400;
}

.entry-desc {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.8;
}

.entry-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 10px;
  gap: 6px;
}

.tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  letter-spacing: 0.04em;
  background: var(--bg-2);
  transition:
    border-color var(--transition),
    color var(--transition);
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.entry-links {
  display: flex;
  align-items: baseline;
  gap: 2em;
}

.entry-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-decoration: underline;
  transition: color var(--transition);
}
.entry-link:hover {
  color: var(--accent);
}
.entry-link svg {
  width: 11px;
  height: 11px;
}

.entry-link.entry-link-certificate {
  margin-top: 0;
  position: relative;
  top: 1px;
}

/* ── Skills / Pill badges ── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px 8px 15px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 15px;
  transition:
    border-color var(--transition),
    background var(--transition);
  cursor: default;
  line-height: 1;
}
.skill-badge:hover {
  border-color: var(--accent);
  background: var(--pill-bg-hover);
}

.skill-badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.skill-badge span {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--pill-text);
  white-space: nowrap;
  line-height: 18px;
}

/* ── Education ── */
.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.edu-degree {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.edu-year {
  font-size: 11px;
  color: var(--text-dim);
}
.edu-inst {
  font-size: 12px;
  color: var(--accent);
  margin-top: 3px;
}

/* ── Footer ── */
footer {
  padding: 40px 0 56px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 11px;
  color: var(--text-dim);
}

.footer-copy span {
  color: var(--accent);
}

.footer-status {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf82;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.flex {
  display: flex;
  align-items: baseline;
  gap: 2em;
}

/* ── Utilities ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 0 40px;
  }
  section {
    padding: 40px 0;
  }
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none;
  }
}
