/* =========================================================
   M. DIMAS MAULANA — PORTFOLIO
   Shared visual system for Home, Blog, Products
========================================================= */

:root {
  --bg-primary: #07111f;
  --bg-deep: #050d18;
  --bg-secondary: #091522;
  --text-primary: #f4f6fa;
  --text-secondary: #a5b0bf;
  --text-muted: #68778b;
  --accent: #ff304f;
  --accent-bright: #ff4964;
  --accent-dark: #c91839;
  --border: rgba(150,165,185,0.15);
  --border-hover: rgba(255,48,79,0.46);
  --border-accent: rgba(255,48,79,0.80);
  --container: 1480px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", monospace;
  --radius-md: 15px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.22,1,0.36,1);
}

/* RESET */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-primary), var(--bg-deep));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;
  z-index: 5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
}

img {
  max-width: 100%;
}

::selection {
  color: white;
  background: var(--accent);
}

/* VISUAL ATMOSPHERE */

.aurora-layer {
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: blur(90px);
}

.aurora-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}

.aurora-one {
  top: 2%;
  right: 8%;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(255,48,79,0.13), rgba(255,48,79,0.035) 45%, transparent 70%);
  animation: auroraDriftA 26s ease-in-out infinite;
}

.aurora-two {
  bottom: 6%;
  left: -4%;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(255,48,79,0.075), transparent 68%);
  animation: auroraDriftB 34s ease-in-out infinite;
}

.aurora-three {
  top: 38%;
  left: 34%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(90,130,255,0.04), transparent 68%);
  animation: auroraDriftA 42s ease-in-out infinite;
}

.grid-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 72px 72px;
}

.cursor-grid-light {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  --mouse-x: 50vw;
  --mouse-y: 20vh;
  opacity: 0;
  background-image:
    linear-gradient(rgba(255,48,79,0.23) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,48,79,0.23) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(220px circle at var(--mouse-x) var(--mouse-y), #000 0%, rgba(0,0,0,0.28) 43%, transparent 74%);
  -webkit-mask-image: radial-gradient(220px circle at var(--mouse-x) var(--mouse-y), #000 0%, rgba(0,0,0,0.28) 43%, transparent 74%);
  transition: opacity 180ms ease;
}

.cursor-grid-light.visible {
  opacity: 0.72;
}

.grain-layer {
  position: fixed;
  inset: -50px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.2s steps(4) infinite;
}

@keyframes auroraDriftA {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-6%,4%,0) scale(1.12); }
}

@keyframes auroraDriftB {
  0%,100% { transform: translate3d(0,0,0) scale(1.05); }
  50% { transform: translate3d(7%,-5%,0) scale(0.95); }
}

@keyframes grainShift {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); }
  75% { transform: translate(-1%,-1%); }
  100% { transform: translate(0,0); }
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(7,17,31,0.72);
  border-bottom: 1px solid rgba(150,165,185,0.10);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.site-header-inner {
  width: min(calc(100% - 96px), var(--container));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-bright));
  box-shadow: 0 0 14px rgba(255,48,79,0.45);
}

.brand-logo {
  display: inline-flex;
  align-items: baseline;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -0.08em;
  transition: opacity 180ms ease, transform 180ms ease;
}

.brand-logo:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.brand-dot {
  margin-left: 3px;
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 0 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 180ms ease, transform 180ms ease;
}

.nav-number {
  color: var(--text-muted);
  transition: color 180ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
  transition: width 320ms var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-link:hover .nav-number,
.nav-link.active .nav-number {
  color: var(--accent);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  width: 38%;
}

/* SOCIAL RAILS */

.social-rail {
  position: fixed;
  z-index: 700;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
}

.social-rail-left { left: 34px; }
.social-rail-right { right: 34px; }

.social-rail-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.social-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: color 200ms ease, transform 240ms var(--ease-out);
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.social-link-placeholder { opacity: 0.68; }

.social-rail-line {
  width: 1px;
  height: 92px;
  background: linear-gradient(to bottom, rgba(255,48,79,0.96), rgba(255,48,79,0.20));
  box-shadow: 0 0 12px rgba(255,48,79,0.20);
}

.email-rail-link {
  margin-bottom: 22px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  transition: color 200ms ease, transform 240ms var(--ease-out);
}

.email-rail-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* REVEAL */

.reveal-mask {
  overflow: hidden;
  padding-bottom: 0.08em;
}

.reveal-item {
  animation: fadeUp 850ms var(--ease-out) both;
}

.reveal-mask > .reveal-item {
  animation-name: revealUp;
}

.reveal-delay-1 { animation-delay: 90ms; }
.reveal-delay-2 { animation-delay: 260ms; }

.section-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 760ms var(--ease-out), transform 760ms var(--ease-out);
}

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

@keyframes revealUp {
  from { transform: translateY(112%); }
  to { transform: translateY(0); }
}

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

/* HOME HERO */

#home,
#stack,
#profile {
  scroll-margin-top: 105px;
}

.hero-section {
  width: min(calc(100% - 96px), var(--container));
  min-height: 650px;
  margin: 0 auto;
  padding: 82px 0 108px;
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(360px,0.7fr);
  align-items: center;
  gap: 92px;
}

.hero-content { max-width: 825px; }

.hero-eyebrow {
  margin: 0 0 23px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.eyebrow-accent {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255,48,79,0.32);
}

.hero-title {
  margin: 0 0 28px;
  font-size: clamp(55px,5vw,82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.hero-title-gradient {
  background: linear-gradient(96deg, #ffffff 12%, #dfe6f2 46%, #97a4b8 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.accent-dot,
.accent-text {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

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

.hero-copy p {
  margin: 0 0 20px;
  font-size: clamp(17px,1.2vw,20px);
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

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

.hero-copy strong {
  color: var(--accent);
  font-weight: 700;
  background-image: linear-gradient(rgba(255,48,79,0.50), rgba(255,48,79,0.50));
  background-repeat: no-repeat;
  background-position: left 92%;
  background-size: 0% 1px;
  transition: background-size 340ms var(--ease-out), text-shadow 240ms ease;
}

.hero-copy strong:hover {
  background-size: 100% 1px;
  text-shadow: 0 0 18px rgba(255,48,79,0.34);
}

/* PORTRAIT */

.hero-visual {
  position: relative;
  min-height: 470px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1100px;
}

.portrait-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  max-width: 90%;
  border-radius: 50%;
  filter: blur(26px);
  background: radial-gradient(circle, rgba(255,48,79,0.13), rgba(255,48,79,0.03) 46%, transparent 72%);
}

.portrait-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.portrait-ring-outer {
  width: 430px;
  height: 430px;
  max-width: 104%;
  max-height: 104%;
  opacity: 0.48;
  border: 1px dashed rgba(255,48,79,0.48);
  animation: ringSpin 44s linear infinite;
}

.portrait-ring-inner {
  width: 340px;
  height: 340px;
  max-width: 88%;
  max-height: 88%;
  opacity: 0.30;
  border: 1px solid rgba(150,165,185,0.22);
  animation: ringSpinBack 60s linear infinite;
}

.portrait-orbit-dot-wrap {
  position: absolute;
  width: 430px;
  height: 430px;
  max-width: 104%;
  max-height: 104%;
  animation: ringSpin 22s linear infinite;
  pointer-events: none;
}

.portrait-orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 3.2s ease-in-out infinite;
}

@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes ringSpinBack { to { transform: rotate(-360deg); } }

@keyframes pulseDot {
  0%,100% { opacity: 1; box-shadow: 0 0 14px rgba(255,48,79,0.9); }
  50% { opacity: 0.45; box-shadow: 0 0 24px rgba(255,48,79,0.48); }
}

.portrait-frame {
  position: relative;
  z-index: 3;
  width: 302px;
  max-width: 78%;
  aspect-ratio: 0.92;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,48,79,0.65);
  background: var(--bg-secondary);
  box-shadow: 0 22px 60px rgba(0,0,0,0.42), 0 0 42px rgba(255,48,79,0.10);
  transform-style: preserve-3d;
  transition: transform 380ms var(--ease-out), box-shadow 380ms ease;
}

.profile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%) contrast(1.05) brightness(0.95);
  transition: filter 700ms var(--ease-out), transform 800ms var(--ease-out);
}

.portrait-frame:hover .profile-image {
  filter: grayscale(0%) contrast(1.02) brightness(1);
  transform: scale(1.03);
}

.portrait-frame:hover {
  box-shadow: 0 26px 70px rgba(0,0,0,0.46), 0 0 48px rgba(255,48,79,0.13);
}

.portrait-tone-overlay,
.portrait-scanlines,
.portrait-inner-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portrait-tone-overlay {
  background: linear-gradient(180deg, rgba(255,48,79,0.08), transparent 40%, rgba(5,13,24,0.52));
  mix-blend-mode: soft-light;
}

.portrait-scanlines {
  opacity: 0.12;
  background-image: repeating-linear-gradient(180deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 3px);
}

.portrait-inner-shadow {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -40px 60px rgba(5,13,24,0.50);
}

.location-info {
  position: absolute;
  z-index: 5;
  right: 2%;
  bottom: 8%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 13px;
  border-radius: 999px;
  border: 1px solid rgba(150,165,185,0.18);
  background: rgba(9,21,34,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.35);
}

.location-icon {
  display: flex;
  color: var(--accent);
  font-size: 17px;
}

.location-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.location-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.location-place {
  font-size: 14px;
  font-weight: 500;
}

/* SHARED SECTIONS */

.stack-section,
.profile-section,
.topic-section {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
  border-top: 1px solid rgba(150,165,185,0.14);
}

.stack-section { padding: 74px 0 100px; }
.profile-section { padding: 74px 0 110px; }
.topic-section { padding: 74px 0 110px; }

.section-heading,
.profile-heading {
  margin-bottom: 42px;
}

.section-heading h2,
.profile-heading h2 {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: clamp(38px,4vw,58px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.047em;
}

.section-title-main { color: var(--text-primary); }
.section-title-accent { color: var(--accent); }

.section-heading p,
.profile-heading p {
  max-width: 640px;
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.compact-heading { margin-bottom: 38px; }

/* STACK + CARD SHEEN */

.stack-categories {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stack-card,
.topic-card,
.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(14,28,44,0.92), rgba(8,20,33,0.84));
  transition: transform 320ms var(--ease-out), border-color 320ms ease, box-shadow 320ms ease;
}

.stack-card {
  appearance: none;
  min-height: 158px;
  padding: 25px 24px 22px;
  text-align: left;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.card-sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -48%;
  width: 38%;
  pointer-events: none;
  opacity: 0;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.055), transparent);
  transition: left 820ms var(--ease-out), opacity 220ms ease;
}

.stack-card:hover .card-sheen,
.topic-card:hover .card-sheen,
.product-card:hover .card-sheen {
  left: 120%;
  opacity: 1;
}

.stack-card:hover,
.topic-card:hover,
.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 44px rgba(0,0,0,0.30);
}

.stack-card.active {
  border-color: var(--border-accent);
  background: linear-gradient(145deg, rgba(255,48,79,0.095), rgba(10,20,34,0.96) 52%);
  box-shadow: 0 0 30px rgba(255,48,79,0.08), inset 0 0 30px rgba(255,48,79,0.035);
}

.stack-card.active::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.stack-card.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

.stack-card-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-weight: 650;
}

.stack-icon {
  width: 28px;
  min-width: 28px;
  display: inline-flex;
  justify-content: center;
  color: var(--accent);
  font-size: 21px;
}

.stack-card p {
  position: relative;
  z-index: 2;
  max-width: 200px;
  margin: 18px 42px 0 42px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.stack-arrow {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(150,165,185,0.22);
  color: var(--text-secondary);
  font-size: 12px;
  transition: color 300ms ease, border-color 300ms ease, background 300ms ease, transform 300ms ease;
}

.stack-card:hover .stack-arrow,
.stack-card.active .stack-arrow {
  color: white;
  border-color: rgba(255,48,79,0.55);
  background: rgba(255,48,79,0.06);
}

.stack-card.active .stack-arrow {
  transform: rotate(180deg);
}

/* STACK DETAIL */

.stack-detail,
.coming-soon-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,48,79,0.55);
  background: linear-gradient(135deg, rgba(255,48,79,0.05), rgba(8,19,31,0.97) 38%, rgba(8,19,31,0.97));
  box-shadow: 0 0 52px rgba(255,48,79,0.05), inset 0 1px 0 rgba(255,255,255,0.05);
}

.stack-detail {
  display: grid;
  grid-template-columns: minmax(270px,0.72fr) minmax(640px,1.55fr);
  align-items: center;
  gap: 52px;
  min-height: 230px;
  padding: 42px 52px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.detail-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.48;
  background-image: repeating-linear-gradient(135deg, rgba(255,48,79,0.045) 0 1px, transparent 1px 9px);
  mask-image: radial-gradient(70% 80% at 6% 0%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(70% 80% at 6% 0%, #000, transparent 72%);
}

.stack-detail-intro {
  position: relative;
  z-index: 2;
  min-height: 118px;
  padding-right: 42px;
  display: flex;
  align-items: flex-start;
  gap: 22px;
  border-right: 1px solid var(--border);
}

.detail-icon {
  width: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  justify-content: center;
  color: var(--accent);
  font-size: 37px;
}

.stack-detail-intro h3 {
  margin: 2px 0 10px;
  font-size: clamp(28px,2.4vw,34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.038em;
}

.stack-detail-intro p {
  margin: 0;
  max-width: 330px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.stack-skills {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack-skills[data-count="4"] { gap: 21px; }

.skill-item { position: relative; }

.skill-row {
  display: grid;
  grid-template-columns: minmax(250px,320px) minmax(260px,1fr);
  align-items: center;
  column-gap: clamp(38px,4vw,64px);
}

.skill-name {
  width: 100%;
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  transition: color 200ms ease, transform 240ms var(--ease-out);
}

.skill-name:not(button) { cursor: help; }
button.skill-name { cursor: pointer; }

.skill-name:hover {
  color: var(--accent-bright);
  transform: translateX(4px);
}

.skill-label { min-width: 0; }

.platform-icon {
  width: 28px;
  min-width: 28px;
  display: inline-flex;
  justify-content: center;
  font-size: 17px;
}

.skill-expand-icon {
  margin-left: auto;
  padding-left: 12px;
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 300ms var(--ease-out), color 200ms ease;
}

.skill-item.expanded .skill-expand-icon {
  color: var(--accent);
  transform: rotate(180deg);
}

.skill-bar {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150,165,185,0.12);
}

.skill-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(150,165,185,0.26) calc(25% - 1px) 25%);
}

.skill-progress {
  position: relative;
  display: block;
  width: calc(var(--progress,0) * 1%);
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent) 55%, var(--accent-bright));
  box-shadow: 0 0 16px rgba(255,48,79,0.30);
  transition: transform 650ms var(--ease-out);
}

.skill-progress::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.42), transparent);
  animation: shimmerSweep 3.8s cubic-bezier(0.4,0,0.2,1) infinite;
}

.skill-progress.is-visible { transform: scaleX(1); }

@keyframes shimmerSweep {
  0% { transform: translateX(-120%); }
  60%,100% { transform: translateX(320%); }
}

/* SUBSKILLS */

.subskills-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows 340ms var(--ease-out), opacity 260ms ease, margin-top 340ms var(--ease-out);
}

.subskills-inner { overflow: hidden; }

.skill-item.expanded .subskills-collapse {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 13px;
}

.subskill-row + .subskill-row { margin-top: 9px; }

.subskill-row.has-bar {
  display: grid;
  grid-template-columns: minmax(250px,320px) minmax(260px,1fr);
  align-items: center;
  column-gap: clamp(38px,4vw,64px);
}

.subskill-name {
  padding-left: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.subskill-dot {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: rgba(255,48,79,0.72);
}

.subskill-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150,165,185,0.09);
}

.subskill-progress {
  display: block;
  width: calc(var(--progress,0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(201,24,57,0.8), rgba(255,48,79,0.82));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 520ms var(--ease-out);
}

.subskill-progress.is-visible { transform: scaleX(1); }

.subskill-row.no-bar {
  padding: 3px 0 3px 40px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.subskill-row.no-bar .subskill-name { padding-left: 0; }

/* TOOLTIP */

.skill-tooltip {
  position: fixed;
  z-index: 9999;
  width: min(340px,calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255,48,79,0.62);
  border-radius: 11px;
  background: rgba(6,15,27,0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 18px 44px rgba(0,0,0,0.36), 0 0 28px rgba(255,48,79,0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.skill-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* CERTIFICATIONS */

.certification-list {
  border-top: 1px solid rgba(150,165,185,0.14);
}

.certification-item {
  position: relative;
  border-bottom: 1px solid rgba(150,165,185,0.14);
}

.certification-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: scaleY(0);
  transform-origin: top center;
  background: linear-gradient(180deg, var(--accent), rgba(255,48,79,0.08));
  transition: transform 400ms var(--ease-out);
}

.certification-item[open]::before { transform: scaleY(1); }

.certification-summary {
  list-style: none;
  width: 100%;
  min-height: 84px;
  padding: 22px 10px;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) 38px;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 300ms ease, padding-left 320ms var(--ease-out), color 200ms ease;
}

.certification-summary::-webkit-details-marker { display: none; }
.certification-summary::marker { content: ""; }

.certification-summary:hover {
  padding-left: 24px;
  color: var(--accent-bright);
  background: rgba(255,48,79,0.03);
}

.certification-item[open] .certification-summary {
  background: rgba(255,48,79,0.025);
}

.certification-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: color 300ms ease;
}

.certification-item[open] .certification-index { color: var(--accent); }

.certification-name {
  min-width: 0;
  font-size: clamp(15px,1.3vw,19px);
  font-weight: 600;
  line-height: 1.4;
  text-wrap: pretty;
}

.certification-chevron {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(150,165,185,0.22);
  color: var(--text-secondary);
  font-size: 11px;
  transition: transform 340ms var(--ease-out), border-color 300ms ease, color 300ms ease;
}

.certification-item[open] .certification-chevron {
  color: var(--accent-bright);
  border-color: rgba(255,48,79,0.62);
  transform: rotate(180deg);
}

.certification-content {
  padding: 4px 10px 40px 68px;
  animation: certificateReveal 420ms var(--ease-out);
}

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

.certificate-frame {
  width: min(100%,560px);
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(150,165,185,0.16);
  background: rgba(244,246,250,0.96);
  box-shadow: 0 26px 64px rgba(0,0,0,0.30);
}

.certificate-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

/* BLOG + PRODUCTS HERO */

.subpage-hero {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  min-height: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 86px 0 100px;
}

.subpage-hero-inner {
  position: relative;
  width: 100%;
  min-height: 370px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-right: 35%;
}

.subpage-kicker {
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kicker-line {
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.subpage-title {
  margin: 0 0 30px;
  font-size: clamp(54px,6vw,92px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.subpage-intro {
  max-width: 760px;
}

.subpage-intro p {
  margin: 0 0 18px;
  font-size: clamp(17px,1.25vw,20px);
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

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

.subpage-orbit {
  position: absolute;
  right: 2%;
  top: 50%;
  width: 330px;
  height: 330px;
  transform: translateY(-50%);
  pointer-events: none;
}

.subpage-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.subpage-orbit-ring.ring-a {
  border: 1px dashed rgba(255,48,79,0.38);
  animation: ringSpin 40s linear infinite;
}

.subpage-orbit-ring.ring-b {
  inset: 52px;
  border: 1px solid rgba(150,165,185,0.18);
  animation: ringSpinBack 54s linear infinite;
}

.subpage-orbit-dot {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(255,48,79,0.65);
  animation: pulseDot 3.2s ease-in-out infinite;
}

/* TOPIC + PRODUCT CARDS */

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

.product-grid { margin-bottom: 28px; }

.topic-card,
.product-card {
  min-height: 250px;
  padding: 28px 28px 30px;
  border-radius: var(--radius-md);
}

.product-card { min-height: 270px; }

.topic-number {
  position: absolute;
  right: 22px;
  top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(165,176,191,0.38);
}

.topic-icon,
.product-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 12px;
  border: 1px solid rgba(255,48,79,0.30);
  background: rgba(255,48,79,0.055);
  color: var(--accent);
  font-size: 18px;
  transition: transform 300ms var(--ease-out), border-color 300ms ease, background 300ms ease;
}

.topic-card:hover .topic-icon,
.product-card:hover .product-icon {
  transform: translateY(-2px) rotate(-2deg);
  border-color: rgba(255,48,79,0.60);
  background: rgba(255,48,79,0.09);
}

.topic-card h3,
.product-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.topic-card p,
.product-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.coming-note {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
}

.coming-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255,48,79,0.58);
}

.future-label {
  position: absolute;
  left: 28px;
  bottom: 24px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(150,165,185,0.16);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(9,21,34,0.60);
}

.coming-soon-panel {
  margin-top: 28px;
  min-height: 260px;
  padding: 44px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.coming-soon-panel > div {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.coming-soon-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(30px,3vw,44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.coming-soon-panel p {
  margin: 0;
  max-width: 700px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.coming-soon-mark {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: clamp(58px,7vw,100px);
  line-height: 1;
  color: rgba(255,255,255,0.05);
}

/* FOOTER */

.site-footer {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
  padding: 28px 0 46px;
  border-top: 1px solid rgba(150,165,185,0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--text-secondary);
}

.footer-socials a {
  font-size: 16px;
  transition: transform 240ms var(--ease-out), color 200ms ease;
}

.footer-socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ACCESSIBILITY */

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.skill-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

/* TABLET */

@media (max-width: 1180px) {
  .site-header-inner,
  .hero-section,
  .stack-section,
  .profile-section,
  .subpage-hero,
  .topic-section,
  .site-footer {
    width: min(calc(100% - 56px), var(--container));
  }

  .main-nav { gap: 24px; }
  .social-rail-left { left: 18px; }
  .social-rail-right { right: 18px; }

  .hero-section {
    grid-template-columns: minmax(0,1.15fr) minmax(300px,0.85fr);
    gap: 48px;
  }

  .portrait-frame { width: 270px; }

  .portrait-ring-outer,
  .portrait-orbit-dot-wrap {
    width: 380px;
    height: 380px;
  }

  .portrait-ring-inner {
    width: 300px;
    height: 300px;
  }

  .stack-categories {
    grid-template-columns: repeat(5,minmax(190px,1fr));
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
  }

  .stack-categories::-webkit-scrollbar { display: none; }

  .stack-detail {
    grid-template-columns: minmax(230px,0.7fr) minmax(560px,1.5fr);
    gap: 38px;
    padding: 36px 38px;
  }

  .skill-row,
  .subskill-row.has-bar {
    grid-template-columns: minmax(220px,270px) minmax(220px,1fr);
    column-gap: 32px;
  }

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

  .subpage-hero-inner { padding-right: 30%; }

  .subpage-orbit {
    width: 280px;
    height: 280px;
  }
}

/* MOBILE / SMALL TABLET */

@media (max-width: 820px) {
  .social-rail { display: none; }
  .grain-layer { opacity: 0.02; }
  .cursor-grid-light { display: none; }

  .site-header-inner {
    width: calc(100% - 36px);
    min-height: 74px;
  }

  .main-nav {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    justify-content: flex-end;
    gap: clamp(9px, 2.2vw, 18px);
    overflow: visible;
  }

  .nav-link {
    flex-shrink: 0;
    font-size: 10.5px;
    gap: 5px;
  }

  #home,
  #stack,
  #profile {
    scroll-margin-top: 92px;
  }

  .hero-section {
    width: calc(100% - 36px);
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 50px;
    padding: 68px 0 80px;
  }

  .hero-title { font-size: clamp(43px,12vw,63px); }
  .hero-copy p { font-size: 16px; }
  .hero-visual { min-height: 400px; }

  .portrait-frame {
    width: min(270px,75vw);
  }

  .portrait-ring-outer,
  .portrait-orbit-dot-wrap {
    width: 315px;
    height: 315px;
  }

  .portrait-ring-inner {
    width: 248px;
    height: 248px;
  }

  .location-info {
    right: auto;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: max-content;
  }

  .stack-section,
  .profile-section,
  .subpage-hero,
  .topic-section,
  .site-footer {
    width: calc(100% - 36px);
  }

  .stack-section,
  .profile-section,
  .topic-section {
    padding: 64px 0 84px;
  }

  .section-heading h2,
  .profile-heading h2 {
    font-size: clamp(34px,8.8vw,46px);
  }

  .section-heading p,
  .profile-heading p {
    font-size: 15px;
  }

  .stack-categories {
    display: flex;
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    margin: 0 0 22px;
    padding: 10px 2px 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stack-card {
    flex: 0 0 min(82vw,320px);
    width: min(82vw,320px);
    min-height: 145px;
    scroll-snap-align: start;
  }

  .stack-card:hover { transform: none; }

  .stack-detail {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 24px;
  }

  .stack-detail-intro {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 28px;
  }

  .skill-row,
  .subskill-row.has-bar {
    grid-template-columns: minmax(210px,260px) minmax(180px,1fr);
    column-gap: 26px;
  }

  .certification-summary {
    min-height: 76px;
    padding: 20px 2px;
    grid-template-columns: 30px minmax(0,1fr) 34px;
    gap: 12px;
  }

  .certification-summary:hover { padding-left: 2px; }

  .certification-content {
    padding: 2px 0 30px 42px;
  }

  .certificate-frame {
    width: 100%;
    padding: 10px;
  }

  .subpage-hero {
    min-height: auto;
    padding: 76px 0 86px;
  }

  .subpage-hero-inner {
    min-height: 420px;
    padding-right: 0;
    padding-bottom: 170px;
  }

  .subpage-title { font-size: clamp(46px,12vw,68px); }
  .subpage-intro p { font-size: 16px; }

  .subpage-orbit {
    top: auto;
    right: 50%;
    bottom: -45px;
    width: 220px;
    height: 220px;
    transform: translateX(50%);
  }

  .topic-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .topic-card,
  .product-card {
    min-height: 230px;
  }

  .coming-soon-panel {
    padding: 34px 28px;
    flex-direction: column;
    align-items: flex-start;
  }

  .coming-soon-mark { align-self: flex-end; }
}

/* MOBILE */

@media (max-width: 620px) {
  .site-header-inner,
  .hero-section,
  .stack-section,
  .profile-section,
  .subpage-hero,
  .topic-section,
  .site-footer {
    width: calc(100% - 28px);
  }

  .brand-logo { font-size: 26px; }

  .site-header-inner {
    gap: 12px;
  }

  .main-nav {
    flex: 1 1 auto;
    max-width: none;
    gap: clamp(7px, 2vw, 12px);
    justify-content: space-between;
  }

  .nav-link {
    font-size: 9.6px;
    gap: 4px;
  }

  .hero-title { font-size: 41px; }
  .hero-eyebrow { font-size: 13px; }

  .section-heading,
  .profile-heading {
    margin-bottom: 34px;
  }

  .section-heading h2,
  .profile-heading h2 {
    font-size: clamp(31px,8.1vw,36px);
  }

  .section-title-main,
  .section-title-accent {
    white-space: nowrap;
  }

  .stack-card {
    flex-basis: min(calc(100vw - 64px),326px);
    width: min(calc(100vw - 64px),326px);
  }

  .stack-detail { padding: 26px 20px; }

  .skill-row {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .subskill-row.has-bar {
    grid-template-columns: 1fr;
    row-gap: 7px;
  }

  .subskill-row.has-bar .subskill-bar {
    margin-left: 40px;
    width: calc(100% - 40px);
  }

  .certification-index { font-size: 10px; }
  .certification-name { font-size: 14px; }
  .certification-content { padding-left: 0; }

  .subpage-title { font-size: clamp(42px,11.5vw,58px); }

  .topic-card,
  .product-card {
    padding: 24px 24px 28px;
  }

  .future-label { left: 24px; }

  .site-footer {
    padding: 26px 0 36px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .footer-socials { order: -1; }
}

@media (max-width: 390px) {

  .site-header-inner {
    gap: 9px;
  }

  .brand-logo {
    font-size: 24px;
  }

  .main-nav {
    gap: 6px;
  }

  .nav-link {
    font-size: 8.9px;
    gap: 3px;
  }
  .site-header-inner,
  .hero-section,
  .stack-section,
  .profile-section,
  .subpage-hero,
  .topic-section,
  .site-footer {
    width: calc(100% - 24px);
  }

  .section-heading h2,
  .profile-heading h2 {
    font-size: 30px;
  }

  .stack-card {
    flex-basis: calc(100vw - 52px);
    width: calc(100vw - 52px);
  }

  .stack-detail { padding: 24px 18px; }

  .certification-summary {
    grid-template-columns: 24px minmax(0,1fr) 32px;
    gap: 9px;
  }

  .subpage-title { font-size: 40px; }
}

/* TOUCH + REDUCED MOTION */

@media (hover: none) {
  .profile-image {
    filter: grayscale(0%) contrast(1.02) brightness(1);
  }

  .skill-tooltip { display: none; }
}

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

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

  .cursor-grid-light { display: none; }
}


/* =========================================================
   25. FRAMEWORKS / SYSTEMS PAGE
========================================================= */

.framework-section {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
  padding: 74px 0 110px;
  border-top: 1px solid rgba(150,165,185,0.14);
}

.framework-intro {
  max-width: 790px;
}

.framework-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.framework-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: grid;
  grid-template-columns: 118px minmax(0,1fr) auto;
  align-items: center;
  gap: 36px;
  padding: 34px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(14,28,44,0.92), rgba(8,20,33,0.84));
  transition:
    transform 320ms var(--ease-out),
    border-color 320ms ease,
    box-shadow 320ms ease,
    background 320ms ease;
}

.framework-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 2px;
  transform: scaleY(0.32);
  border-radius: 99px;
  background: var(--accent);
  opacity: 0.34;
  transition:
    transform 360ms var(--ease-out),
    opacity 300ms ease;
}

.framework-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background:
    linear-gradient(145deg, rgba(255,48,79,0.055), rgba(8,20,33,0.92) 42%);
  box-shadow:
    0 22px 50px rgba(0,0,0,0.30),
    0 0 32px rgba(255,48,79,0.05);
}

.framework-card:hover::after {
  transform: scaleY(1);
  opacity: 1;
}

.framework-card-index {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 30px;
  border-right: 1px solid var(--border);
}

.framework-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.framework-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(255,48,79,0.32);
  background: rgba(255,48,79,0.055);
  color: var(--accent);
  font-size: 19px;
  transition:
    transform 320ms var(--ease-out),
    background 320ms ease,
    border-color 320ms ease;
}

.framework-card:hover .framework-icon {
  transform: rotate(-3deg) translateY(-2px);
  background: rgba(255,48,79,0.09);
  border-color: rgba(255,48,79,0.62);
}

.framework-card-content {
  min-width: 0;
}

.framework-label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.framework-card h3 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(23px,2.2vw,34px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.framework-description {
  max-width: 850px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.framework-flow {
  margin-top: 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.framework-flow span {
  padding: 8px 11px;
  border: 1px solid rgba(150,165,185,0.15);
  border-radius: 999px;
  background: rgba(9,21,34,0.68);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.framework-flow i {
  color: rgba(255,48,79,0.58);
  font-size: 9px;
}

.framework-status {
  align-self: start;
  white-space: nowrap;
  padding: 8px 11px;
  border: 1px solid rgba(150,165,185,0.15);
  border-radius: 999px;
  background: rgba(9,21,34,0.64);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.framework-note {
  margin-top: 28px;
}

/* Five-item navigation safeguard */
@media (max-width: 820px) {
  .site-header-inner {
    gap: 12px;
  }

  .brand-logo {
    flex: 0 0 auto;
  }

  .main-nav {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    justify-content: space-between;
    gap: clamp(5px, 1.4vw, 10px);
    overflow: visible;
  }

  .nav-link {
    flex-shrink: 0;
    gap: 3px;
    font-size: clamp(8.3px, 1.9vw, 10px);
    letter-spacing: -0.02em;
  }

  .framework-section {
    width: calc(100% - 36px);
    padding: 64px 0 84px;
  }

  .framework-card {
    grid-template-columns: 76px minmax(0,1fr);
    gap: 24px;
    padding: 28px 26px;
  }

  .framework-card-index {
    padding-right: 20px;
  }

  .framework-status {
    grid-column: 2;
    justify-self: start;
    margin-top: -2px;
  }
}

@media (max-width: 620px) {
  .site-header-inner {
    width: calc(100% - 24px);
    gap: 8px;
  }

  .brand-logo {
    font-size: 23px;
  }

  .main-nav {
    gap: 4px;
  }

  .nav-link {
    gap: 2px;
    font-size: clamp(7.6px, 1.95vw, 9px);
  }

  .framework-section {
    width: calc(100% - 28px);
  }

  .framework-page-title {
    font-size: clamp(39px, 10.8vw, 55px);
  }

  .framework-card {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px 22px;
  }

  .framework-card-index {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .framework-icon {
    width: 40px;
    height: 40px;
  }

  .framework-status {
    grid-column: 1;
    margin-top: 0;
  }

  .framework-flow {
    gap: 6px;
  }

  .framework-flow span {
    padding: 7px 9px;
    font-size: 9.5px;
  }
}

@media (max-width: 390px) {
  .site-header-inner {
    width: calc(100% - 18px);
    gap: 6px;
  }

  .brand-logo {
    font-size: 21px;
  }

  .main-nav {
    gap: 3px;
  }

  .nav-link {
    font-size: 7.35px;
    gap: 1px;
  }

  .framework-section {
    width: calc(100% - 24px);
  }
}


/* =========================================================
   26. FRAMEWORK LIBRARY REFINEMENT
========================================================= */

.framework-library-heading {
  margin-bottom: 26px;
}

.framework-library-heading .subpage-kicker {
  margin-bottom: 0;
}

.framework-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.framework-read {
  color: var(--accent-bright);
  border-color: rgba(255,48,79,0.24);
}

.framework-read i {
  margin-left: 5px;
  font-size: 9px;
  transition: transform 260ms var(--ease-out);
}

.framework-card-link:hover .framework-read i {
  transform: translateX(4px);
}

/* =========================================================
   27. FRAMEWORK ARTICLE
========================================================= */

.article-hero {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
  padding: 72px 0 84px;
}

.article-hero-inner {
  position: relative;
  max-width: 1100px;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 42px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 200ms ease, transform 240ms var(--ease-out);
}

.article-back-link:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.article-meta-row .subpage-kicker {
  margin-bottom: 0;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(150,165,185,0.16);
  border-radius: 999px;
  background: rgba(9,21,34,0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.language-btn {
  min-width: 42px;
  padding: 8px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.language-btn:hover {
  color: var(--text-primary);
}

.language-btn.active {
  color: white;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255,48,79,0.20);
}

.article-title {
  max-width: 1000px;
  margin: 27px 0 20px;
  font-size: clamp(56px,6.7vw,104px);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.article-subtitle {
  max-width: 800px;
  margin-bottom: 32px;
  font-size: clamp(20px,2vw,28px);
  line-height: 1.35;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.article-lead {
  max-width: 820px;
}

.article-lead p {
  margin: 0 0 17px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-system-preview {
  max-width: 1050px;
  margin-top: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.article-system-preview span,
.article-flow span {
  padding: 8px 11px;
  border: 1px solid rgba(150,165,185,0.15);
  border-radius: 999px;
  background: rgba(9,21,34,0.72);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.article-system-preview i,
.article-flow i {
  color: rgba(255,48,79,0.60);
  font-size: 9px;
}

.article-shell {
  position: relative;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
  padding: 74px 0 112px;
  display: grid;
  grid-template-columns: 245px minmax(0,820px);
  justify-content: center;
  gap: 76px;
  border-top: 1px solid rgba(150,165,185,0.14);
}

.article-toc {
  position: sticky;
  top: 112px;
  align-self: start;
  padding-right: 24px;
  border-right: 1px solid rgba(150,165,185,0.12);
}

.article-toc-label {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-toc-nav a {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 9px;
  padding: 8px 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  transition: color 180ms ease, transform 200ms var(--ease-out);
}

.article-toc-nav a > span:first-child {
  font-family: var(--font-mono);
  color: rgba(255,48,79,0.68);
}

.article-toc-nav a:hover {
  color: var(--text-primary);
  transform: translateX(3px);
}

.article-content {
  min-width: 0;
}

.article-section {
  position: relative;
  scroll-margin-top: 110px;
  padding: 0 0 78px;
  margin-bottom: 78px;
  border-bottom: 1px solid rgba(150,165,185,0.13);
}

.article-section:last-child {
  margin-bottom: 0;
}

.article-section-number {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.article-section h2 {
  margin: 0 0 28px;
  font-size: clamp(31px,3.4vw,46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.article-section p {
  margin: 0 0 21px;
  font-size: 16px;
  line-height: 1.78;
  color: var(--text-secondary);
}

.article-bullets {
  margin: 7px 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.article-bullets.two-column {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px 22px;
}

.article-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.58;
  color: var(--text-secondary);
}

.article-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255,48,79,0.30);
}

.article-flow {
  margin: 25px 0 29px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.compact-flow {
  margin-bottom: 28px;
}

.related-placeholder {
  margin-top: 27px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px dashed rgba(150,165,185,0.18);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(9,21,34,0.46);
}

.related-placeholder i {
  color: var(--accent);
}

.platform-grid {
  margin: 24px 0 18px;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}

.platform-grid > div {
  min-height: 78px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9,21,34,0.58);
}

.platform-grid i {
  color: var(--accent);
  font-size: 18px;
}

.platform-grid span {
  font-size: 13px;
  font-weight: 600;
}

.article-sublist {
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.article-sublist span,
.article-chip-grid span {
  padding: 8px 10px;
  border: 1px solid rgba(150,165,185,0.14);
  border-radius: 999px;
  background: rgba(9,21,34,0.62);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.article-chip-grid {
  margin: 20px 0 29px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-grid {
  margin: 24px 0 30px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

.decision-card {
  padding: 20px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(14,28,44,0.80), rgba(8,20,33,0.64));
}

.decision-card:last-child {
  grid-column: 1 / -1;
}

.decision-card strong {
  display: block;
  margin-bottom: 9px;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.decision-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.62;
}

.question-grid {
  margin: 24px 0 31px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}

.question-grid > div {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(9,21,34,0.58);
}

.question-grid span {
  display: block;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

.question-grid strong {
  font-size: 14px;
  line-height: 1.45;
}

.article-summary {
  padding: 42px;
  border: 1px solid rgba(255,48,79,0.44);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,48,79,0.05), rgba(8,19,31,0.94) 40%);
}

.summary-steps {
  width: min(100%,560px);
  margin: 30px auto 34px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.summary-steps span {
  padding: 13px 16px;
  border: 1px solid rgba(150,165,185,0.15);
  border-radius: 10px;
  background: rgba(9,21,34,0.78);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  color: var(--text-primary);
}

.summary-steps i {
  align-self: center;
  color: var(--accent);
  font-size: 10px;
}

.article-closing {
  padding-top: 25px;
  margin-bottom: 0 !important;
  border-top: 1px solid rgba(150,165,185,0.12);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .article-hero,
  .article-shell {
    width: min(calc(100% - 56px), var(--container));
  }

  .article-shell {
    grid-template-columns: 210px minmax(0,760px);
    gap: 50px;
  }
}

@media (max-width: 900px) {
  .article-shell {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .article-toc {
    position: relative;
    top: auto;
    padding: 0 0 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(150,165,185,0.12);
  }

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

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

@media (max-width: 820px) {
  .article-hero,
  .article-shell {
    width: calc(100% - 36px);
  }

  .article-hero {
    padding: 58px 0 70px;
  }

  .article-title {
    font-size: clamp(48px,12vw,72px);
  }
}

@media (max-width: 620px) {
  .article-hero,
  .article-shell {
    width: calc(100% - 28px);
  }

  .article-back-link {
    margin-bottom: 32px;
  }

  .article-meta-row {
    align-items: flex-start;
  }

  .article-meta-row .subpage-kicker {
    max-width: 62%;
  }

  .article-title {
    font-size: clamp(42px,11vw,56px);
  }

  .article-subtitle {
    font-size: 19px;
  }

  .article-lead p,
  .article-section p {
    font-size: 15px;
  }

  .article-toc-nav {
    grid-template-columns: 1fr;
  }

  .article-bullets.two-column,
  .decision-grid,
  .question-grid {
    grid-template-columns: 1fr;
  }

  .decision-card:last-child {
    grid-column: auto;
  }

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

  .article-summary {
    padding: 28px 22px;
  }

  .article-system-preview,
  .article-flow {
    gap: 6px;
  }
}


/* =========================================================
   28. FRAMEWORK ARTICLE — LIGHT / DARK READING MODE
   First visit defaults to Light.
========================================================= */

.article-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(150,165,185,0.16);
  border-radius: 999px;
  background: rgba(9,21,34,0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.theme-btn {
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  cursor: pointer;
  transition:
    color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--ease-out);
}

.theme-btn:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.theme-btn.active {
  color: white;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255,48,79,0.20);
}

/* ---------- LIGHT MODE ---------- */

html[data-article-theme="light"] body[data-page="framework-article"] {
  --bg-primary: #f6f7f9;
  --bg-deep: #eef1f5;
  --bg-secondary: #ffffff;
  --text-primary: #17202c;
  --text-secondary: #4f5c6c;
  --text-muted: #7a8797;
  --border: rgba(23,32,44,0.11);
  --border-hover: rgba(255,48,79,0.38);
  color-scheme: light;
  background:
    linear-gradient(180deg, #fafbfc 0%, #f3f5f8 48%, #eef1f5 100%);
}

html[data-article-theme="light"] body[data-page="framework-article"] .site-header {
  background: rgba(250,251,252,0.82);
  border-bottom-color: rgba(23,32,44,0.09);
  box-shadow: 0 8px 28px rgba(35,45,58,0.035);
}

html[data-article-theme="light"] body[data-page="framework-article"] .grid-layer {
  background-image:
    linear-gradient(rgba(23,32,44,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,32,44,0.045) 1px, transparent 1px);
}

html[data-article-theme="light"] body[data-page="framework-article"] .cursor-grid-light {
  background-image:
    linear-gradient(rgba(255,48,79,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,48,79,0.14) 1px, transparent 1px);
}

html[data-article-theme="light"] body[data-page="framework-article"] .grain-layer {
  opacity: 0.018;
  mix-blend-mode: multiply;
}

html[data-article-theme="light"] body[data-page="framework-article"] .aurora-one {
  background:
    radial-gradient(
      circle,
      rgba(255,48,79,0.085),
      rgba(255,48,79,0.018) 46%,
      transparent 70%
    );
}

html[data-article-theme="light"] body[data-page="framework-article"] .aurora-two {
  background:
    radial-gradient(
      circle,
      rgba(255,48,79,0.055),
      transparent 68%
    );
}

html[data-article-theme="light"] body[data-page="framework-article"] .aurora-three {
  background:
    radial-gradient(
      circle,
      rgba(80,115,195,0.035),
      transparent 68%
    );
}

html[data-article-theme="light"] body[data-page="framework-article"] .brand-logo,
html[data-article-theme="light"] body[data-page="framework-article"] .nav-link.active,
html[data-article-theme="light"] body[data-page="framework-article"] .nav-link:hover {
  color: #17202c;
}

html[data-article-theme="light"] body[data-page="framework-article"] .hero-title-gradient {
  background:
    linear-gradient(
      96deg,
      #111923 10%,
      #253244 48%,
      #667589 96%
    );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-back-link:hover {
  color: var(--accent);
}

html[data-article-theme="light"] body[data-page="framework-article"] .language-switch,
html[data-article-theme="light"] body[data-page="framework-article"] .theme-switch {
  border-color: rgba(23,32,44,0.11);
  background: rgba(255,255,255,0.76);
  box-shadow:
    0 8px 22px rgba(35,45,58,0.045),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

html[data-article-theme="light"] body[data-page="framework-article"] .language-btn,
html[data-article-theme="light"] body[data-page="framework-article"] .theme-btn {
  color: #738091;
}

html[data-article-theme="light"] body[data-page="framework-article"] .language-btn:hover,
html[data-article-theme="light"] body[data-page="framework-article"] .theme-btn:hover {
  color: #17202c;
}

html[data-article-theme="light"] body[data-page="framework-article"] .language-btn.active,
html[data-article-theme="light"] body[data-page="framework-article"] .theme-btn.active {
  color: #ffffff;
  background: var(--accent);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-system-preview span,
html[data-article-theme="light"] body[data-page="framework-article"] .article-flow span,
html[data-article-theme="light"] body[data-page="framework-article"] .article-sublist span,
html[data-article-theme="light"] body[data-page="framework-article"] .article-chip-grid span {
  border-color: rgba(23,32,44,0.10);
  background: rgba(255,255,255,0.76);
  color: #566477;
  box-shadow: 0 6px 16px rgba(35,45,58,0.025);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-shell {
  border-top-color: rgba(23,32,44,0.09);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-toc {
  border-right-color: rgba(23,32,44,0.10);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-toc-nav a:hover {
  color: #17202c;
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-section {
  border-bottom-color: rgba(23,32,44,0.10);
}

html[data-article-theme="light"] body[data-page="framework-article"] .related-placeholder {
  border-color: rgba(23,32,44,0.13);
  background: rgba(255,255,255,0.60);
  color: #7b8794;
}

html[data-article-theme="light"] body[data-page="framework-article"] .platform-grid > div,
html[data-article-theme="light"] body[data-page="framework-article"] .question-grid > div {
  border-color: rgba(23,32,44,0.10);
  background: rgba(255,255,255,0.74);
  box-shadow: 0 10px 24px rgba(35,45,58,0.028);
}

html[data-article-theme="light"] body[data-page="framework-article"] .decision-card {
  border-color: rgba(23,32,44,0.10);
  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.90),
      rgba(246,248,250,0.84)
    );
  box-shadow: 0 10px 24px rgba(35,45,58,0.028);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-summary {
  border-color: rgba(255,48,79,0.28);
  background:
    linear-gradient(
      135deg,
      rgba(255,48,79,0.045),
      rgba(255,255,255,0.82) 38%,
      rgba(250,251,252,0.94)
    );
  box-shadow: 0 22px 54px rgba(35,45,58,0.045);
}

html[data-article-theme="light"] body[data-page="framework-article"] .summary-steps span {
  border-color: rgba(23,32,44,0.10);
  background: rgba(255,255,255,0.82);
  color: #263344;
  box-shadow: 0 8px 20px rgba(35,45,58,0.025);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-closing {
  border-top-color: rgba(23,32,44,0.10);
}

html[data-article-theme="light"] body[data-page="framework-article"] .site-footer {
  border-top-color: rgba(23,32,44,0.10);
}

/* ---------- DARK MODE ---------- */

html[data-article-theme="dark"] body[data-page="framework-article"] {
  color-scheme: dark;
}

/* Mobile controls */
@media (max-width: 720px) {
  .article-meta-row {
    align-items: flex-start;
  }

  .article-controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .theme-btn span {
    display: none;
  }

  .theme-btn {
    min-width: 34px;
    padding-inline: 9px;
  }
}

@media (max-width: 430px) {
  .article-meta-row {
    gap: 12px;
  }

  .article-meta-row .subpage-kicker {
    max-width: 54%;
  }

  .language-btn {
    min-width: 36px;
    padding-inline: 8px;
  }
}

/* =========================================================
   29. ARTICLE READING COMFORT PATCH
   Add background panels behind long article text blocks.
========================================================= */

body[data-page="framework-article"] .article-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

body[data-page="framework-article"] .article-section {
  padding: 34px 42px 46px;
  margin-bottom: 0;
  border: 1px solid rgba(150,165,185,0.16);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(11,22,35,0.90), rgba(8,18,29,0.82));
  box-shadow:
    0 18px 48px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body[data-page="framework-article"] .article-section:last-child {
  margin-bottom: 0;
}

body[data-page="framework-article"] .article-section h2 {
  max-width: 14ch;
}

body[data-page="framework-article"] .article-section p:last-child,
body[data-page="framework-article"] .article-bullets:last-child,
body[data-page="framework-article"] .article-sublist:last-child,
body[data-page="framework-article"] .article-chip-grid:last-child,
body[data-page="framework-article"] .platform-grid:last-child,
body[data-page="framework-article"] .question-grid:last-child,
body[data-page="framework-article"] .decision-grid:last-child,
body[data-page="framework-article"] .article-flow:last-child,
body[data-page="framework-article"] .related-placeholder:last-child {
  margin-bottom: 0;
}

body[data-page="framework-article"] .article-summary {
  border-color: rgba(255,48,79,0.26);
  background: linear-gradient(135deg, rgba(255,48,79,0.05), rgba(10,21,34,0.96) 38%);
  box-shadow: 0 22px 54px rgba(0,0,0,0.24);
}

body[data-page="framework-article"] .article-closing {
  margin-bottom: 0 !important;
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-content {
  gap: 34px;
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-section {
  border-color: rgba(255,48,79,0.16);
  background:
    linear-gradient(
      135deg,
      rgba(255,244,247,0.72),
      rgba(255,255,255,0.92) 26%,
      rgba(251,252,253,0.98)
    );
  box-shadow:
    0 22px 54px rgba(35,45,58,0.055),
    inset 0 1px 0 rgba(255,255,255,0.92);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-summary {
  border-color: rgba(255,48,79,0.22);
  background:
    linear-gradient(
      135deg,
      rgba(255,241,245,0.82),
      rgba(255,255,255,0.94) 28%,
      rgba(249,250,252,0.98)
    );
  box-shadow: 0 24px 58px rgba(35,45,58,0.06);
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-section p,
html[data-article-theme="light"] body[data-page="framework-article"] .article-bullets li {
  color: #506071;
}

html[data-article-theme="light"] body[data-page="framework-article"] .article-closing {
  border-top-color: rgba(23,32,44,0.10);
}

@media (max-width: 820px) {
  body[data-page="framework-article"] .article-content {
    gap: 24px;
  }

  body[data-page="framework-article"] .article-section {
    padding: 28px 24px 34px;
    border-radius: 24px;
  }
}

@media (max-width: 620px) {
  body[data-page="framework-article"] .article-section {
    padding: 24px 18px 30px;
    border-radius: 22px;
  }

  body[data-page="framework-article"] .article-section h2 {
    max-width: none;
  }
}

/* =========================================================
   30. PRODUCTS / SERVICES — TRANSACTION PREVIEW
========================================================= */

body[data-page="products"] .commerce-product-hero .subpage-hero-inner {
  overflow: visible;
}

.product-hero-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 760px);
  margin-bottom: 20px;
}

.product-page-kicker {
  margin-bottom: 0;
}

.product-language-switch {
  flex: 0 0 auto;
}

.product-catalog-section {
  padding-top: 62px;
}

.product-catalog-heading {
  margin-bottom: 28px;
}

.product-catalog-heading .subpage-kicker {
  margin-bottom: 0;
}

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

.commerce-product-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(14,28,44,0.94), rgba(8,20,33,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.018);
  transition:
    transform 320ms var(--ease-out),
    border-color 320ms ease,
    box-shadow 320ms ease,
    background 320ms ease;
}

.commerce-product-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  background:
    linear-gradient(145deg, rgba(255,48,79,0.055), rgba(8,20,33,0.94) 48%);
  box-shadow:
    0 22px 50px rgba(0,0,0,0.30),
    0 0 30px rgba(255,48,79,0.045);
}

.commerce-product-card:hover .card-sheen {
  left: 120%;
  opacity: 1;
}

.commerce-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.commerce-card-top .product-icon {
  margin-bottom: 0;
}

.commerce-product-card:hover .product-icon {
  transform: translateY(-2px) rotate(-2deg);
  border-color: rgba(255,48,79,0.60);
  background: rgba(255,48,79,0.09);
}

.commerce-category {
  margin-right: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(150,165,185,0.15);
  border-radius: 999px;
  background: rgba(9,21,34,0.64);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.commerce-product-card h2 {
  position: relative;
  z-index: 2;
  max-width: 15ch;
  margin: 0 0 15px;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.commerce-description {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 52ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.commerce-card-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 27px;
  border-top: 1px solid rgba(150,165,185,0.13);
}

.commerce-price {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text-primary);
}

.payment-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--text-muted);
}

.payment-progress-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255,48,79,0.50);
}

.commerce-checkout-btn {
  width: 100%;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(255,48,79,0.26);
  border-radius: 10px;
  background: rgba(255,48,79,0.055);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(244,246,250,0.54);
  cursor: not-allowed;
}

body[data-page="products"] .topic-number {
  z-index: 2;
}

@media (max-width: 900px) {
  .commerce-product-grid {
    grid-template-columns: 1fr;
  }

  .commerce-product-card {
    min-height: 390px;
  }
}

@media (max-width: 820px) {
  .product-hero-top {
    width: 100%;
  }

  .commerce-product-card {
    min-height: 380px;
  }
}

@media (max-width: 620px) {
  .product-hero-top {
    align-items: flex-start;
    gap: 16px;
  }

  .product-language-switch .language-btn {
    min-width: 36px;
    padding-inline: 8px;
  }

  .product-catalog-section {
    padding-top: 54px;
  }

  .commerce-product-grid {
    gap: 14px;
  }

  .commerce-product-card {
    min-height: 0;
    padding: 24px 20px;
  }

  .commerce-card-top {
    margin-bottom: 22px;
  }

  .commerce-category {
    margin-right: 28px;
    font-size: 8.8px;
  }

  .commerce-product-card h2 {
    max-width: none;
    font-size: 25px;
  }

  .commerce-description {
    font-size: 14px;
  }

  .commerce-card-footer {
    margin-top: 34px;
  }
}

@media (max-width: 390px) {
  .commerce-category {
    max-width: 150px;
    white-space: normal;
    text-align: right;
  }
}


/* =========================================================
   31. PRODUCTS / SERVICES — TYPOGRAPHY + LIGHT / DARK MODE
========================================================= */

.product-page-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.product-theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(150,165,185,0.16);
  border-radius: 999px;
  background: rgba(9,21,34,0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.product-theme-btn {
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  cursor: pointer;
  transition:
    color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--ease-out);
}

.product-theme-btn:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.product-theme-btn.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255,48,79,0.20);
}

/* Keep requested manual line breaks neat. */
body[data-page="products"] .commerce-description br,
body[data-page="products"] .commerce-product-card h2 br {
  display: block;
}

/* ---------- PRODUCTS LIGHT MODE ---------- */
html[data-products-theme="light"] body[data-page="products"] {
  --bg-primary: #f6f7f9;
  --bg-deep: #eef1f5;
  --bg-secondary: #ffffff;
  --text-primary: #17202c;
  --text-secondary: #4f5c6c;
  --text-muted: #7a8797;
  --border: rgba(23,32,44,0.11);
  --border-hover: rgba(255,48,79,0.38);
  color-scheme: light;
  background: linear-gradient(180deg, #fafbfc 0%, #f3f5f8 50%, #eef1f5 100%);
}

html[data-products-theme="light"] body[data-page="products"] .site-header {
  background: rgba(250,251,252,0.84);
  border-bottom-color: rgba(23,32,44,0.09);
  box-shadow: 0 8px 28px rgba(35,45,58,0.035);
}

html[data-products-theme="light"] body[data-page="products"] .grid-layer {
  background-image:
    linear-gradient(rgba(23,32,44,0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,32,44,0.038) 1px, transparent 1px);
}

html[data-products-theme="light"] body[data-page="products"] .cursor-grid-light {
  background-image:
    linear-gradient(rgba(255,48,79,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,48,79,0.12) 1px, transparent 1px);
}

html[data-products-theme="light"] body[data-page="products"] .grain-layer {
  opacity: 0.016;
  mix-blend-mode: multiply;
}

html[data-products-theme="light"] body[data-page="products"] .aurora-one {
  background: radial-gradient(circle, rgba(255,48,79,0.08), rgba(255,48,79,0.018) 46%, transparent 70%);
}

html[data-products-theme="light"] body[data-page="products"] .aurora-two {
  background: radial-gradient(circle, rgba(255,48,79,0.05), transparent 68%);
}

html[data-products-theme="light"] body[data-page="products"] .aurora-three {
  background: radial-gradient(circle, rgba(80,115,195,0.03), transparent 68%);
}

html[data-products-theme="light"] body[data-page="products"] .brand-logo,
html[data-products-theme="light"] body[data-page="products"] .nav-link.active,
html[data-products-theme="light"] body[data-page="products"] .nav-link:hover {
  color: #17202c;
}

html[data-products-theme="light"] body[data-page="products"] .hero-title-gradient {
  background: linear-gradient(96deg, #111923 10%, #253244 48%, #667589 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-products-theme="light"] body[data-page="products"] .language-switch,
html[data-products-theme="light"] body[data-page="products"] .product-theme-switch {
  border-color: rgba(23,32,44,0.11);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 8px 22px rgba(35,45,58,0.045), inset 0 1px 0 rgba(255,255,255,0.92);
}

html[data-products-theme="light"] body[data-page="products"] .language-btn,
html[data-products-theme="light"] body[data-page="products"] .product-theme-btn {
  color: #738091;
}

html[data-products-theme="light"] body[data-page="products"] .language-btn:hover,
html[data-products-theme="light"] body[data-page="products"] .product-theme-btn:hover {
  color: #17202c;
}

html[data-products-theme="light"] body[data-page="products"] .language-btn.active,
html[data-products-theme="light"] body[data-page="products"] .product-theme-btn.active {
  color: #fff;
  background: var(--accent);
}

html[data-products-theme="light"] body[data-page="products"] .commerce-product-card {
  border-color: rgba(23,32,44,0.10);
  background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(247,249,251,0.90));
  box-shadow:
    0 18px 44px rgba(35,45,58,0.045),
    inset 0 1px 0 rgba(255,255,255,0.96);
}

html[data-products-theme="light"] body[data-page="products"] .commerce-product-card:hover {
  border-color: rgba(255,48,79,0.28);
  background: linear-gradient(145deg, rgba(255,247,249,0.94), rgba(255,255,255,0.96) 52%);
  box-shadow:
    0 24px 52px rgba(35,45,58,0.075),
    0 0 26px rgba(255,48,79,0.035);
}

html[data-products-theme="light"] body[data-page="products"] .commerce-category {
  border-color: rgba(23,32,44,0.10);
  background: rgba(255,255,255,0.72);
  color: #738091;
}

html[data-products-theme="light"] body[data-page="products"] .commerce-card-footer {
  border-top-color: rgba(23,32,44,0.10);
}

html[data-products-theme="light"] body[data-page="products"] .commerce-checkout-btn {
  border-color: rgba(255,48,79,0.20);
  background: rgba(255,48,79,0.045);
  color: rgba(23,32,44,0.48);
}

html[data-products-theme="light"] body[data-page="products"] .site-footer {
  border-top-color: rgba(23,32,44,0.10);
}

/* ---------- PRODUCTS DARK MODE ---------- */
html[data-products-theme="dark"] body[data-page="products"] {
  color-scheme: dark;
}

@media (max-width: 760px) {
  .product-page-controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .product-theme-btn span {
    display: none;
  }

  .product-theme-btn {
    min-width: 34px;
    padding-inline: 9px;
  }
}

@media (max-width: 620px) {
  .product-hero-top {
    gap: 10px;
  }

  .product-page-kicker {
    max-width: 48%;
  }

  body[data-page="products"] .commerce-description br {
    display: none;
  }
}

/* =========================================================
   32. FRAMEWORK ARTICLE — COMPACT FIRST VIEW
   Keep the article introduction visible without making the
   opening screen feel like an empty standalone hero.
========================================================= */

@media (min-width: 901px) {
  body[data-page="framework-article"] .article-hero {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  body[data-page="framework-article"] .article-back-link {
    margin-bottom: 26px;
  }

  body[data-page="framework-article"] .article-title {
    margin-top: 20px;
    margin-bottom: 14px;
    font-size: clamp(48px, 5.15vw, 78px);
    line-height: 0.95;
  }

  body[data-page="framework-article"] .article-subtitle {
    margin-bottom: 20px;
    font-size: clamp(18px, 1.55vw, 24px);
  }

  body[data-page="framework-article"] .article-lead {
    max-width: 790px;
  }

  body[data-page="framework-article"] .article-lead p {
    margin-bottom: 11px;
    font-size: 15px;
    line-height: 1.62;
  }

  body[data-page="framework-article"] .article-system-preview {
    margin-top: 22px;
  }

  body[data-page="framework-article"] .article-system-preview span {
    padding: 7px 10px;
    font-size: 9.5px;
  }

  body[data-page="framework-article"] .article-shell {
    padding-top: 42px;
  }
}

@media (min-width: 1200px) and (min-height: 820px) {
  body[data-page="framework-article"] .article-hero {
    padding-top: 38px;
    padding-bottom: 34px;
  }

  body[data-page="framework-article"] .article-title {
    font-size: clamp(50px, 4.7vw, 74px);
  }

  body[data-page="framework-article"] .article-shell {
    padding-top: 34px;
  }
}

/* =========================================================
   33. FRAMEWORK ARTICLE — SHOW CONTENT IMMEDIATELY
   The article shell must be visible on first load, without
   waiting for the scroll-reveal IntersectionObserver.
========================================================= */

body[data-page="framework-article"] .article-shell.section-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
