/* michaelod.com — site styles */

:root {
  --bg: #0a0d14;
  --bg-raised: #10141e;
  --bg-card: #131827;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e6e9f0;
  --text-muted: #9aa3b5;
  --text-faint: #6b7385;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Soft ambient glow behind the top of the page */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw auto -10vw;
  height: 80vh;
  background:
    radial-gradient(50% 60% at 25% 30%, rgba(94, 234, 212, 0.10), transparent 70%),
    radial-gradient(45% 55% at 80% 20%, rgba(129, 140, 248, 0.12), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: #04110e;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #04110e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  margin: 0 auto;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0.75rem 1.5rem 1.25rem;
    background: rgba(10, 13, 20, 0.97);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 0.75rem 0.5rem; font-size: 1rem; }
}

/* ---------- Typography helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.section { padding: 6rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 2.75rem; max-width: 640px; }
.section-head h2 {
  margin: 0.6rem 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.section-head p { margin: 0; color: var(--text-muted); }

.gradient-text {
  background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #04110e;
  background: linear-gradient(135deg, var(--accent), #a5b4fc);
  box-shadow: 0 8px 30px -10px rgba(94, 234, 212, 0.55);
}
.btn-ghost {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.04);
}
.btn-ghost:hover { border-color: rgba(148, 163, 184, 0.4); }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */

.hero { padding: 7rem 0 3.5rem; }
.hero h1 {
  margin: 1.25rem 0 0.75rem;
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 750;
}
.hero .role {
  margin: 0 0 1.25rem;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  color: var(--text);
}
.hero .lede {
  max-width: 620px;
  margin: 0 0 2.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(19, 24, 39, 0.6);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-grid p { margin: 0 0 1.1rem; color: #c7cdd9; font-size: 1.05rem; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel h3 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.focus-list { list-style: none; margin: 0; padding: 0; }
.focus-list li {
  display: flex;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
}
.focus-list li:last-child { border-bottom: 0; }
.focus-list li::before { content: "→"; color: var(--accent); font-family: var(--mono); }

.cert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(94, 234, 212, 0.25);
  font-weight: 600;
}
.cert small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.cert-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(94, 234, 212, 0.15);
  color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.skill-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.skill-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.skill-card li {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.07);
  color: #cdd3df;
}
.skill-card .icon {
  width: 36px; height: 36px;
  margin-bottom: 1rem;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-2);
}

@media (max-width: 980px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- Work ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.work-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.work-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.work-card:hover::before { opacity: 1; }
.work-card .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.work-card h3 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}
.work-card p { margin: 0 0 1.25rem; color: var(--text-muted); }
.outcome {
  margin-top: auto;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.14);
  font-size: 0.92rem;
  color: #d5f5ef;
}
.outcome strong { color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 860px) { .work-grid { grid-template-columns: 1fr; } }

/* ---------- Writeups ---------- */

.writeup-list { display: grid; gap: 0.75rem; }
.writeup-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.writeup-item:hover { border-color: var(--border-strong); }
.writeup-item h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.writeup-item p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }
.writeup-item time { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); white-space: nowrap; }

.empty-state {
  padding: 2.5rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.empty-state strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.35rem; }

.section-foot { margin-top: 1.75rem; }
.text-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Article (single writeup) */
.article { max-width: 720px; margin: 0 auto; padding: 5rem 1.5rem 6rem; }
.article header { margin-bottom: 2.5rem; }
.article h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.15; letter-spacing: -0.025em; margin: 0.75rem 0; }
.article .meta { color: var(--text-faint); font-family: var(--mono); font-size: 0.85rem; }
.article h2 { font-size: 1.45rem; margin: 2.5rem 0 0.75rem; letter-spacing: -0.015em; }
.article h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.article p, .article li { color: #c7cdd9; font-size: 1.05rem; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(148, 163, 184, 0.1);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}
.article pre {
  background: #0d111b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
.article pre code { background: none; padding: 0; }
.article blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* ---------- Contact ---------- */

.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(94, 234, 212, 0.10), transparent 60%),
    radial-gradient(60% 120% at 100% 100%, rgba(129, 140, 248, 0.12), transparent 60%),
    var(--bg-raised);
}
.contact-card h2 { margin: 0.6rem 0 0.75rem; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.2; }
.contact-card p { margin: 0; color: var(--text-muted); }
.contact-links { display: grid; gap: 0.6rem; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 20, 0.5);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-link:hover { border-color: var(--border-strong); background: rgba(10, 13, 20, 0.8); }
.contact-link svg { color: var(--accent); flex-shrink: 0; }
.contact-link span { display: block; font-size: 0.78rem; color: var(--text-faint); font-family: var(--mono); }
.contact-link strong { font-weight: 550; font-size: 0.95rem; word-break: break-all; }

@media (max-width: 860px) {
  .contact-card { grid-template-columns: 1fr; padding: 2rem; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.view-counter { font-family: var(--mono); }
.view-counter[hidden] { display: none; }

/* ---------- Reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Impact stats (hero) ---------- */

.stats {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(19, 24, 39, 0.55);
  overflow: hidden;
}
.stat { padding: 1.4rem 1.5rem; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat strong {
  display: block;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { display: block; margin-top: 0.4rem; font-size: 0.88rem; color: var(--text-muted); line-height: 1.45; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}

.panel-sub { margin-top: 1.75rem !important; }

/* ---------- 3-column variants ---------- */

.skills-grid-3 { grid-template-columns: repeat(3, 1fr); }
.work-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1020px) {
  .skills-grid-3, .work-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .skills-grid-3, .work-grid-3 { grid-template-columns: 1fr; }
}
