:root {
  color-scheme: dark;
  --bg: #06100c;
  --surface: #0a1711;
  --surface-2: #0e2018;
  --surface-hover: #11271d;
  --text: #e5f5eb;
  --muted: #8fa99b;
  --accent: #72e89a;
  --accent-strong: #39d978;
  --accent-soft: rgba(114, 232, 154, 0.12);
  --border: rgba(114, 232, 154, 0.18);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% -10%, rgba(57, 217, 120, 0.12), transparent 36%),
    radial-gradient(circle at 95% 22%, rgba(114, 232, 154, 0.08), transparent 28%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(114, 232, 154, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 232, 154, 0.14) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  transition: opacity 280ms ease, background-size 280ms ease;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(114, 232, 154, 0.035) 4px
  );
  transition: opacity 280ms ease;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(calc(100% - 28px), var(--content));
  margin: 0 auto;
  padding: 26px 0 56px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-bottom: clamp(20px, 6vw, 20px);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(114, 232, 154, 0.65);
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  letter-spacing: -0.025em;
  font-weight: 760;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.055em;
}

.intro-wrap {
  width: min(100%, 920px);
  margin: 0 auto 16px;
  text-align: center;
}

.hero-kicker {
  margin-bottom: 14px;
}


.section-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  pointer-events: none;
}

.section-nav-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(6, 16, 12, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.section-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 38px;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 720;
  letter-spacing: 0.015em;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.section-link:hover {
  color: var(--text);
  background: rgba(114, 232, 154, 0.055);
}

.section-link.is-active,
.section-link[aria-current="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(114, 232, 154, 0.16);
}

.section-link.is-active::before,
.section-link[aria-current="true"]::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 11px rgba(57, 217, 120, 0.65);
}

.portfolio-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(14, 32, 24, 0.9), rgba(7, 17, 13, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.panel {
  display: block;
  padding: clamp(22px, 3.4vw, 38px);
  scroll-margin-top: 82px;
}

.panel + .panel {
  position: relative;
  padding-top: clamp(42px, 6vw, 70px);
  border-top: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(114, 232, 154, 0.035), transparent 170px);
}

.panel + .panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: clamp(22px, 3.4vw, 38px);
  width: min(150px, 34%);
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(114, 232, 154, 0.32);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  letter-spacing: -0.045em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.count {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}

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

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  /* min-height: 265px; */
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(114, 232, 154, 0.14);
  background:
    linear-gradient(145deg, rgba(17, 39, 29, 0.74), rgba(9, 22, 16, 0.9));
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card::after {
  content: "";
  position: absolute;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  right: -52px;
  top: -52px;
  background: radial-gradient(circle, rgba(114, 232, 154, 0.14), transparent 70%);
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(114, 232, 154, 0.34);
  background: linear-gradient(145deg, rgba(19, 44, 32, 0.8), rgba(9, 22, 16, 0.94));
}

/* .project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
} */

/* .project-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(114, 232, 154, 0.2);
} */

/* .project-icon svg { width: 21px; height: 21px; } */

/* .project-number {
  color: rgba(143, 169, 155, 0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
} */

.project-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  line-height: 1.35;
  letter-spacing: -0.022em;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  color: #afe4c0;
  background: rgba(114, 232, 154, 0.075);
  border: 1px solid rgba(114, 232, 154, 0.12);
  font-size: 0.71rem;
  font-weight: 650;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: auto;
  padding-top: 22px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 750;
}

.project-link svg {
  width: 15px;
  height: 15px;
  transition: transform 180ms ease;
}

.project-link:hover svg { transform: translate(2px, -2px); }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cert-card {
  /* min-height: 176px; */
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(114, 232, 154, 0.14);
  background: rgba(11, 27, 20, 0.78);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, border-color 180ms ease;
}

.cert-card:hover {
  transform: translateY(-3px);
  border-color: rgba(114, 232, 154, 0.34);
}
/* 
.cert-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(114, 232, 154, 0.2);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  margin-bottom: 22px;
} */

.cert-card h3 {
  margin: 0 0 7px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.cert-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.cert-view {
  margin-top: auto;
  padding-top: 16px;
  color: #b5dfc2;
  font-size: 0.7rem;
  font-weight: 720;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fade-in {
  animation: enter 420ms ease both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .page-shell { width: min(calc(100% - 18px), var(--content)); padding-top: 16px; }
  .topbar { min-height: 36px; margin-bottom: 34px; }
  .subtitle { font-size: 0.72rem; }
  .project-grid, .cert-grid { grid-template-columns: 1fr; }
  /* .project-card { min-height: 250px; } */
  .section-heading { align-items: flex-start; }
  /* .section-heading p { max-width: 28ch; } */
  .section-nav { top: 8px; }
  .section-nav-inner { width: min(100%, 330px); }
  .section-link { flex: 1; min-width: 0; padding-inline: 10px; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Interactive terminal introduction */
.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;
}

.terminal-intro {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(11, 27, 20, 0.94), rgba(6, 16, 12, 0.97));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  text-align: left;
}

.terminal-bar {
  min-height: 43px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(114, 232, 154, 0.12);
  background: rgba(114, 232, 154, 0.035);
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-controls span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(114, 232, 154, 0.28);
  background: rgba(114, 232, 154, 0.09);
}

.terminal-controls span:first-child {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(114, 232, 154, 0.34);
}

.terminal-bar p,
.terminal-session {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.terminal-bar p {
  color: rgba(229, 245, 235, 0.55);
  text-align: center;
}

.terminal-session {
  justify-self: end;
  color: rgba(114, 232, 154, 0.72);
}

.terminal-body {
  padding: clamp(20px, 3vw, 32px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.terminal-log {
  display: grid;
  gap: 17px;
  max-height: 330px;
  overflow-y: auto;
  /* scrollbar-width: thin;
  scrollbar-color: rgba(114, 232, 154, 0.28) transparent; */
}

.terminal-entry {
  min-width: 0;
}

.terminal-command,
.terminal-response {
  margin: 0;
}

.terminal-command {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.prompt {
  color: var(--accent-strong);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(57, 217, 120, 0.38);
  flex: 0 0 auto;
}

.terminal-response {
  margin-top: 5px;
  padding-left: 20px;
  color: var(--text);
  font-size: clamp(0.84rem, 1.5vw, 0.96rem);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.terminal-response.is-success { color: #bde8cb; }
.terminal-response.is-error { color: #f3b9b9; }
.terminal-response.is-muted { color: var(--muted); }

.terminal-paths,
.terminal-command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.terminal-paths span,
.terminal-command-list code {
  color: var(--accent);
}

.terminal-command-list code {
  font-family: inherit;
  font-size: inherit;
}

.terminal-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(114, 232, 154, 0.12);
}

.terminal-form input {
  width: 100%;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  caret-color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
}

.terminal-form input::placeholder {
  color: rgba(143, 169, 155, 0.55);
}

.terminal-form:focus-within {
  text-shadow: 0 0 14px rgba(114, 232, 154, 0.08);
}

.terminal-hint {
  margin: 10px 0 0;
  color: rgba(143, 169, 155, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

body.matrix-mode::before {
  opacity: 0.24;
  background-size: 24px 24px;
  animation: matrix-drift 4.8s linear infinite;
}

body.matrix-mode::after {
  opacity: 1;
}

body.matrix-mode .matrix-rain {
  opacity: 0.34;
}

body.matrix-mode .terminal-intro,
body.matrix-mode .portfolio-frame,
body.matrix-mode .section-nav-inner {
  border-color: rgba(114, 232, 154, 0.5);
  box-shadow: 0 0 0 1px rgba(57, 217, 120, 0.08), 0 18px 60px rgba(0, 0, 0, 0.36);
}

body.matrix-mode .terminal-intro {
  background: linear-gradient(180deg, rgba(7, 30, 18, 0.96), rgba(3, 12, 8, 0.98));
}

body.matrix-mode .brand,
body.matrix-mode .hero-kicker,
body.matrix-mode .section-heading h2 {
  text-shadow: 0 0 18px rgba(114, 232, 154, 0.22);
}

@keyframes matrix-drift {
  from { background-position: 0 0; }
  to { background-position: 0 56px; }
}

@media (max-width: 760px) {
  .terminal-bar {
    grid-template-columns: auto 1fr;
  }

  .terminal-bar p {
    text-align: right;
  }

  .terminal-session {
    display: none;
  }

  .terminal-body {
    padding: 19px;
  }

  .terminal-log {
    max-height: 390px;
  }

  .terminal-hint {
    padding-inline: 10px;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.matrix-mode::before {
    animation: none !important;
  }
}

/* Expanded system footer */
.site-footer {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 22px 0 0;
  padding: 18px 14px 0;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(189, 232, 203, 0.92);
  font-size: 0.7rem;
  letter-spacing: 0.055em;
}

.footer-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 14px rgba(57, 217, 120, 0.68);
}

.footer-security,
.footer-build {
  margin: 0;
}

.footer-security {
  color: rgba(143, 169, 155, 0.62);
  font-size: 0.62rem;
  letter-spacing: 0.045em;
}

.footer-build {
  color: rgba(143, 169, 155, 0.76);
  font-size: 0.68rem;
}

.status-pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 12px rgba(57, 217, 120, 0.72);
  animation: status-pulse 2.2s ease-in-out infinite;
}

.terminal-status-output {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 760px) {
  .site-footer {
    padding-inline: 6px;
  }

  .footer-security {
    line-height: 1.6;
  }

  .footer-socials {
    width: 100%;
  }

  .social-link {
    flex: 1;
    justify-content: center;
  }
}



.footer-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(114, 232, 154, 0.16);
  border-radius: 999px;
  color: rgba(189, 232, 203, 0.9);
  background: rgba(114, 232, 154, 0.045);
  text-decoration: none;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.social-link:hover {
  color: var(--accent);
  border-color: rgba(114, 232, 154, 0.42);
  background: rgba(114, 232, 154, 0.09);
  transform: translateY(-1px);
}

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

.social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-copyright {
  margin: 8px 0 0;
  color: rgba(143, 169, 155, 0.58);
  font-size: 0.62rem;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .status-pulse {
    animation: none !important;
  }
}
