/* =================================================================
   Stephen Downey — Portfolio
   Dark theme with teal accent. No build step, no dependencies.
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0e14;
  --bg-alt: #0e131c;
  --surface: #121926;
  --surface-2: #16202f;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #e6edf3;
  --text-muted: #93a4b8;
  --text-faint: #64748b;

  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent-border: rgba(45, 212, 191, 0.35);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --container: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-pad: clamp(4rem, 9vw, 6.5rem);

  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* clear the sticky header */
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Subtle radial glows for depth */
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, rgba(45, 212, 191, 0.07), transparent 60%),
    radial-gradient(50rem 35rem at -10% 30%, rgba(56, 189, 248, 0.05), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
}

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

strong {
  color: #fff;
  font-weight: 600;
}

em {
  color: var(--text);
}

::selection {
  background: rgba(45, 212, 191, 0.3);
  color: #fff;
}

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

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #04211d;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

.accent { color: var(--accent); }
.muted { color: var(--text-muted); }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #04211d;
  box-shadow: 0 8px 24px -10px rgba(45, 212, 191, 0.55);
}

.btn-primary:hover {
  box-shadow: 0 12px 30px -10px rgba(45, 212, 191, 0.7);
}

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

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

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

.icon-sm {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 14, 20, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.logo:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

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

.nav-list a:hover,
.nav-list a[aria-current="true"] {
  color: var(--text);
  text-decoration: none;
}

.nav-list a[aria-current="true"] {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(4rem, 12vw, 7.5rem) 0 clamp(3.5rem, 8vw, 5.5rem);
}

.hero-inner {
  max-width: 46rem;
}

.eyebrow {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(2.6rem, 7.5vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-bio {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 40rem;
  margin-bottom: 2.25rem;
}

.hero-bio strong {
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Sections ---------- */
.section {
  padding: var(--section-pad) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 2.25rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 42rem;
  margin-top: -1.25rem;
  margin-bottom: 2.5rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-copy .lead {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--text);
}

.about-copy p {
  color: var(--text-muted);
}

.about-copy .lead {
  color: var(--text);
}

.about-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.aside-title {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.edu-card + .edu-card {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.edu-year {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.edu-school {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.edu-program {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

.edu-note {
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.skill-group-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex-shrink: 0;
}

.dot-muted {
  background: var(--text-faint);
  box-shadow: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.tag:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.tag-accent {
  color: var(--accent-strong);
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.tag-accent:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.tag-list-compact {
  gap: 0.45rem;
}

.tag-list-compact .tag {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timeline-item {
  position: relative;
  padding-left: 2.25rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.55rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(45, 212, 191, 0.6);
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.4rem + 5px);
  top: 1.7rem;
  bottom: -1.75rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-border), transparent);
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.exp-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.exp-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
}

.exp-role {
  font-size: 1.15rem;
  font-weight: 600;
}

.exp-company {
  font-weight: 600;
  font-size: 0.95rem;
}

.exp-dates {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.exp-points {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exp-points li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.exp-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.8;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.project-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.project-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.project-card .tag-list {
  margin-bottom: 1.25rem;
}

.project-links {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-strong);
}

/* Placeholder links: replace with real URLs, or delete */
.is-placeholder {
  opacity: 0.75;
}

/* ---------- Contact ---------- */
.contact-inner {
  max-width: 44rem;
  text-align: center;
  margin-inline: auto;
}

.contact-inner .section-intro {
  margin-inline: auto;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  font-weight: 600;
  color: var(--accent);
  margin: 0.5rem 0 2rem;
  word-break: break-word;
  transition: color 0.2s var(--ease);
}

.contact-email:hover {
  color: var(--accent-strong);
}

.contact-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.contact-item:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: var(--surface);
}

.contact-item .icon {
  color: var(--accent);
}

.contact-item-static {
  cursor: default;
}

.contact-item-static:hover {
  border-color: transparent;
  background: transparent;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-aside {
    order: 2;
  }
}

@media (max-width: 48rem) {
  /* Mobile navigation */
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: rgba(10, 14, 20, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-list a {
    display: block;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .nav-list a:hover {
    background: var(--surface);
  }

  .nav-cta {
    justify-content: center;
    margin-top: 0.5rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .exp-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-actions .btn,
  .contact-actions .btn {
    width: auto;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
