:root {
  --bg-color: #fafafa;
  --text-color: #333333;
  --link-color: #007aff;
  --surface-color: #ffffff;
  --surface-hover-color: #ffffff;
  --surface-border: rgba(127, 127, 127, 0.18);
  --surface-border-strong: rgba(127, 127, 127, 0.32);
  --surface-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.08);
  --surface-shadow-hover: 0 14px 34px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);
  --menu-shadow: 0 24px 48px rgba(15, 23, 42, 0.16), 0 6px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
  --bg-color: #202020;
  --text-color: #ffffff;
  --link-color: #0a84ff;
  --surface-color: #202020;
  --surface-hover-color: #2e2e2e;
  --surface-border: rgba(255, 255, 255, 0.12);
  --surface-border-strong: rgba(255, 255, 255, 0.22);
  --surface-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.3);
  --surface-shadow-hover: 0 16px 38px rgba(0, 0, 0, 0.34), 0 2px 6px rgba(0, 0, 0, 0.24);
  --menu-shadow: 0 28px 54px rgba(0, 0, 0, 0.36), 0 8px 18px rgba(0, 0, 0, 0.24);
}

[data-theme="light"] {
  --bg-color: #fafafa;
  --text-color: #333333;
  --link-color: #007aff;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 40px 40px;
  text-align: left;
}

.container {
  max-width: 500px;
}

h1 {
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.25rem;
}

p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

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

.page-home h1 {
  font-size: 3.5rem;
}

.page-privacy h1 {
  font-size: 2.5rem;
}

.project-link {
  display: inline-block;
  margin-top: 0.75rem;
}

.store-badge {
  display: inline-block;
  margin: 0 0 1rem;
}

.store-badge__image {
  width: auto;
  height: 56px;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.store-badge:hover .store-badge__image,
.store-badge:focus-visible .store-badge__image {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.36));
}

.store-badge:focus-visible {
  outline: none;
}

[data-theme="dark"] .store-badge:hover .store-badge__image,
[data-theme="dark"] .store-badge:focus-visible .store-badge__image {
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.56));
}

.project-tile {
  width: auto;
  height: 60px;
  display: block;
  border: 0;
  box-shadow: none;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.project-link:hover .project-tile,
.project-link:focus-visible .project-tile {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.36));
}

.project-link:focus-visible {
  outline: none;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-toggle__button {
  min-width: 148px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--text-color);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--surface-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle__button:hover,
.theme-toggle.is-open .theme-toggle__button {
  border-color: var(--surface-border-strong);
  background: var(--surface-hover-color);
  box-shadow: var(--surface-shadow-hover);
}

.theme-toggle__button:focus-visible {
  outline: none;
  border-color: var(--surface-border-strong);
  box-shadow: var(--surface-shadow-hover);
}

.theme-toggle__button:active {
  transform: translateY(1px);
}

.theme-toggle__current {
  white-space: nowrap;
}

.theme-toggle__chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
  opacity: 0.72;
}

.theme-toggle.is-open .theme-toggle__chevron {
  transform: rotate(225deg) translateY(-1px);
}

.theme-toggle__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 100%;
  padding: 8px;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  background: var(--surface-color);
  box-shadow: var(--menu-shadow);
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: transform 0.18s ease, visibility 0.18s ease;
}

.theme-toggle.is-open .theme-toggle__menu {
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-toggle__option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-color);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.theme-toggle__option:hover,
.theme-toggle__option:focus-visible {
  outline: none;
  background: rgba(127, 127, 127, 0.12);
}

.theme-toggle__option.is-selected {
  background: rgba(127, 127, 127, 0.16);
}

.theme-toggle__option::after {
  content: "";
  width: 7px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) scale(0);
  transition: transform 0.18s ease;
  opacity: 0.75;
}

.theme-toggle__option.is-selected::after {
  transform: rotate(45deg) scale(1);
}

.social-media {
  display: flex;
  gap: 20px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social-media a {
  display: inline-block;
}

.social-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: invert(0%);
  transition: transform 0.22s ease, filter 0.22s ease;
  image-rendering: auto;
}

.social-media a:hover .social-icon,
.social-media a:focus-visible .social-icon {
  transform: translateY(-2px);
  filter: invert(0%) drop-shadow(0 8px 12px rgba(15, 23, 42, 0.36));
}

.social-media a:focus-visible {
  outline: none;
}

[data-theme="dark"] .social-icon {
  filter: invert(100%);
}

[data-theme="dark"] .social-media a:hover .social-icon,
[data-theme="dark"] .social-media a:focus-visible .social-icon {
  filter: invert(100%) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.56));
}

@media (max-width: 640px) {
  body {
    padding: 64px 24px 32px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
  }

  .page-home h1 {
    font-size: 2.75rem;
  }

  .page-privacy h1 {
    font-size: 2.2rem;
  }

  .project-tile {
    height: 60px;
  }

  .store-badge__image {
    height: 52px;
  }
}
