/* css/style.css */

:root {
  color-scheme: dark;
  --page-bg: #121416;
  --text: #e6e2dc;
  --heading: #f3eee7;
  --muted-text: #b7b0a7;
  --link: #79b8ff;
  --link-hover: #a8d1ff;
  --border: #34383d;
  --surface: #1a1d20;
  --surface-subtle: #171a1d;
  --overlay: rgba(0,0,0,0.72);
  --toggle-track: #2a2f35;
  --toggle-active: #e6e2dc;
  --toggle-active-text: #121416;
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #fafafa;
  --text: #222;
  --heading: #2c3e50;
  --muted-text: #555;
  --link: #2878b8;
  --link-hover: #0066cc;
  --border: #ddd;
  --surface: #fff;
  --surface-subtle: #f2f5f7;
  --overlay: rgba(0,0,0,0.5);
  --toggle-track: #e5e9ed;
  --toggle-active: #1f2933;
  --toggle-active-text: #fff;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  max-width: 700px;
  margin: 36px auto 48px;
  padding: 0 20px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--page-bg);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-header {
  text-align: center;
  margin-bottom: 42px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  font-size: 2.4rem;
  margin-bottom: 0;
  color: var(--heading);
}

.site-header p {
  font-size: 1.1rem;
  margin: 6px 0;
  color: var(--muted-text);
}

.site-subtitle {
  font-weight: 500;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  margin-top: 10px;
  color: var(--muted-text);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--heading);
  background: var(--surface-subtle);
  font-size: 0.9rem;
  line-height: 1.3;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}

main h2, main h3 {
  color: var(--heading);
  margin-top: 34px;
  margin-bottom: 10px;
}

main h2 {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

main h3 {
  line-height: 1.35;
}

main p {
  margin: 0.75em 0;
}

main strong {
  color: var(--heading);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 34px 0 12px;
}

ul {
  margin: 0.7em 0 1.2em;
  padding-left: 1.25rem;
}

li {
  margin: 0.35em 0;
}

details {
  margin: 1.2em 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

summary {
  color: var(--heading);
}

.back-to-home {
  margin: 0 0 1.5em;
  font-size: 1.5em;
  font-weight: normal;
}

.back-to-home a {
  color: var(--muted-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-to-home a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

footer {
  margin-top: 60px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-text);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.theme-switcher {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.theme-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 132px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-text);
  background: var(--toggle-track);
  cursor: pointer;
}

.theme-toggle__option {
  min-width: 58px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
}

html[data-theme="dark"] .theme-toggle__option[data-theme-label="dark"],
html[data-theme="light"] .theme-toggle__option[data-theme-label="light"] {
  color: var(--toggle-active-text);
  background: var(--toggle-active);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

#badge-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.badge-popup-content {
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  border-radius: 10px;
  max-width: 80vw;
  max-height: 80vh;
  overflow: auto;
  text-align: center;
}

.badge-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 560px) {
  body {
    margin: 24px auto 36px;
    padding: 0 16px;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .site-header p {
    font-size: 1rem;
  }

  .theme-switcher {
    justify-content: center;
  }
}

@media print {
  :root,
  html[data-theme="dark"],
  html[data-theme="light"] {
    color-scheme: light;
    --page-bg: #fff;
    --text: #111;
    --heading: #111;
    --muted-text: #333;
    --link: #111;
    --link-hover: #111;
    --border: #bbb;
    --surface: #fff;
    --surface-subtle: #fff;
  }

  body {
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 11pt;
    line-height: 1.35;
    background: #fff;
  }

  .theme-switcher,
  .skill-list,
  .back-to-home,
  #badge-popup,
  noscript {
    display: none !important;
  }

  .site-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  .site-header h1 {
    font-size: 20pt;
  }

  main h2 {
    margin-top: 18px;
    padding-top: 10px;
  }

  main h3,
  details,
  li {
    break-inside: avoid;
  }

  details {
    padding: 0;
    border: 0;
  }

  a {
    color: #111;
    text-decoration: underline;
  }
}
