/* Alex Fox — alexfox.xyz
   Dark, minimal, dev-aesthetic personal site.
   Inspired by: paco.me, brianlovin.com, linear.app */

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0D1117;
  --surface: #161B22;
  --elevated: #21262D;
  --border: #30363D;
  --text: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #484F58;
  --teal: #2DD4BF;
  --teal-hover: #5EEAD4;
  --amber: #F59E0B;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --accent: 'Space Grotesk', 'Inter', sans-serif;
  --max-w: 680px;
  --max-w-wide: 960px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--teal); text-decoration: none; transition: color .15s; }
a:hover { color: var(--teal-hover); }

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

::selection { background: rgba(45, 212, 191, .2); color: var(--text); }

/* ============ Layout ============ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container--wide { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 24px; }

section { padding: 80px 0; }
@media (min-width: 768px) { section { padding: 120px 0; } }

/* ============ Nav ============ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 24px;
  background: rgba(13, 17, 23, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
nav.scrolled { border-bottom-color: var(--border); }

nav .inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  letter-spacing: -.02em;
}
nav .logo span { color: var(--teal); }

nav .links { display: flex; gap: 24px; }
nav .links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color .15s;
}
nav .links a:hover { color: var(--text); }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
}

.hero .container--wide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 768px) {
  .hero .container--wide {
    grid-template-columns: 1fr auto;
    gap: 64px;
  }
}

.hero-text h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}

.hero-text .tagline {
  font-size: clamp(17px, 2.5vw, 20px);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-text .tagline em {
  color: var(--teal);
  font-style: normal;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }

.hero-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  justify-self: center;
}

@media (min-width: 768px) {
  .hero-photo { width: 280px; height: 280px; }
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ Section headers ============ */
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-bottom: 16px;
}

.section-intro {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
  max-width: 580px;
  margin-bottom: 48px;
}

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 300px; gap: 64px; align-items: start; }
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.5em;
  line-height: 1.7;
}

.about-text p strong { color: var(--text); font-weight: 500; }

.about-photo {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ============ Stats ============ */
.stats {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-item .number {
  font-family: var(--accent);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  color: var(--teal);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.stat-item .label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============ Writing ============ */
.writing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .writing-grid { grid-template-columns: 1fr 1fr; }
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color .2s, transform .2s;
}

.topic-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.topic-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.topic-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.topic-card .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  background: rgba(45, 212, 191, .1);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ============ Photo strip ============ */
.photo-strip {
  padding: 0;
  overflow: hidden;
}

.photo-strip .inner {
  display: flex;
  gap: 16px;
  padding: 0 24px;
}

.photo-strip img {
  width: 280px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .photo-strip img { width: 320px; height: 220px; }
}

/* ============ Connect ============ */
.connect-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.connect-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all .2s;
}

.connect-links a:hover {
  border-color: var(--teal);
  color: var(--text);
}

.connect-links a svg { width: 18px; height: 18px; }

.email-line {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-secondary);
}

.email-line a { color: var(--teal); }

/* ============ Footer ============ */
footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

footer .left {
  font-size: 14px;
  color: var(--text-muted);
}

footer .right {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ Animations ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeUp .6s ease both;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}

/* Fallback: if scroll-driven animations not supported, just show content */
@supports not (animation-timeline: view()) {
  .fade-in { animation: none; opacity: 1; transform: none; }
}

/* ============ Utilities ============ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
