/* ===================================================================
   Portfolio Styles
   =================================================================== */

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  --bg: #0b0f12;
  --bg-soft: #10161b;
  --line: #1e2a32;
  --text: #d7e0e7;
  --muted: #a3b4c1;              /* improved from #92a3b1 for WCAG AA */
  --accent: #27d3ff;
  --accent-soft: rgba(39, 211, 255, 0.14);
  --maxw: 960px;
}

/* ── Reset ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* ── Base ───────────────────────────────────────────────────────── */
body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(146, 163, 177, 0.15) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Gradient accent line at top of page */
/* body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7, var(--accent));
  z-index: 100;
} */

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Sticky Header ──────────────────────────────────────────────── */
.topline {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: rgba(11, 15, 18, 0.78);
  border-bottom: 1px solid var(--line);
}

.topline-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Navigation ─────────────────────────────────────────────────── */
.nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  border-color: var(--line);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.02);
  outline: none;
}

/* ── Main Layout ────────────────────────────────────────────────── */
main {
  padding: 1.25rem 0 3.5rem;
}

section {
  padding: 2.2rem 0;
  border-top: 1px solid var(--line);
}

.hero {
  border-top: 0;
  padding-top: 1.6rem;
}

/* ── Typography ─────────────────────────────────────────────────── */
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

h1, h2, h3 {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 8vw, 3.2rem);
}

h2 {
  font-size: clamp(1.1rem, 5vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.title-line {
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.9rem, 3.8vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Typing cursor blink */
.title-line::after {
  content: "_";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 0.1em;
}

@keyframes blink {
  50% { opacity: 0; }
}

.about {
  margin-top: 1.15rem;
  max-width: 74ch;
  color: #c4d0d9;
  font-size: 0.98rem;
  word-break: break-word;
}

/* ── CTA Buttons ────────────────────────────────────────────────── */
.cta-row {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg-soft);
  padding: 0.78rem 0.9rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

/* ── Section Head ───────────────────────────────────────────────── */
.section-head {
  margin-bottom: 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-head--spaced {
  margin-top: 1.5rem;
}

.section-note {
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Experience Timeline ────────────────────────────────────────── */
.timeline {
  display: grid;
  gap: 0.9rem;
}

.job {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

.job button {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 0.85rem 0.75rem;
  -webkit-tap-highlight-color: transparent;
}

.job button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.job-top {
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  align-items: flex-start;
}

.job-meta {
  display: flex;
  align-items: center;
}

.job-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: #e8edf2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-company {
  color: var(--muted);
  font-size: 0.85rem;
}

.job-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
}

.chevron {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  margin-left: 0.55rem;
  transition: transform 180ms ease;
}

.job[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.job-details {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0.8rem 0.95rem 0.95rem;
}

.job[aria-expanded="true"] .job-details {
  display: block;
}

.job-details p {
  margin: 0.1rem 0 0.5rem;
  color: #b7c5d0;
  font-size: 0.9rem;
}

.job-details ul {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: #cad3da;
  font-size: 0.88rem;
}

/* ── Skills / Capabilities ──────────────────────────────────────── */
.skills-wrap {
  margin-top: 1.25rem;
}

.chip {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  min-height: 32px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.chip--small {
  padding: 0.15rem 0.4rem;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.focus-grid {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
}

.focus-card {
  border: 1px solid var(--line);
  padding: 0.72rem 0.75rem;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.focus-card:hover {
  border-color: rgba(39, 211, 255, 0.3);
  box-shadow: 0 0 12px rgba(39, 211, 255, 0.06);
}

.focus-card b {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
}

.focus-text {
  color: #d2dbe2;
  font-size: 0.9rem;
}

/* ── Tags ───────────────────────────────────────────────────────── */
.tag-list {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
  padding: 0.18rem 0.35rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);                /* fixed from #9fb0bc */
}

/* ── More About Me ──────────────────────────────────────────────── */
.more-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr;
}

.more-card {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.more-card:hover {
  border-color: rgba(39, 211, 255, 0.3);
  box-shadow: 0 0 12px rgba(39, 211, 255, 0.06);
}

.more-card h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.more-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #d6e0e7;
}

.direction-note {
  margin-top: 1rem;
}

/* ── Projects ───────────────────────────────────────────────────── */
.project-grid {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

.project-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: rgba(39, 211, 255, 0.35);
  box-shadow: 0 4px 20px rgba(39, 211, 255, 0.08);
  transform: translateY(-3px);
}

.project-title {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.project-title h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e3ebf2;
}

.project-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-card p {
  margin: 0;
  color: #d4dee5;
  font-size: 0.9rem;
}

.project-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  border: 1px solid var(--line);
  background: rgba(39, 211, 255, 0.1);
  padding: 0.4rem 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #d7eef5;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.project-link svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

.project-link:hover,
.project-link:focus-visible {
  border-color: var(--accent);
  color: #06141a;
  background: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

/* ── Utility ────────────────────────────────────────────────────── */
.muted {
  color: var(--muted);
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.4rem;
  margin-top: 1rem;
}

.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-word;
}

.footer-inner a {
  color: var(--accent);
}

/* ── Flash Toast ────────────────────────────────────────────────── */
.flash {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: rgba(11, 15, 18, 0.95);
  padding: 0.45rem 0.58rem;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.flash.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Animations ─────────────────────────────────────────────────── */

/* Hero staggered entrance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.hero-animate:nth-child(1) { animation-delay: 0.1s; }
.hero-animate:nth-child(2) { animation-delay: 0.2s; }
.hero-animate:nth-child(3) { animation-delay: 0.3s; }
.hero-animate:nth-child(4) { animation-delay: 0.4s; }
.hero-animate:nth-child(5) { animation-delay: 0.5s; }
.hero-animate:nth-child(6) { animation-delay: 0.6s; }
.hero-animate:nth-child(7) { animation-delay: 0.7s; }
.hero-animate:nth-child(8) { animation-delay: 0.8s; }

/* Scroll-reveal: elements start hidden, animate in when visible */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive: Small phones (≤ 480px) ─────────────────────────── */
@media (max-width: 480px) {
  .topline-inner {
    padding: 0.6rem 0.75rem;
    gap: 0.35rem;
  }

  .nav {
    gap: 0.25rem;
  }

  .nav a {
    font-size: 0.65rem;
    padding: 0.3rem 0.35rem;
  }

  .brand {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .wrap {
    padding: 0 0.75rem;
  }

  .job-top {
    flex-direction: column;
    gap: 0.35rem;
  }

  .job-meta {
    align-self: flex-start;
  }

  .job-title {
    font-size: 0.82rem;
  }

  .job-company {
    font-size: 0.78rem;
  }

  .job-details {
    padding: 0.65rem 0.7rem 0.8rem;
  }

  .job-details ul {
    padding-left: 0.85rem;
    font-size: 0.82rem;
  }

  .job-details p {
    font-size: 0.84rem;
  }

  .btn {
    padding: 0.7rem 0.6rem;
    font-size: 0.72rem;
  }

  .focus-card {
    padding: 0.6rem 0.65rem;
  }

  .more-card {
    padding: 0.65rem;
  }

  .project-card {
    padding: 0.7rem;
  }

  .project-title {
    flex-direction: column;
    gap: 0.2rem;
  }

  .footer-inner {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    text-align: center;
    align-items: center;
  }
}

/* ── Responsive: Desktop (≥ 680px) ──────────────────────────────── */
@media (min-width: 680px) {
  .topline-inner {
    padding: 0.9rem 1rem;
  }

  .job button {
    padding: 0.95rem 0.9rem;
  }

  .cta-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .more-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ── Accessibility: Reduced Motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
