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

/* ---- Theme variables ---- */
:root {
  --bg: #ffffff;
  --bg-card: #f6f8fa;
  --text: #1f2328;
  --text-secondary: #656d76;
  --accent: #0969da;
  --border: #d0d7de;
  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-card: #161b22;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --border: #30363d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-card: #161b22;
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --border: #30363d;
  }
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Header ---- */
.header {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.header__controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.header__content {
  text-align: center;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ---- Buttons (lang, theme) ---- */
.btn-lang,
.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-lang {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
}

.btn-theme {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-lang:hover,
.btn-theme:hover {
  border-color: var(--accent);
}

/* theme icon toggle */
.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

/* ---- Sections ---- */
.section {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- About ---- */
.about p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.about__heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.about__list {
  list-style: none;
  margin-bottom: 0.5rem;
}

.about__list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about__list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

/* ---- Timeline (experience, education) ---- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline__item {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.timeline__period {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 100px;
  padding-top: 0.1rem;
}

.timeline__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline__company {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.timeline__details {
  list-style: none;
  margin-top: 0.5rem;
}

.timeline__details li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline__details li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--accent);
}

@media (max-width: 480px) {
  .timeline__item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timeline__period {
    min-width: auto;
  }
}

/* ---- Project cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.card__badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.card__stats {
  list-style: none;
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.card__stats li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.6;
}

.card__stats li::before {
  content: "\2022";
  position: absolute;
  left: 0;
}

.card__link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* ---- Note ---- */
.note {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- Contacts ---- */
.contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.contact:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.contact svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

/* ---- Footer ---- */
.footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .header__subtitle {
    font-size: 0.95rem;
  }

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

  .contacts {
    flex-direction: column;
  }
}

/* ---- Language toggle (hide/show) ---- */
[hidden] {
  display: none !important;
}
