/* ==========================================================================
   Shabin Lal M. — Engineering portfolio
   Dark default. Light via html[data-theme="light"]
   ========================================================================== */

:root {
  --bg: #0c1116;
  --bg-2: #12181f;
  --surface: #171e26;
  --surface-2: #1d2630;
  --text: #f3efe6;
  --text-2: #b7bfc8;
  --text-3: #7e8792;
  --line: rgba(243, 239, 230, 0.1);
  --line-strong: rgba(243, 239, 230, 0.18);
  --accent: #d4b483;
  --accent-2: #8eb4d4;
  --accent-soft: rgba(212, 180, 131, 0.12);
  --ok: #7dbea0;
  --header-h: 76px;
  --wrap: 1280px;
  --radius: 16px;
  --font: "Manrope", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

html[data-theme="light"] {
  --bg: #f4f0e8;
  --bg-2: #ebe4d6;
  --surface: #fffaf2;
  --surface-2: #f7f1e6;
  --text: #16191e;
  --text-2: #4f5863;
  --text-3: #74808c;
  --line: rgba(22, 25, 30, 0.1);
  --line-strong: rgba(22, 25, 30, 0.18);
  --accent: #8a6424;
  --accent-2: #1e5a8a;
  --accent-soft: rgba(138, 100, 36, 0.1);
  --ok: #1f7a52;
  --shadow: 0 18px 40px rgba(22, 24, 28, 0.08);
}

html[data-theme="light"] .theme-toggle-icon {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--text);
}

html[data-theme="light"] .theme-toggle-icon::after {
  transform: scale(0);
}

*,
*::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);
  font-size: 17.5px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text);
  background: var(--bg);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 72%);
  opacity: 0.45;
}

[hidden] {
  display: none !important;
}

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

a {
  color: inherit;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: #0b0c0e;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  top: 0.8rem;
}

.wrap {
  width: min(var(--wrap), calc(100% - 56px));
  margin-inline: auto;
  text-align: left;
}

/* ----- Header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand-role {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.nav-desktop {
  margin-left: auto;
  display: flex;
  gap: 1.35rem;
}

.nav-desktop a {
  text-decoration: none;
  font-size: 0.86rem;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.5rem;
}

.theme-toggle,
.nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: none;
  position: relative;
}

.theme-toggle-icon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  transform: scale(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

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

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

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

.nav-mobile {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(16px);
  padding: 0.6rem 1.25rem 1.1rem;
}

.nav-mobile nav {
  display: grid;
  gap: 0.15rem;
}

.nav-mobile a {
  text-decoration: none;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.nav-mobile:not([hidden]) {
  display: block;
}

/* ----- Buttons ----- */

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

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

.btn-solid {
  background: var(--text);
  color: var(--bg);
}

html[data-theme="light"] .btn-solid {
  background: var(--text);
  color: #f6f4ef;
}

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

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

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* ----- Hero ----- */

.hero {
  padding: 3.4rem 0 5.2rem;
  border-bottom: 1px solid var(--line);
}

.hero-identity {
  margin-bottom: 2.6rem;
  max-width: none;
}

.hero-name {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: 0.01em;
  animation: rise 0.8s var(--ease) both;
}

.hero-name::after {
  content: "";
  display: block;
  width: min(8.5rem, 40%);
  height: 2px;
  margin-top: 0.85rem;
  background: var(--accent);
  transform-origin: left;
  animation: lineIn 0.9s var(--ease) 0.25s both;
}

.hero-role {
  margin: 1.15rem 0 0;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: rise 0.8s var(--ease) 0.08s both;
}

.hero-company {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: rise 0.8s var(--ease) 0.12s both;
}

.hero-place {
  margin: 0.25rem 0 0;
  color: var(--text-3);
  animation: rise 0.8s var(--ease) 0.16s both;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.8fr);
  gap: 3.4rem;
  align-items: start;
}

.hero-inner {
  max-width: none;
}

.hero-panel-org {
  margin: 0 0 1rem;
  color: var(--text-3);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.3rem 1.1rem;
  background: var(--surface);
}

.hero-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-panel-top .live {
  color: var(--ok);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.72rem;
}

.hero-panel-title {
  margin: 0.85rem 0 1rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.25;
}

.hero-spec {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.hero-spec li {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.hero-spec span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.12rem;
}

.hero-schematic {
  width: 100%;
  margin-top: 1.15rem;
  color: var(--text);
}

.hero-schematic text {
  fill: currentColor;
  font-family: var(--font), system-ui, sans-serif;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  animation: rise 0.7s var(--ease) both;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.01em;
  animation: rise 0.8s var(--ease) 0.18s both;
}

.hero-sub {
  margin: 1.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.hero-lead {
  margin: 1.1rem 0 0;
  max-width: 46rem;
  color: var(--text-2);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-scroll {
  display: inline-block;
  margin-top: 2.6rem;
  color: var(--text-3);
  font-size: 0.88rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

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

/* ----- Sections ----- */

.section {
  padding: 5.5rem 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2.6rem;
  text-align: left;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.kicker span {
  color: var(--accent);
}

.section h2,
.about h2,
.resume-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.section-lead {
  margin: 0.9rem 0 0;
  color: var(--text-2);
}

.section-lead code,
.resume-hint code,
.section-head code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--accent-2);
}

/* ----- About ----- */

.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 3rem;
  align-items: start;
}

.about-copy p {
  margin: 0 0 1.1rem;
  color: var(--text-2);
}

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

.about-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.about-meta dl {
  margin: 0;
  display: grid;
  gap: 1.1rem;
}

.about-meta dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.about-meta dd {
  margin: 0.25rem 0 0;
  font-weight: 550;
}

/* ----- Timeline ----- */

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

.exp-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.exp-card.is-featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 42%),
    var(--surface);
}

.exp-when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-3);
  padding-top: 0.25rem;
}

.exp-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 36rem;
}

.exp-role {
  margin: 0.2rem 0 0;
  color: var(--accent);
  font-weight: 550;
  font-size: 0.95rem;
}

.exp-meta {
  margin: 0.35rem 0 0;
  color: var(--text-3);
  font-size: 0.88rem;
}

.exp-card p {
  margin: 0.85rem 0 0;
  color: var(--text-2);
}

.exp-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-2);
}

.exp-card li + li {
  margin-top: 0.3rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: var(--bg-2);
}

/* ----- Expertise ----- */

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.exp-tile {
  padding: 1.4rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.exp-tile h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.exp-tile p {
  margin: 0;
  color: var(--text-2);
}

/* ----- Projects ----- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: -0.6rem 0 1.6rem;
}

.filter-bar button {
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
}

.filter-bar button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  min-height: 100%;
  transition: border-color 0.2s var(--ease), transform 0.25s var(--ease);
}

.project-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.project-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  overflow: hidden;
}

.project-cover .slider {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.slider {
  position: relative;
  height: 100%;
  min-height: 220px;
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s var(--ease);
}

.slider-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.slider-nav.prev { left: 0.7rem; }
.slider-nav.next { right: 0.7rem; }

.slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.7rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.slider-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 35%, transparent);
  cursor: pointer;
}

.slider-dots button.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.slider-caption {
  position: absolute;
  left: 0.9rem;
  bottom: 0.85rem;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  padding: 1.1rem 1.15rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover-placeholder.v0 {
  background:
    radial-gradient(circle at 82% 18%, var(--accent-soft), transparent 44%),
    repeating-linear-gradient(-45deg, transparent, transparent 11px, var(--line) 11px, var(--line) 12px);
}

.cover-placeholder.v1 {
  background:
    radial-gradient(circle at 18% 80%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 46%),
    repeating-linear-gradient(45deg, transparent, transparent 12px, var(--line) 12px, var(--line) 13px);
}

.cover-placeholder.v2 {
  background:
    linear-gradient(160deg, var(--accent-soft), transparent 42%),
    repeating-linear-gradient(90deg, transparent, transparent 14px, var(--line) 14px, var(--line) 15px);
}

.cover-placeholder .idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}

.cover-placeholder .cat {
  font-size: 0.8rem;
  color: var(--text-2);
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.2rem 1.25rem;
  flex: 1;
}

.project-body h3 {
  margin: 0;
  font-size: 1.12rem;
}

.project-cat {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.project-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

.project-body ul {
  margin: 0.15rem 0 0;
  padding-left: 1.05rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.project-body li + li {
  margin-top: 0.2rem;
}

.project-body .chip-row {
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.int-badge {
  font-size: 0.72rem;
  color: var(--text-3);
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ----- Flow diagram ----- */

.flow-diagram {
  margin: 0;
}

.flow-stack {
  display: grid;
  gap: 0.55rem;
  justify-items: stretch;
}

.flow-node {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  text-align: left;
}

.flow-node-root {
  background: var(--bg-2);
}

.flow-node-accent {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.flow-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.2rem;
}

.flow-node strong {
  display: block;
  font-size: 1.02rem;
}

.flow-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-3);
  font-size: 0.82rem;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.flow-arrow {
  display: grid;
  place-items: center;
  height: 22px;
}

.flow-arrow span {
  width: 1px;
  height: 100%;
  background: var(--line-strong);
  position: relative;
}

.flow-arrow span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: translateX(-50%) rotate(45deg);
}

/* ----- Integrations ----- */

.integ-board {
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.integ-col {
  display: grid;
  gap: 0.7rem;
}

.integ-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  background: var(--surface);
}

.integ-k {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.integ-card h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.05rem;
}

.integ-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
}

.integ-spine {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  display: grid;
  gap: 0;
  border-left: 1px dashed var(--line-strong);
  margin-left: 1rem;
}

.integ-spine li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-2);
}

.integ-spine li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1.05rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.integ-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  background: var(--bg-2);
  color: var(--text-2);
}

.integ-note p {
  margin: 0;
}

/* ----- Case study list ----- */

.more-projects {
  margin-top: 2.4rem;
}

.more-title {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
}

.more-projects .study-list {
  margin-top: 1rem;
}

.study-list {
  display: grid;
  gap: 0.75rem;
}

.study-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.study-row:hover {
  border-color: var(--line-strong);
}

.study-idx {
  font-family: var(--mono);
  color: var(--text-3);
  font-size: 0.8rem;
}

.study-row h3 {
  margin: 0;
  font-size: 1.05rem;
}

.study-row p {
  margin: 0.2rem 0 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* ----- Stack ----- */

.legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1rem;
  font-size: 0.88rem;
  color: var(--text-2);
}

.lg {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.lg-primary {
  background: var(--accent);
}

.lg-exp {
  background: var(--accent-2);
}

.lg-work {
  background: var(--text-3);
}

.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stack-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--surface);
}

.stack-group h3 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
}

.eng-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem;
}

.eng-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  color: var(--text-2);
}

.chip[data-level="primary"] {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--text);
}

.chip[data-level="experienced"] {
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
}

.chip[data-level="working"] {
  opacity: 0.85;
}

/* ----- Journey ----- */

.journey-line {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.journey-item {
  border-top: 2px solid var(--accent);
  padding-top: 0.85rem;
}

.journey-item span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.journey-item strong {
  display: block;
  margin-top: 0.3rem;
}

.journey-item em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  color: var(--text-3);
  font-size: 0.88rem;
}

/* ----- Clients ----- */

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.client-card {
  min-height: 140px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.client-card img {
  max-height: 36px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.2);
}

.client-mark {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
}

.client-card p {
  margin: 0.8rem 0 0;
  color: var(--text-3);
  font-size: 0.85rem;
}

/* ----- Resume ----- */

.resume {
  padding-top: 4.5rem;
}

.resume-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2.5rem;
  padding: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.resume-panel p {
  color: var(--text-2);
}

.resume-hint {
  font-size: 0.9rem;
}

.resume-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.resume-facts li {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.resume-facts span {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.2rem;
}

/* ----- Contact ----- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.contact-card {
  display: block;
  text-decoration: none;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-card span {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.contact-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.contact-card[href]:hover {
  border-color: var(--line-strong);
}

.contact-card.is-placeholder strong {
  color: var(--text-3);
  font-weight: 400;
  font-size: 0.88rem;
  font-family: var(--mono);
}

/* ----- Footer ----- */

.site-footer {
  padding: 2rem 0 2.4rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-3);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0;
}

/* ----- Case study overlay ----- */

.case-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  overflow: auto;
  padding: 2.5rem 0 4rem;
}

.case-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem 1.6rem 2.2rem;
  box-shadow: var(--shadow);
}

.case-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.case-page h2 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
}

.case-k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.icon-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.case-block {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.case-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}

.case-block p,
.case-block li {
  color: var(--text-2);
}

.case-block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.placeholder-note {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-2);
}

.case-page .slider {
  min-height: 280px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
}

.gallery button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.doc-row a {
  color: var(--accent);
  font-size: 0.88rem;
}

/* ----- Lightbox ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 6, 8, 0.88);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.lightbox-inner {
  width: min(1000px, 100%);
  position: relative;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox figcaption {
  text-align: center;
  color: #c5cad3;
  margin-top: 0.7rem;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 13, 16, 0.7);
  color: #fff;
  cursor: pointer;
  border-radius: 10px;
}

.lightbox-close {
  top: -2.6rem;
  right: 0;
  height: 36px;
  padding: 0 0.8rem;
}

.lightbox-nav {
  top: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: -0.4rem;
}

.lightbox-nav.next {
  right: -0.4rem;
}

body.case-open,
body.lb-open {
  overflow: hidden;
}

/* ----- Reveal ----- */

.hero-eyebrow {
  animation: rise 0.7s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes lineIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.rise-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.rise-in.is-in {
  opacity: 1;
  transform: none;
}

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

  .hero-name,
  .hero-name::after,
  .hero-role,
  .hero-company,
  .hero-place,
  .hero-title,
  .hero-eyebrow,
  .btn,
  .slider-track {
    animation: none !important;
    transition: none;
    transform: none;
  }

  .rise-in {
    opacity: 1;
    transform: none;
  }
}

/* ----- Responsive ----- */

@media (max-width: 980px) {
  .nav-desktop {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .header-actions .btn-sm {
    display: none;
  }

  .about-grid,
  .exp-card,
  .integ-board,
  .resume-panel,
  .client-grid,
  .stack-groups,
  .expertise-grid,
  .project-grid,
  .contact-grid,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .flow-row,
  .journey-line {
    grid-template-columns: 1fr 1fr;
  }

  .integ-spine {
    margin-left: 0.4rem;
  }

  .study-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(var(--wrap), calc(100% - 28px));
  }

  .hero {
    padding: 2.4rem 0 3.2rem;
  }

  .hero-name {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
  }

  .section {
    padding: 3.6rem 0;
  }

  .brand-text {
    display: none;
  }

  .gallery,
  .flow-row {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }

  .case-page {
    padding: 1.15rem 1rem 1.6rem;
  }

  .lightbox-nav.prev {
    left: 0;
  }

  .lightbox-nav.next {
    right: 0;
  }
}
