/* ===================================================================
   drewbornt.me — Global Styles
   =================================================================== */

/* Custom Properties */
:root {
  --color-bg: #0f1117;
  --color-bg-alt: #161b27;
  --color-surface: #1e2433;
  --color-border: #2a3040;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  /* Slightly darker indigo ensures white text passes WCAG AA 4.5:1 on buttons */
  --color-accent: #4f46e5;
  /* Lighter variant for text on dark surfaces — meets WCAG AA 4.5:1 contrast */
  --color-accent-text: #818cf8;
  --color-accent-hover: #a5b4fc;
  --color-accent-secondary: #22d3ee;
  --color-success: #22c55e;
  --color-error: #ef4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --nav-height: 64px;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Links inline in text blocks must be visually distinct from surrounding text */
p a, li a, address a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

p a:hover, li a:hover, address a:hover {
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

address {
  font-style: normal;
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.container--narrow {
  max-width: 740px;
}

.container--resume {
  max-width: 860px;
}

/* ===================================================================
   Navigation
   =================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

#main-nav {
  height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

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

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

.nav-link {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--color-surface);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 1.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
  }

  .nav-link:last-child {
    border-bottom: none;
  }
}

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
}

/* ===================================================================
   Sections
   =================================================================== */
.section {
  padding: 5rem 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.section-intro {
  color: var(--color-text-muted);
  margin-top: -2rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* ===================================================================
   Page Hero (inner pages)
   =================================================================== */
.page-hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.75rem;
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: 1.15rem;
}

/* ===================================================================
   Hero (home)
   =================================================================== */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  padding: 4rem 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
}

.hero-eyebrow {
  color: var(--color-accent-text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 540px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===================================================================
   About
   =================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo img {
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  width: 100%;
}

.about-bio p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

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

  .about-photo img {
    max-width: 240px;
  }
}

/* ===================================================================
   Highlights (home)
   =================================================================== */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.highlight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

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

.highlight-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.highlight-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.highlight-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.highlight-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent-text);
}

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

/* ===================================================================
   Social Links
   =================================================================== */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
  background: rgba(99, 102, 241, 0.08);
}

/* ===================================================================
   Books
   =================================================================== */
.book-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.book-card:first-of-type {
  padding-top: 0;
}

.book-cover img {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  background: var(--color-surface);
  min-height: 300px;
  object-fit: cover;
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.book-genre {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.book-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.book-status--in-progress {
  background: rgba(34, 211, 238, 0.12);
  color: var(--color-accent-secondary);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.book-status--published {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.book-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.book-synopsis {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.book-coming-soon {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .book-card {
    grid-template-columns: 1fr;
  }

  .book-cover img {
    max-width: 160px;
  }
}

/* ===================================================================
   Projects
   =================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: var(--color-accent);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.project-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-accent-hover);
  border: 1px solid rgba(165, 180, 252, 0.3);
  border-radius: 100px;
  font-family: var(--font-mono);
}

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

/* ===================================================================
   Resume
   =================================================================== */
.resume-actions {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.resume-document {
  padding: 4rem 0;
}

.resume-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--color-border);
}

.resume-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.resume-title {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.resume-contact a {
  color: var(--color-text-muted);
}

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

.resume-section {
  margin-bottom: 3rem;
}

.resume-section h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.resume-section > p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.resume-job {
  margin-bottom: 2rem;
}

.resume-job:last-child {
  margin-bottom: 0;
}

.resume-job-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.resume-job-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.resume-company {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.resume-dates {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  margin-left: auto;
}

.resume-bullets {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
}

.resume-bullets li {
  margin-bottom: 0.4rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-group dt {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.skill-group dd {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.certs-list {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 2;
}

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

  .resume-dates {
    margin-left: 0;
  }
}

/* ===================================================================
   404 Error Page
   =================================================================== */
.error-page {
  min-height: calc(100vh - var(--nav-height) - 80px);
  display: flex;
  align-items: center;
  padding: 4rem 0;
  text-align: center;
}

.error-code {
  font-size: 7rem;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.error-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.error-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===================================================================
   Footer
   =================================================================== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
