/* pavelhacks.me */

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

:root {
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
}

/* ---- DARK THEME (default) ---- */

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-surface: #242424;
  --bg-elevated: #2e2e2e;
  --text-primary: #e8e8e8;
  --text-body: #c8c8c8;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #e8956a;
  --accent-hover: #f0a880;
  --accent-subtle: rgba(232, 149, 106, 0.12);
  --accent-glow: rgba(232, 149, 106, 0.3);
  --border: #333333;
  --border-hover: #444444;
  --link: var(--accent);
  --link-visited: #c4836a;
  --selection-bg: rgba(232, 149, 106, 0.25);
}

/* ---- LIGHT THEME ---- */

[data-theme="light"] {
  --bg-primary: #f5f2ee;
  --bg-surface: #eae6e1;
  --bg-elevated: #ddd9d3;
  --text-primary: #1a1a1a;
  --text-body: #3a3a3a;
  --text-muted: #6a6a6a;
  --text-dim: #999999;
  --accent: #c06a3a;
  --accent-hover: #a85830;
  --accent-subtle: rgba(192, 106, 58, 0.10);
  --accent-glow: rgba(192, 106, 58, 0.15);
  --border: #d0ccc6;
  --border-hover: #b8b3ab;
  --link: var(--accent);
  --link-visited: #9a5a3a;
  --selection-bg: rgba(192, 106, 58, 0.20);
}

::selection {
  background: var(--selection-bg);
  color: var(--text-primary);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s, color 0.3s;
}

/* ---- NAV ---- */

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-hover);
}

/* ---- THEME TOGGLE ---- */

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon { display: none; }
[data-mode="dark"]  .theme-icon--dark  { display: inline; }
[data-mode="light"] .theme-icon--light { display: inline; }
[data-mode="system"] .theme-icon--system { display: inline; }

/* ---- MAIN ---- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ---- HERO ---- */

.hero {
  padding: 6rem 0 5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-subtle) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  text-shadow: 0 0 40px var(--accent-glow);
  margin-bottom: 1.25rem;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: baseline;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 560px;
  margin-bottom: 2rem;
}

.cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.cta:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ---- SECTIONS ---- */

section + section {
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  margin-top: 5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

section h3:first-of-type {
  margin-top: 0;
}

section p {
  margin-bottom: 1rem;
}

section p:last-child {
  margin-bottom: 0;
}

/* lead paragraph in a section — slightly more presence */
section > p:first-of-type {
  color: var(--text-body);
  margin-bottom: 1.25rem;
}

/* ---- LISTS ---- */

ul {
  list-style: none;
  padding: 0;
}

.work-list li,
#ai-practice ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-body);
}

.work-list li::before,
#ai-practice ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---- LINKS / FOOTER ---- */

#links {
  padding-bottom: 2rem;
}

.links-list {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.links-list a {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s;
}

.links-list a:hover {
  background-size: 100% 1px;
}

.links-list a:visited {
  color: var(--link-visited);
}

/* ---- GENERIC LINKS ---- */

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

a:visited {
  color: var(--link-visited);
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.ext {
  font-size: 0.75em;
}

/* ---- REDUCED MOTION ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; opacity: 1; }
  *, *::before, *::after {
    transition-duration: 0s !important;
  }
}

/* ---- MOBILE ---- */

@media (max-width: 480px) {
  .hero { padding: 4rem 0 3rem; }
  section + section { margin-top: 3rem; }
  .links-list { flex-direction: column; gap: 0.75rem; }
  .hero::before { width: 300px; height: 300px; }
}
