/* Matrix Portal X — self-contained portfolio styles */
:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-elevated: #0d121d;
  --surface: rgba(17, 23, 37, 0.78);
  --surface-solid: #111725;
  --surface-soft: #151d2d;
  --surface-hover: #192234;
  --text: #f3f6fb;
  --text-soft: #cbd3e1;
  --muted: #929eb2;
  --line: rgba(163, 177, 201, 0.15);
  --line-strong: rgba(163, 177, 201, 0.26);
  --accent: #70ead2;
  --accent-strong: #38d9ba;
  --accent-soft: rgba(112, 234, 210, 0.12);
  --violet: #9b91ff;
  --violet-soft: rgba(155, 145, 255, 0.15);
  --cyan: #62c9ff;
  --amber: #ffc978;
  --green: #8ce99a;
  --blue: #73a9ff;
  --header-bg: rgba(8, 11, 18, 0.78);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.18);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --shell: 1180px;
  --header-height: 78px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-elevated: #edf1f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: #f0f3f8;
  --surface-hover: #e8edf5;
  --text: #101722;
  --text-soft: #344054;
  --muted: #657186;
  --line: rgba(30, 48, 74, 0.12);
  --line-strong: rgba(30, 48, 74, 0.22);
  --accent: #087d6d;
  --accent-strong: #036c5f;
  --accent-soft: rgba(8, 125, 109, 0.1);
  --violet: #6458d8;
  --violet-soft: rgba(100, 88, 216, 0.1);
  --cyan: #087eb8;
  --amber: #9a6105;
  --green: #287a36;
  --blue: #2f65b9;
  --header-bg: rgba(245, 247, 251, 0.82);
  --shadow: 0 24px 80px rgba(38, 49, 67, 0.13);
  --shadow-soft: 0 12px 40px rgba(38, 49, 67, 0.09);
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 7%, rgba(112, 234, 210, 0.055), transparent 28rem),
    radial-gradient(circle at 89% 21%, rgba(155, 145, 255, 0.06), transparent 31rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 240ms ease, color 240ms ease;
}

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

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #07110f;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.42;
}

.ambient-one {
  top: 26rem;
  left: -16rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(circle, rgba(112, 234, 210, 0.12), transparent 68%);
}

.ambient-two {
  top: 105rem;
  right: -18rem;
  width: 38rem;
  height: 38rem;
  background: radial-gradient(circle, rgba(155, 145, 255, 0.12), transparent 68%);
}

/* Header */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.site-header.is-scrolled,
.site-header:has(.mobile-menu:not([hidden])) {
  border-bottom-color: var(--line);
  background: var(--header-bg);
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 43px;
  height: 43px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--surface-solid), var(--surface-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-soft);
  font-size: 0.77rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand-mark::after {
  position: absolute;
  inset: 5px 50% 5px auto;
  width: 1px;
  background: var(--line);
  content: "";
}

.brand-mark span:first-child {
  color: var(--accent);
}

.brand-mark span:last-child {
  color: var(--violet);
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-left: auto;
}

.desktop-nav a {
  position: relative;
  padding-block: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 180ms ease;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms var(--ease);
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--text);
}

.desktop-nav a:hover::after,
.desktop-nav a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button,
.header-github {
  min-width: 43px;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.icon-button:hover,
.header-github:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: block;
}

.header-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-inline: 13px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.header-github svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.menu-toggle {
  display: none;
}

.menu-icon-close {
  display: none !important;
}

.menu-toggle[aria-expanded="true"] .menu-icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon-close {
  display: block !important;
}

.mobile-menu {
  position: absolute;
  top: var(--header-height);
  right: 0;
  left: 0;
  padding: 8px 24px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.mobile-menu a:last-child {
  border-bottom: 0;
}

.mobile-menu a span {
  color: var(--accent);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(40px, 7vw, 94px);
  min-height: calc(100vh - var(--header-height));
  padding-block: clamp(70px, 10vh, 112px) 94px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 7px 12px;
  border: 1px solid rgba(112, 234, 210, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.71rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(112, 234, 210, 0.1);
}

.status-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: inherit;
  content: "";
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.75; transform: scale(0.55); }
  70%, 100% { opacity: 0; transform: scale(1.7); }
}

.hero h1,
.section-heading h2,
.connect-copy h2 {
  margin: 0;
  font-weight: 760;
  letter-spacing: -0.052em;
  line-height: 1.02;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(3.1rem, 5.7vw, 5.75rem);
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--accent) 0%, var(--cyan) 48%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lead {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: clamp(1.03rem, 1.5vw, 1.18rem);
  line-height: 1.75;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 0.88rem;
  font-weight: 740;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--text);
  box-shadow: 0 10px 30px rgba(112, 234, 210, 0.1);
  color: var(--bg);
}

.button-primary:hover {
  box-shadow: 0 14px 38px rgba(112, 234, 210, 0.18);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-hover);
}

.hero-stats {
  display: flex;
  gap: 0;
  margin: 43px 0 0;
}

.hero-stats div {
  min-width: 120px;
  padding: 0 26px;
  border-left: 1px solid var(--line);
}

.hero-stats div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats dt {
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 620;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 590px;
  perspective: 1000px;
  isolation: isolate;
}

.visual-grid {
  position: absolute;
  z-index: -3;
  inset: 4% -8%;
  background-image:
    linear-gradient(rgba(125, 146, 178, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 146, 178, 0.07) 1px, transparent 1px);
  background-position: center;
  background-size: 34px 34px;
  mask-image: radial-gradient(circle, #000 20%, transparent 69%);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 69%);
  transform: rotate(-4deg);
}

.hero-visual::before {
  position: absolute;
  z-index: -2;
  width: 77%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(112, 234, 210, 0.24), rgba(155, 145, 255, 0.11) 45%, transparent 70%);
  content: "";
  filter: blur(18px);
}

.orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}

.orbit::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  content: "";
}

.orbit-one {
  width: 480px;
  height: 480px;
  transform: rotate(34deg);
}

.orbit-one::after {
  top: 50px;
  right: 75px;
}

.orbit-two {
  width: 550px;
  height: 550px;
  border-style: dashed;
  opacity: 0.5;
  transform: rotate(-22deg);
}

.orbit-two::after {
  bottom: 87px;
  left: 51px;
  background: var(--violet);
  box-shadow: 0 0 18px var(--violet);
}

.profile-card {
  width: min(100%, 365px);
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 27px;
  background: linear-gradient(145deg, rgba(25, 33, 51, 0.95), rgba(12, 17, 28, 0.96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: rotateY(var(--tilt-x, 0deg)) rotateX(var(--tilt-y, 0deg)) rotate(-2deg);
  transition: transform 180ms ease-out;
  will-change: transform;
}

html[data-theme="light"] .profile-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(235, 240, 248, 0.97));
}

.profile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 4px 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.live-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.avatar-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 0.84;
  border-radius: 18px;
  background: var(--surface-soft);
}

.avatar-wrap picture,
.avatar-wrap img {
  width: 100%;
  height: 100%;
}

.avatar-wrap img {
  object-fit: cover;
}

.avatar-wrap::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 10, 17, 0.48), transparent 45%);
  content: "";
  pointer-events: none;
}

.avatar-ring {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  width: 15px;
  height: 15px;
  border: 3px solid #152030;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(112, 234, 210, 0.65);
}

.profile-info {
  padding: 22px 6px 17px;
}

.profile-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.15em;
}

.profile-info h2 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.profile-info > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.65;
}

.profile-stack {
  display: flex;
  gap: 7px;
  padding: 0 6px 4px;
}

.profile-stack span,
.tag-list li,
.focus-card li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 680;
  letter-spacing: 0.025em;
}

.profile-stack span {
  padding: 5px 9px;
}

.float-chip {
  position: absolute;
  z-index: 4;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.chip-model {
  top: 19%;
  left: 1%;
  color: var(--violet);
  transform: rotate(-7deg);
}

.chip-local {
  top: 31%;
  right: -4%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transform: rotate(5deg);
}

.chip-local i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.chip-npu {
  right: 1%;
  bottom: 18%;
  color: var(--cyan);
  transform: rotate(-4deg);
}

.tech-strip {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.tech-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 75px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tech-list::-webkit-scrollbar {
  display: none;
}

.tech-list span {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tech-list i {
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* Shared sections */
.section {
  padding-block: clamp(92px, 12vw, 150px);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 64px;
}

.section-index,
.card-label,
.project-meta,
.connect-links small {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-index {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.69rem;
}

.section-heading h2,
.connect-copy h2 {
  font-size: clamp(2.35rem, 4.5vw, 4.2rem);
}

.section-intro {
  max-width: 590px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  gap: clamp(60px, 9vw, 116px);
}

.about-story .large-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(1.25rem, 2.15vw, 1.75rem);
  font-weight: 440;
  letter-spacing: -0.02em;
  line-height: 1.58;
}

.about-story .large-copy em {
  color: var(--text);
  font-style: normal;
  font-weight: 650;
}

.about-story > p:nth-child(2) {
  margin: 25px 0 0;
  color: var(--muted);
  line-height: 1.82;
}

.text-link,
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.text-link {
  margin-top: 27px;
}

.text-link span,
.project-link span {
  color: var(--accent);
  transition: transform 180ms ease;
}

.text-link:hover,
.project-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

.principles {
  border-top: 1px solid var(--line);
}

.principles article {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.principle-number {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.principles h3 {
  margin: -4px 0 7px;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
}

.principles p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* Focus */
.focus-section {
  border-block: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(112, 234, 210, 0.025), transparent 40%),
    var(--bg-elevated);
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.focus-card {
  position: relative;
  min-height: 350px;
  padding: 31px 27px 26px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
  transition: background 220ms ease, transform 220ms var(--ease);
}

.focus-card::after {
  position: absolute;
  right: -65px;
  bottom: -80px;
  width: 170px;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 260ms ease, transform 420ms var(--ease);
}

.focus-card:hover {
  z-index: 1;
  background: var(--surface);
  transform: translateY(-5px);
}

.focus-card:hover::after {
  opacity: 1;
  transform: scale(1);
}

.focus-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  margin-bottom: 35px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
}

.focus-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.card-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.62rem;
}

.focus-card h3 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.focus-card > p:not(.card-label) {
  margin: 15px 0 23px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.72;
}

.focus-card ul,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.focus-card li,
.tag-list li {
  padding: 5px 8px;
}

/* Projects */
.heading-row {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 0.56fr);
  align-items: end;
  gap: 60px;
  max-width: none;
}

.heading-row .section-intro {
  margin: 0 0 4px;
}

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

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 410px;
  padding: 31px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 260ms var(--ease), border-color 220ms ease, box-shadow 260ms ease, background 220ms ease;
}

.project-card::before {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-soft), transparent 70%);
  content: "";
  opacity: 0;
  transition: opacity 260ms ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transform: translateY(-5px);
}

.project-card:hover::before {
  opacity: 1;
}

.project-featured {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.02fr) minmax(350px, 0.8fr);
  gap: clamp(45px, 7vw, 90px);
  min-height: 470px;
  padding: clamp(32px, 5vw, 58px);
  background:
    radial-gradient(circle at 86% 15%, var(--violet-soft), transparent 32%),
    radial-gradient(circle at 12% 90%, var(--accent-soft), transparent 34%),
    var(--surface);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 35px;
  color: var(--muted);
  font-size: 0.6rem;
}

.project-meta span:first-child {
  color: var(--accent);
}

.project-card h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.project-card > p,
.project-copy > p {
  position: relative;
  z-index: 1;
  margin: 17px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.project-featured .project-copy > p {
  max-width: 610px;
  font-size: 1rem;
}

.project-card .tag-list {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
}

.project-card .project-link {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
}

.project-terminal {
  align-self: center;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(5, 8, 14, 0.78);
  box-shadow: var(--shadow);
  color: #e7edf7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transform: rotate(1.5deg);
}

html[data-theme="light"] .project-terminal {
  background: #101722;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.terminal-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff806d;
}

.terminal-bar i:nth-child(2) { background: #ffd36c; }
.terminal-bar i:nth-child(3) { background: #75df92; }

.terminal-bar span {
  margin-left: 8px;
  color: #7f8ba0;
  font-size: 0.61rem;
}

.terminal-body {
  padding: 25px 24px 24px;
  font-size: 0.7rem;
}

.terminal-body p {
  display: grid;
  grid-template-columns: 82px 1fr;
  margin: 0 0 13px;
}

.terminal-body p:first-child {
  display: block;
  margin-bottom: 24px;
  color: #c9d2e1;
}

.terminal-body p:first-child span {
  color: #70ead2;
}

.terminal-body b {
  color: #758195;
  font-weight: 500;
}

.terminal-body strong {
  color: #d7dfec;
  font-weight: 620;
}

.terminal-body .terminal-accent {
  color: #70ead2;
}

.terminal-ready {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 7px 9px;
  border: 1px solid rgba(112, 234, 210, 0.18);
  border-radius: 6px;
  background: rgba(112, 234, 210, 0.08);
  color: #70ead2;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.terminal-ready i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border: 1px solid currentColor;
  border-radius: 14px;
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-icon-violet { color: var(--violet); }
.project-icon-cyan { color: var(--cyan); }
.project-icon-amber { color: var(--amber); }
.project-icon-green { color: var(--green); font-size: 1.5rem; }
.project-icon-blue { color: var(--blue); }

/* Connect */
.connect-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.7fr);
  gap: clamp(50px, 8vw, 100px);
  padding: clamp(36px, 6vw, 72px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(125deg, var(--surface-solid), var(--surface));
  box-shadow: var(--shadow-soft);
}

.connect-glow {
  position: absolute;
  top: -180px;
  left: 32%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112, 234, 210, 0.13), transparent 68%);
  pointer-events: none;
}

.connect-copy,
.connect-links {
  position: relative;
  z-index: 1;
}

.connect-copy h2 {
  max-width: 720px;
  font-size: clamp(2rem, 4vw, 3.7rem);
}

.connect-copy > p:last-child {
  max-width: 680px;
  margin: 23px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.connect-links {
  display: grid;
  align-content: center;
  gap: 10px;
}

.connect-links a {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 75px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.connect-links a:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateX(4px);
}

.social-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--text);
}

.social-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.social-icon-hf {
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 800;
}

.connect-links a > span:nth-child(2) {
  display: grid;
}

.connect-links small {
  color: var(--muted);
  font-size: 0.52rem;
}

.connect-links strong {
  margin-top: 3px;
  font-size: 0.9rem;
}

.connect-links b {
  color: var(--accent);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  min-height: 130px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark-small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.68rem;
}

.footer-brand > span:last-child {
  display: grid;
  line-height: 1.3;
}

.footer-brand strong {
  font-size: 0.81rem;
}

.footer-brand small,
.footer-inner p,
.footer-inner > a {
  color: var(--muted);
  font-size: 0.68rem;
}

.footer-brand small {
  margin-top: 3px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner > a {
  justify-self: end;
  font-weight: 680;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.footer-inner > a span {
  margin-left: 5px;
  color: var(--accent);
}

/* Motion */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.focus-grid .reveal:nth-child(2),
.projects-grid .reveal:nth-child(3) { transition-delay: 70ms; }
.focus-grid .reveal:nth-child(3),
.projects-grid .reveal:nth-child(4) { transition-delay: 140ms; }
.focus-grid .reveal:nth-child(4),
.projects-grid .reveal:nth-child(5) { transition-delay: 210ms; }
.projects-grid .reveal:nth-child(6) { transition-delay: 280ms; }

/* Responsive */
@media (max-width: 1060px) {
  .desktop-nav {
    gap: 20px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
    gap: 35px;
  }

  .hero-visual {
    min-height: 520px;
    transform: scale(0.92);
  }

  .float-chip {
    display: none;
  }

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

  .focus-card {
    min-height: 310px;
  }
}

@media (max-width: 880px) {
  :root {
    --header-height: 70px;
  }

  .shell {
    width: min(calc(100% - 38px), var(--shell));
  }

  .desktop-nav,
  .header-github span {
    display: none;
  }

  .header-github {
    width: 43px;
    padding: 0;
  }

  .menu-toggle {
    display: grid;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 80px;
  }

  .hero-copy {
    max-width: 740px;
  }

  .hero h1 {
    max-width: 680px;
  }

  .hero-visual {
    width: min(100%, 580px);
    min-height: 560px;
    margin: -20px auto 0;
    transform: none;
  }

  .chip-model,
  .chip-local,
  .chip-npu {
    display: block;
  }

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

  .about-grid {
    gap: 55px;
  }

  .heading-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-featured {
    grid-template-columns: 1fr;
  }

  .project-terminal {
    max-width: 520px;
    margin-inline: auto;
    transform: none;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(calc(100% - 30px), var(--shell));
  }

  .brand-copy small {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .header-actions {
    gap: 7px;
  }

  .header-github {
    display: none;
  }

  .hero {
    gap: 28px;
    padding-block: 65px 75px;
  }

  .eyebrow {
    margin-bottom: 19px;
    font-size: 0.63rem;
  }

  .hero h1 {
    font-size: clamp(2.75rem, 13.6vw, 4.45rem);
  }

  .hero-lead {
    margin-top: 22px;
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .hero-cta {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .button {
    width: 100%;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 35px;
  }

  .hero-stats div {
    min-width: 0;
    padding: 0 12px;
  }

  .hero-stats dt {
    font-size: 1.05rem;
  }

  .hero-stats dd {
    font-size: 0.57rem;
    line-height: 1.45;
  }

  .hero-visual {
    min-height: 475px;
  }

  .visual-grid {
    inset: 4% 0;
  }

  .orbit-one,
  .orbit-two {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .profile-card {
    width: min(86%, 342px);
  }

  .orbit-one {
    width: 390px;
    height: 390px;
  }

  .orbit-two {
    width: 455px;
    height: 455px;
  }

  .float-chip {
    font-size: 0.58rem;
  }

  .chip-model { left: 0; }
  .chip-local { right: 0; }
  .chip-npu { right: 3%; }

  .tech-list {
    min-height: 66px;
    padding-right: 15px;
  }

  .section {
    padding-block: 92px;
  }

  .section-heading {
    margin-bottom: 44px;
  }

  .section-heading h2,
  .connect-copy h2 {
    font-size: clamp(2.25rem, 10.5vw, 3.4rem);
  }

  .focus-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .focus-card {
    min-height: auto;
  }

  .project-featured {
    grid-column: auto;
    min-height: 0;
    padding: 27px;
  }

  .project-card {
    min-height: 385px;
    padding: 26px;
  }

  .project-featured .project-copy > p {
    font-size: 0.91rem;
  }

  .terminal-body {
    padding-inline: 18px;
  }

  .connect-card {
    gap: 38px;
    border-radius: 22px;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    min-height: 145px;
  }

  .footer-inner p {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand-copy strong {
    font-size: 0.84rem;
  }

  .hero-stats div {
    padding-inline: 8px;
  }

  .hero-visual {
    min-height: 430px;
    margin-top: -10px;
  }

  .profile-card {
    width: 90%;
    padding: 13px;
  }

  .avatar-wrap {
    aspect-ratio: 1 / 0.78;
  }

  .profile-info {
    padding-block: 17px 13px;
  }

  .profile-info h2 {
    font-size: 1.35rem;
  }

  .profile-info > p:last-child {
    font-size: 0.72rem;
  }

  .orbit-one {
    width: min(335px, 100%);
    height: auto;
  }

  .orbit-two {
    width: min(390px, 100%);
    height: auto;
  }

  .chip-model,
  .chip-npu {
    display: none;
  }

  .chip-local {
    top: 27%;
  }

  .projects-grid {
    gap: 14px;
  }

  .project-card,
  .project-featured {
    padding: 23px;
    border-radius: 17px;
  }

  .terminal-body p {
    grid-template-columns: 68px 1fr;
    font-size: 0.62rem;
  }

  .connect-card {
    padding: 28px 22px;
  }

  .connect-links a {
    grid-template-columns: 44px 1fr auto;
    gap: 11px;
  }

  .social-icon {
    width: 44px;
    height: 44px;
  }

  .footer-brand small {
    display: none;
  }
}

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

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

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

@media print {
  :root,
  html[data-theme] {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --surface-solid: #fff;
    --surface-soft: #f6f6f6;
    --text: #111;
    --text-soft: #333;
    --muted: #555;
    --line: #ddd;
    --line-strong: #bbb;
  }

  .site-header,
  .hero-visual,
  .ambient,
  .tech-strip,
  .connect-links,
  .site-footer {
    display: none !important;
  }

  .hero {
    display: block;
    min-height: 0;
    padding-block: 30px;
  }

  .section {
    padding-block: 30px;
    break-inside: avoid;
  }

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

  .project-featured {
    display: block;
    grid-column: 1 / -1;
  }

  .project-terminal {
    display: none;
  }
}
