/* =========================================================
   Maqsudjon Polatov — personal site
   Vanilla CSS, mobile-first, dark by default
   ========================================================= */

:root {
  --max-width: 680px;
  --accent: #F59E0B;
  --accent-soft: rgba(245, 158, 11, 0.18);

  /* dark theme (default) */
  --bg: #0a0a0a;
  --bg-elev: #121212;
  --text: #ededed;
  --text-muted: #a0a0a0;
  --text-faint: #6a6a6a;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --text: #111111;
  --text-muted: #555555;
  --text-faint: #888888;
  --border: #ececec;
  --border-strong: #dcdcdc;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; font-weight: 500; color: var(--text-muted); }

p { margin: 0 0 1rem; }

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* =========================================================
   Theme toggle
   ========================================================= */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

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

/* =========================================================
   Hero
   ========================================================= */
.hero { padding: 88px 0 56px; }

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.hero-photo {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px var(--bg), 0 0 0 6px var(--accent-soft);
  background: var(--bg-elev);
  position: relative;
}
/* Fallback initials shown behind the photo — visible if assets/profile.jpg
   is missing or fails to load, so we never display a broken-image icon. */
.hero-photo::before {
  content: attr(data-initials);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  z-index: 0;
}
.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-text { flex: 1; }

.subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 6px 0 18px;
  letter-spacing: 0.02em;
}

.intro {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 28px;
  padding: 0;
}
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  color: var(--text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.socials a:hover { color: var(--accent); background: var(--accent-soft); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #1a1100;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #1a1100;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* =========================================================
   Updates
   ========================================================= */
.updates { padding: 56px 0; border-top: 1px solid var(--border); }

.section-lead {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 0.98rem;
}

.updates-list {
  display: flex;
  flex-direction: column;
}

.update {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.update.visible { opacity: 1; transform: translateY(0); }
.update:last-child { border-bottom: none; }

.update-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.update-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.update h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 12px;
  letter-spacing: -0.01em;
}

.update-body { color: var(--text-muted); line-height: 1.7; }
.update-body p { margin: 0 0 0.75rem; }
.update-body p:last-child { margin-bottom: 0; }

.loading { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.85rem; }

/* =========================================================
   About
   ========================================================= */
.about { padding: 56px 0; border-top: 1px solid var(--border); }
.about p { color: var(--text-muted); line-height: 1.7; }

/* =========================================================
   Footer / Contact
   ========================================================= */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 64px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.contact-lead {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.contact-links {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.contact-links .dot { margin: 0 8px; color: var(--text-faint); }

.copyright {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 0;
}

/* =========================================================
   Responsive — desktop layout
   ========================================================= */
@media (min-width: 720px) {
  main { padding: 0 32px; }
  footer { padding: 64px 32px 72px; }

  .hero { padding: 112px 0 72px; }
  .hero-grid {
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
  }

  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.75rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .update { opacity: 1; transform: none; }
}
