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

input,
textarea,
select,
button {
  font: inherit;
}

:root {
  --bg: #fafafa;
  --surface: #f0f0f2;
  --surface-hover: #e8e8ec;
  --border: #e0e0e4;
  --text: #1a1a1e;
  --text-secondary: #6b6b76;
  --accent: #1a1a1e;
  --accent-hover: #3a3a42;
  --dither: #1a1a1e;
  --radius: 12px;
  --radius-circle: 9999px;
}

[data-theme="dark"] {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-hover: #1e1e23;
  --border: #27272a;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --accent: #fafafa;
  --accent-hover: #d4d4d8;
  --dither: #e0e0e5;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

/* Hero */

.hero {
  margin-bottom: 64px;
}

.hero-sphere {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 0 32px 0;
}

.avatar {
  display: none;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-circle);
  background: linear-gradient(in oklch, #9a68ea, #6d28d9);
  margin-bottom: 24px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.bio {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin-bottom: 24px;
}

.social {
  display: flex;
  gap: 16px;
}

.social a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .social a:hover {
    color: var(--accent-hover);
  }
}

/* Sections */

h1,
h2 {
  text-wrap: balance;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

section {
  margin-bottom: 56px;
}

/* Work */

.work-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.work-list li + li {
  border-top: 1px solid var(--border);
}

.work-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  text-decoration: none;
  color: var(--text);
  transition: opacity 200ms ease;
}

.work-title {
  font-size: 1rem;
  font-weight: 500;
}

.work-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .work-list:hover a {
    opacity: 0.35;
  }

  .work-list:hover a:hover {
    opacity: 1;
  }
}

/* Newsletter */

.newsletter h2 {
  margin-bottom: 4px;
}

.newsletter p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 100%;
}

.subscribe-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-circle);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 150ms ease;
}

.subscribe-form input::placeholder {
  color: var(--text-secondary);
}

.subscribe-form input:focus {
  border-color: var(--accent);
}

.subscribe-form button {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-circle);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .subscribe-form button:hover {
    background: var(--accent-hover);
  }
}

.subscribe-form button:active {
  transform: scale(0.97);
}

/* Footer */

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Footer controls */

.footer-controls {
  display: flex;
  align-items: center;
  gap: 0px;
}

.theme-toggle,
.lang-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 150ms ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover,
  .lang-toggle:hover {
    color: var(--text);
  }
}

.theme-toggle {
  line-height: 0;
}

.lang-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.icon-sun  { display: none; }
.icon-moon { display: block; }

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

/* Language */

[data-lang="en"] [data-ru] { display: none; }
[data-lang="ru"] [data-en] { display: none; }

/* Touch */

button, a, input {
  touch-action: manipulation;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none;
    transition: none;
  }
}

/* Disable transitions during theme switch */

[data-theme-switching] * {
  transition: none !important;
}

/* Responsive */

@media (max-width: 480px) {
  main {
    padding: 48px 20px 40px;
  }

  .work-list a {
    padding: 12px 0;
  }
}
