:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --text-primary: #e9e9e9;
  --text-secondary: #cccccc;
  --accent-primary: #ba9fd1;
  --border-color: #555;
  --dot-color: rgba(233, 233, 233, 0.08);
  --highlight: rgba(120, 220, 140, 0.28);
}

[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #dddddd;
  --text-primary: #1c1c1c;
  --text-secondary: #666666;
  --accent-primary: #5a67d8;
  --border-color: #d1d5db;
  --dot-color: rgba(29, 29, 31, 0.1);
  --highlight: rgba(120, 220, 140, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Ubuntu", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1.15px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  font-size: 1em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 20px 20px;
}

h1,
h2,
h3 {
  margin-bottom: 1rem;
  font-weight: normal;
}

h2 {
  margin-top: 2rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--text-secondary);
}

strong {
  font-weight: 600;
}

.hire {
  background: linear-gradient(
    180deg,
    transparent 8%,
    var(--highlight) 8%,
    var(--highlight) 92%,
    transparent 92%
  );
  padding: 0 0.25em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Header */
.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.header-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  flex: 0 0 auto;
}

header h1 {
  text-align: center;
  margin: 0.25em 0 0;
  font-size: 3em;
  line-height: 1.08;
}

.header-top h1 {
  margin: 0;
}

header .subtitle {
  text-align: center;
  margin: 0.35em 0 0;
  font-size: 1.5em;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-secondary);
}

.header-links {
  text-align: center;
  margin: 0.65em 0 0;
  font-size: 0.85em;
}

.header-links a {
  margin: 0 0.125em;
  text-decoration: none;
}

.header-links a:hover {
  text-decoration: underline;
}

.header-separator {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1em 0 1.4em 0;
}

header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
}

header nav a {
  font-size: 0.8em;
  padding: 7px 12px;
  background-color: var(--bg-secondary);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  transition: color 0.2s ease, box-shadow 0.2s ease;
}

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

header nav a.active {
  color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

/* Main */
main {
  margin-top: 2.2rem;
}

main h1 {
  font-size: 2em;
}

/* Skills */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem 2.5rem;
}

.skill-category-label {
  font-size: 0.62em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  margin: 0 0 0.6em;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list li {
  font-size: 0.7em;
  padding: 4px 10px;
  background-color: var(--bg-secondary);
  border-radius: 3px;
  color: var(--text-primary);
}

/* Experience */
.job {
  margin-bottom: 1.8rem;
}

.job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.job-head h3 {
  font-size: 1.05em;
  margin: 0;
}

.job-period {
  font-size: 0.66em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.job-org {
  margin: 0.1rem 0 0.6rem;
  color: var(--accent-primary);
  font-size: 0.9em;
}

.job-points {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.job-points li {
  margin-bottom: 0.3rem;
}

/* Certifications */
.cert-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
  color: var(--text-secondary);
  font-size: 0.88em;
}

.cert-list li {
  margin-bottom: 0.35rem;
}

/* Notes (collapsible) */
details {
  margin-bottom: 0.65em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65em;
}

details summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-left: 1.5em;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "\25B2";
  position: absolute;
  left: 0.1em;
  top: 0.64em;
  transition: transform 0.2s ease;
  transform: rotate(90deg);
  color: inherit;
  font-size: 0.8em;
}

details[open] summary::before {
  transform: rotate(180deg);
}

details summary h3 {
  display: inline;
  margin: 0;
  font-size: 1.05em;
}

.collapsible-content {
  margin-top: 0.8em;
  padding-left: 1.5em;
  color: var(--text-secondary);
}

/* Notes layout */
.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.notes-column {
  min-width: 0;
}

.haiku-column {
  min-width: 0;
  padding-left: 2.5rem;
  border-left: 1px solid var(--border-color);
}

.haiku-column h2 {
  margin-top: 0;
  font-size: 1.2em;
}

.haiku-title {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 1px dashed var(--accent-primary);
  padding-bottom: 0.1em;
}

.haiku-title::after {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: 0.5em;
  vertical-align: middle;
  font-size: 0.55em;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 50%;
}

.haiku-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 220px;
  padding: 0.85em 1.1em;
  font-size: 0.6em;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-primary);
  background: var(--bg-secondary);
  background: color-mix(in srgb, var(--bg-secondary) 70%, transparent);
  border: 1px solid var(--accent-primary);
  border-radius: 5px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  pointer-events: none;
  z-index: 10;
}

.haiku-tip::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 14px;
  width: 9px;
  height: 9px;
  background: inherit;
  border-bottom: 1px solid var(--accent-primary);
  border-right: 1px solid var(--accent-primary);
  transform: rotate(45deg);
}

.haiku-title:hover .haiku-tip,
.haiku-title:focus .haiku-tip,
.haiku-title:focus-within .haiku-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.haiku {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.8rem;
  font-style: italic;
  color: var(--text-primary);
}

.haiku-author {
  margin: 0.4rem 0 0;
  font-style: normal;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Projects */
.project {
  margin-bottom: 2rem;
}

.project h3 {
  font-size: 1.1em;
  margin: 0 0 0.25rem;
}

.project-meta {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
}

.project p {
  margin: 0;
}

/* Footer */
footer {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
}

.copyright {
  font-size: 0.7em;
  color: var(--text-secondary);
}

.theme-toggle-container {
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: flex;
  cursor: pointer;
}

.theme-option {
  padding: 8px 12px;
  font-size: 0.55em;
  transition: all 0.3s ease;
  user-select: none;
  border: 2px solid transparent;
}

.theme-option.dark {
  background-color: #2a2a2a;
  color: #e9e9e9;
}

.theme-option.light {
  background-color: #f5f5f5;
  color: #2c2c2c;
}

.theme-option.active {
  border-color: var(--accent-primary);
}

@media (max-width: 700px) {
  body {
    font-size: 0.9em;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .notes-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .haiku-column {
    padding-left: 0;
    padding-top: 1.5rem;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }

  header nav {
    gap: 12px;
  }

  header h1 {
    font-size: 2.4em;
  }

  .header-top {
    gap: 14px;
  }

  .header-photo {
    width: 68px;
    height: 68px;
    border-width: 2px;
  }

  header .subtitle {
    font-size: 1.2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
