/* Accent is a single CSS variable — swap --accent to retheme later */
:root {
  --bg: #0a0f14;
  --bg-elevated: #0f161d;
  --bg-soft: #121a22;
  --text: #e8eef4;
  --muted: #8b9aab;
  --muted-2: #6b7c8f;
  --line: rgba(232, 238, 244, 0.1);
  --line-strong: rgba(232, 238, 244, 0.18);
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.14);
  --accent-text: #0a0f14;
  --status-live: #2dd4bf;
  --status-pending: #e8b84a;
  --status-beta: #7eb8ff;
  --radius: 4px;
  --header-h: 64px;
  --max: 1080px;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(45, 212, 191, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(45, 212, 191, 0.04), transparent 50%),
    linear-gradient(180deg, #0a0f14 0%, #0c1218 40%, #0a0f14 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 70%);
}

body > * {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #5eead4;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 20, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text {
  font-size: 0.98rem;
}

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

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

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

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

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

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

/* Hero */
.hero {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  animation: rise 0.8s var(--ease) both;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45);
  animation: pulse 2.4s ease-out infinite;
}

.hero-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-role {
  margin: 0.85rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.hero-lede {
  margin: 1.35rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

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

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

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

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

.btn-disabled,
.btn-disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
  color: var(--muted);
  border-color: var(--line);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 3rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  animation: rise 0.9s var(--ease) 0.12s both;
}

.stat {
  padding: 1.35rem 1rem 0 0;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: none;
  padding-right: 0;
}

.stat dt {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat dd {
  margin: 0.35rem 0 0;
  color: var(--muted-2);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Sections */
.section {
  padding: clamp(3.5rem, 7vw, 5rem) 0;
  border-bottom: 1px solid var(--line);
}

.section-alt {
  background: linear-gradient(180deg, rgba(18, 26, 34, 0.55), rgba(10, 15, 20, 0));
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-lede {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.prose p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 46rem;
  font-size: 1.05rem;
}

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

.about-copy {
  animation: rise 0.7s var(--ease) both;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: 1.5rem 2rem;
  padding: 0 0 2.75rem 1.75rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

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

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-meta time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.timeline-org {
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline-body h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.timeline-body > p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.timeline-body ul:not(.tag-list) {
  margin: 0 0 1.15rem;
  padding-left: 1.15rem;
  color: var(--muted);
}

.timeline-body ul:not(.tag-list) li {
  margin-bottom: 0.55rem;
}

.timeline-body ul:not(.tag-list) li::marker {
  color: var(--accent);
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list li,
.tag-list > span {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.tag-list.inline {
  display: inline-flex;
}

/* Shipping log */
.shipping-log {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.ship-entry {
  border-bottom: 1px solid var(--line);
}

.ship-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1.35rem 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.2s var(--ease);
}

.ship-toggle:hover {
  background: rgba(45, 212, 191, 0.03);
}

.ship-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  padding-top: 0.15rem;
}

.ship-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.ship-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.ship-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.ship-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.status-live {
  color: var(--status-live);
  background: var(--accent-dim);
}

.status-pending {
  color: var(--status-pending);
  background: rgba(232, 184, 74, 0.12);
}

.status-beta {
  color: var(--status-beta);
  background: rgba(126, 184, 255, 0.12);
}

.ship-chevron {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.55rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.ship-toggle[aria-expanded="true"] .ship-chevron {
  transform: rotate(225deg);
  margin-top: 0.75rem;
}

.ship-panel {
  padding: 0 0.25rem 1.5rem 4rem;
  color: var(--muted);
  animation: expand 0.3s var(--ease);
}

.ship-panel[hidden] {
  display: none;
}

.ship-panel p {
  margin: 0 0 1rem;
  max-width: 44rem;
}

.ship-panel ul {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
}

.ship-panel li {
  margin-bottom: 0.45rem;
}

.ship-panel li::marker {
  color: var(--accent);
}

.ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* Skills */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem 1.25rem;
}

.skill-group h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Certs */
.cert-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.cert-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s;
}

.cert-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
  transform: translateY(-2px);
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.cert-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  flex: 1;
}

.cert-link {
  font-size: 0.85rem;
  color: var(--muted);
}

.cert-card:hover .cert-link {
  color: var(--accent);
}

.education {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.education h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.education p {
  margin: 0;
  color: var(--muted);
}

.education strong {
  color: var(--text);
  font-weight: 600;
}

/* Writing */
.writing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.writing-list li {
  border-bottom: 1px solid var(--line);
}

.writing-list a {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem 0.15rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}

.writing-list a:hover {
  background: rgba(45, 212, 191, 0.03);
}

.writing-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
}

.writing-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.writing-list a:hover .writing-title {
  color: var(--accent);
}

.writing-teaser {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 44rem;
}

.more-link {
  margin: 1.5rem 0 0;
}

.more-link a {
  font-weight: 600;
  text-decoration: none;
}

.more-link a:hover {
  text-decoration: underline;
}

/* Contact */
.contact-inner {
  max-width: 40rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.contact-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.contact-value {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  word-break: break-word;
}

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

/* Footer */
.site-footer {
  padding: 1.75rem 0 2.5rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 0.9rem;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

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

/* Motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(45, 212, 191, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
  }
}

@keyframes expand {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: none;
    padding-right: 0;
  }

  .stat:nth-child(3),
  .stat:nth-child(4) {
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

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

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(10, 15, 20, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

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

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .ship-toggle {
    grid-template-columns: 2.25rem 1fr auto;
    gap: 0.75rem;
  }

  .ship-panel {
    padding-left: 0.25rem;
  }

  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(var(--max), calc(100% - 1.5rem));
  }

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

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .brand-text {
    display: none;
  }
}
