:root {
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --bg-main: #0a0a0a;
  --text-main: #c5c5c5;
  --text-headings: #e8e8e8;
  --text-title: #ffffff;
  --text-muted: #999999;
  --link-static: #8ec07c;
  --link-hover: #d3869b;
  --border-subtle: #333333;
  --nav-bg: #0c0c0c;
  --nav-border: #333333;
  --amex-blue: #006fcf;
}

.theme-light {
  --bg-main: #fffcf0;
  --text-main: #1c1b1a;
  --text-headings: #100f0f;
  --text-title: #100f0f;
  --text-muted: #43423e;
  --link-static: #205ea6;
  --link-hover: #5e409d;
  --border-subtle: #b7b5ac;
  --nav-bg: #f2f0e5;
  --nav-border: #dad8ce;
}

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

html {
  background: var(--bg-main);
}

body {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 2rem;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.14;
  z-index: 0;
}

.matrix-page > :not(.matrix-canvas) {
  position: relative;
  z-index: 1;
}

.theme-light .matrix-canvas {
  display: none;
}

.intro-page {
  max-width: none;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
}

.intro-shell {
  width: min(100%, 680px);
  text-align: left;
}

.intro-kicker {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.intro-shell h1 {
  margin: 0 0 0.85rem;
  color: var(--text-title);
  font-size: 2.5rem;
  font-weight: normal;
  line-height: 1.25;
}

.intro-shell p {
  max-width: 62ch;
  margin-bottom: 1.4rem;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.intro-actions a {
  position: relative;
  display: inline-block;
  padding: 0.45rem 0;
  border-bottom: none;
  font-size: 1rem;
}

.intro-actions a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.18rem;
  width: 100%;
  height: 1px;
  background: var(--link-static);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 180ms ease, background-color 180ms ease;
}

.intro-actions a:hover::after {
  transform: scaleX(1);
  background: var(--link-hover);
}

.play-button {
  color: var(--text-title);
  text-transform: uppercase;
}

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

a {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px dotted var(--link-static);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9999;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 0.75rem 1.25rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
}

nav a {
  margin-right: 1.8rem;
  color: var(--text-main);
  border-bottom: none;
  font-size: 0.95rem;
  letter-spacing: 0;
  padding: 0.3rem 0;
}

nav .mobile-option {
  width: 16px;
  height: 24px;
  margin-right: 1.5rem;
  border: 1px solid var(--text-muted);
  border-radius: 2px;
  padding: 0;
  position: relative;
  opacity: 0.8;
}

nav .mobile-option::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 1px;
  background: var(--text-muted);
  transform: translateX(-50%);
}

nav .mobile-option:hover {
  border-color: var(--link-hover);
  opacity: 1;
}

nav .desktop-option {
  width: 24px;
  height: 18px;
  margin-right: 1rem;
  border: 1px solid var(--text-muted);
  border-radius: 1px;
  padding: 0;
  position: relative;
  opacity: 0.8;
}

nav .desktop-option::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 1px;
  background: var(--text-muted);
  transform: translateX(-50%);
}

nav .desktop-option::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 1px;
  height: 4px;
  background: var(--text-muted);
  transform: translateX(-50%);
}

nav .desktop-option:hover {
  border-color: var(--link-hover);
  opacity: 1;
}

nav a.active {
  color: var(--text-title);
}

nav .rss-link {
  margin-left: 0;
  margin-right: 0;
}

.theme-toggle {
  margin-left: auto;
  margin-right: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--link-hover);
}

.terminal-header {
  position: relative;
  margin-bottom: 3.5rem;
  padding-bottom: 1rem;
}

.terminal-header h1 {
  margin: 0 0 0.5rem;
  color: var(--text-title);
  font-size: 2.5rem;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.3;
}

.terminal-header p {
  max-width: 92ch;
  margin: 0 0 0.9rem;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  font-size: 0.9rem;
}

main {
  margin: 0 0 2.5rem;
}

.section {
  position: relative;
  margin: 0 0 4rem;
  padding-top: 0.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  margin: 0;
  color: var(--text-headings);
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

h3,
h4 {
  color: var(--text-headings);
  font-weight: normal;
  line-height: 1.3;
}

p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 1.3em;
}

ul,
ol {
  padding-left: 1.8em;
}

li {
  margin-bottom: 0.45em;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 7px;
  width: 8px;
  height: 8px;
  background: var(--text-muted);
}

.timeline-item.current::before {
  background: var(--link-hover);
}

.timeline-item h3 {
  margin: 0;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.amex-brand {
  color: var(--amex-blue);
  font-weight: 700;
}

.birla-brand {
  color: #d4d4d4;
}

.theme-light .birla-brand {
  color: #696763;
}

.soft-brand {
  color: #e07a7a;
}

.role-note {
  color: var(--text-muted);
  font-size: 0.9em;
}

.leadership-brand {
  color: var(--link-static);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  padding: 1rem;
  border: 1px dashed var(--border-subtle);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-style: solid;
  border-color: var(--link-hover);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card p {
  margin-bottom: 0;
  color: var(--text-main);
  font-size: 0.9rem;
}

table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-headings);
  font-size: 0.8rem;
  font-weight: bold;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 0.5rem;
  border-bottom: 1px dotted var(--border-subtle);
  vertical-align: top;
}

.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cert-badge {
  flex: 1 1 190px;
  min-width: 180px;
  padding: 1rem;
  border: 1px dashed var(--border-subtle);
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cert-badge:hover {
  border-style: solid;
  border-color: var(--link-hover);
  transform: translateY(-2px);
}

.cert-badge h4 {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}

.cert-badge p {
  margin: 0;
  font-size: 0.8rem;
}

.blog-posts {
  display: flex;
  flex-direction: column;
}

.blog-post {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title date"
    "excerpt excerpt";
  column-gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px dotted var(--border-subtle);
  transition: background-color 0.2s ease;
}

.blog-post:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.theme-light .blog-post:hover {
  background-color: rgba(16, 15, 15, 0.035);
}

.blog-post h3 {
  grid-area: title;
  margin: 0;
  font-size: 1.1rem;
}

.blog-post-date {
  grid-area: date;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap;
}

.blog-excerpt {
  grid-area: excerpt;
  margin: 0.35rem 0 0;
  color: var(--text-main);
  font-size: 0.85rem;
}

.site-footer {
  display: block;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  border-bottom: none;
}

.mobile-page {
  width: min(100%, 430px);
  max-width: 430px;
  padding: 4.25rem 1rem 1.75rem;
}

.mobile-page nav {
  justify-content: flex-start;
}

.mobile-page nav a {
  margin-right: 0.9rem;
  font-size: 0.78rem;
}

.mobile-page .theme-toggle {
  margin-left: 0;
  margin-right: 0.75rem;
  font-size: 0.78rem;
}

.mobile-page .terminal-header {
  margin-bottom: 2.5rem;
}

.mobile-page .terminal-header h1 {
  font-size: 1.7rem;
}

.mobile-page .section {
  margin-bottom: 3rem;
}

.mobile-page .cards-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.mobile-page .cert-badge {
  flex-basis: 100%;
  min-width: 0;
}

.mobile-page table,
.mobile-page thead,
.mobile-page tbody,
.mobile-page tr,
.mobile-page th,
.mobile-page td {
  display: block;
  width: 100%;
}

.mobile-page thead {
  display: none;
}

.mobile-page tr {
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--border-subtle);
}

.mobile-page td {
  padding: 0.2rem 0;
  border-bottom: 0;
  overflow-wrap: anywhere;
}

.mobile-page td:first-child {
  color: var(--text-headings);
}

.portfolio-page .terminal-header,
.portfolio-page main,
.portfolio-page .site-footer {
  animation: pageIn 220ms ease-out both;
}

.portfolio-page main {
  animation-delay: 45ms;
}

.portfolio-page .site-footer {
  animation-delay: 80ms;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-page .terminal-header,
  .portfolio-page main,
  .portfolio-page .site-footer {
    animation: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 4.5rem 1rem 1.5rem;
    font-size: 14px;
  }

  nav {
    padding: 0.5rem 0.75rem;
  }

  nav a {
    margin-right: 1.2rem;
    font-size: 0.85rem;
  }

  .terminal-header h1 {
    font-size: 2rem;
  }

  .section {
    margin-bottom: 3rem;
  }

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

  .blog-post {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "date"
      "excerpt";
  }

  .blog-post-date {
    margin-top: 0.25rem;
    text-align: left;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  nav a {
    margin-right: 0.9rem;
    font-size: 0.8rem;
  }

  .theme-toggle {
    margin-right: 0.75rem;
  }

  .terminal-header h1 {
    font-size: 1.7rem;
  }
}
