/* ── TOKENS ─────────────────────────────────────────── */
    :root {
      --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
      --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
      --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
      --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
      --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
      --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
      --text-hero: clamp(2.8rem,   1rem    + 5vw,    6rem);

      --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
      --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
      --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
      --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;

      --radius-sm: 0.375rem; --radius-md: 0.5rem;
      --radius-lg: 0.75rem;  --radius-xl: 1rem; --radius-full: 9999px;
      --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

      --font-body: 'Inter', system-ui, sans-serif;
      --font-mono: 'Geist Mono', 'Fira Code', monospace;
    }

    /* ── DARK MODE ──────────────────────────────────────── */
    :root, [data-theme="dark"] {
      --bg:           #11161a;
      --surface:      #171d22;
      --surface-2:    #1e252b;
      --surface-3:    #283139;
      --border:       rgba(226,232,240,0.09);
      --border-hover: rgba(226,232,240,0.18);
      --text:         #f0f4f6;
      --text-muted:   #a8b3bd;
      --text-faint:   #65717a;
      --accent:       #74a6b8;
      --accent-hover: #9bc2d0;
      --accent-glow:  rgba(116,166,184,0.18);
      --accent-subtle:rgba(116,166,184,0.10);
      --green:        #7fb69a;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
      --shadow-md: 0 8px 24px rgba(0,0,0,0.34);
      --shadow-lg: 0 18px 52px rgba(0,0,0,0.42);
      --card-shadow: none;
      --card-shadow-hover: var(--shadow-md);
      --navbar-shadow: none;
    }

    /* ── LIGHT MODE ─────────────────────────────────────── */
    [data-theme="light"] {
      --bg:           #eeece4;
      --surface:      #f7f4ec;
      --surface-2:    #e7e3d8;
      --surface-3:    #d9d3c6;
      --border:       rgba(43,57,68,0.12);
      --border-hover: rgba(43,57,68,0.26);
      --text:         #1c252b;
      --text-muted:   #5d6870;
      --text-faint:   #8d928d;
      --accent:       #315c72;
      --accent-hover: #24495d;
      --accent-glow:  rgba(49,92,114,0.15);
      --accent-subtle:rgba(49,92,114,0.08);
      --green:        #4f8064;
      --shadow-sm: 0 1px 2px rgba(43,57,68,0.06), 0 2px 8px rgba(43,57,68,0.04);
      --shadow-md: 0 8px 28px rgba(43,57,68,0.10), 0 2px 8px rgba(43,57,68,0.05);
      --shadow-lg: 0 20px 56px rgba(43,57,68,0.14), 0 6px 18px rgba(43,57,68,0.07);
      --card-shadow: 0 1px 2px rgba(43,57,68,0.06), 0 10px 30px rgba(43,57,68,0.06);
      --card-shadow-hover: 0 14px 42px rgba(43,57,68,0.13), 0 4px 12px rgba(43,57,68,0.06);
      --navbar-shadow: 0 1px 0 rgba(43,57,68,0.08), 0 8px 24px rgba(43,57,68,0.05);
    }

    /* ── BASE ───────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-font-smoothing: antialiased; }
    body {
      font-family: var(--font-body);
      font-size: var(--text-base);
      color: var(--text);
      background:
        radial-gradient(circle at 12% 8%, var(--accent-glow), transparent 28%),
        linear-gradient(180deg, var(--bg) 0%, color-mix(in oklch, var(--bg) 88%, var(--surface-2)) 100%);
      line-height: 1.6;
      min-height: 100dvh;
      transition: background var(--transition), color var(--transition);
    }
    img { display: block; max-width: 100%; }
    a { color: inherit; text-decoration: none; }
    button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
    ul { list-style: none; }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .brand-icon {
      width: 1em;
      height: 1em;
      display: inline-block;
      fill: currentColor;
      flex: 0 0 auto;
    }

    ::selection { background: var(--accent-glow); color: var(--text); }
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }

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

    /* ── SKIP LINK ──────────────────────────────────────── */
    .skip-link {
      position: absolute; top: -100%; left: var(--space-4);
      background: var(--accent); color: #fff; padding: var(--space-2) var(--space-4);
      border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: 500; z-index: 9999;
    }
    .skip-link:focus { top: var(--space-4); }

    /* ── NAVBAR ─────────────────────────────────────────── */
    .navbar {
      position: fixed; top: 0; left: 0; right: 0; z-index: 100;
      height: 60px;
      background: color-mix(in oklch, var(--bg) 86%, transparent);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      box-shadow: var(--navbar-shadow);
      transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    }
    .nav-inner {
      max-width: 1100px; margin: 0 auto;
      padding: 0 var(--space-6);
      height: 100%;
      display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
    }
    .nav-logo {
      font-family: var(--font-mono);
      font-size: var(--text-sm);
      font-weight: 500;
      color: var(--text);
      letter-spacing: -0.02em;
      display: flex; align-items: center; gap: var(--space-2);
    }
    .nav-logo .dot { color: var(--accent); }
    .nav-links {
      display: flex; align-items: center; gap: var(--space-1);
    }
    .nav-links a {
      font-size: var(--text-sm); color: var(--text-muted); padding: var(--space-2) var(--space-3);
      border-radius: var(--radius-md);
      transition: color var(--transition), background var(--transition);
    }
    .nav-links a:hover { color: var(--text); background: var(--surface-2); }
    .nav-actions { display: flex; align-items: center; gap: var(--space-2); }
    .nav-social.github { margin-left: var(--space-2); }
    .icon-btn {
      width: 36px; height: 36px; border-radius: var(--radius-md);
      display: flex; align-items: center; justify-content: center;
      color: var(--text-muted); border: 1px solid var(--border);
      transition: color var(--transition), background var(--transition), border-color var(--transition);
    }
    .icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-hover); }
    .nav-social.github:hover { color: var(--text); }
    .nav-social.linkedin:hover { color: #0a66c2; }
    .lang-btn {
      font-size: var(--text-xs); font-weight: 600; font-family: var(--font-mono);
      padding: 0 var(--space-3); height: 36px;
      border-radius: var(--radius-md); border: 1px solid var(--border);
      color: var(--text-muted); letter-spacing: 0.05em;
      transition: color var(--transition), background var(--transition), border-color var(--transition);
    }
    .lang-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-hover); }

    .hamburger { display: none; flex-direction: column; gap: 5px; padding: var(--space-2); }
    .hamburger span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }

    .mobile-menu {
      display: none; position: fixed; top: 60px; left: 0; right: 0;
      background: var(--surface); border-bottom: 1px solid var(--border);
      box-shadow: var(--shadow-md);
      padding: var(--space-4) var(--space-6); flex-direction: column; gap: var(--space-2);
      z-index: 99;
    }
    .mobile-menu.open { display: flex; }
    .mobile-menu a {
      font-size: var(--text-base); color: var(--text-muted); padding: var(--space-3);
      border-radius: var(--radius-md); transition: color var(--transition), background var(--transition);
    }
    .mobile-menu a:hover { color: var(--text); background: var(--surface-2); }
    .mobile-menu .mobile-actions { display: flex; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }

    @media (max-width: 768px) {
      .nav-links { display: none; }
      .hamburger { display: flex; }
      .nav-inner { padding: 0 var(--space-4); gap: var(--space-3); }
      .mobile-menu { padding: var(--space-4); }
    }
    @media (max-width: 560px) {
      .nav-social { display: none; }
    }

    /* ── LAYOUT HELPERS ─────────────────────────────────── */
    .container { max-width: 1100px; margin: 0 auto; padding: 0 var(--space-6); }
    .section { padding: clamp(var(--space-16), 8vw, var(--space-24)) 0; }

    /* ── SCROLL REVEAL ──────────────────────────────────── */
    .reveal {
      opacity: 1;
    }
    @supports (animation-timeline: scroll()) {
      .reveal {
        opacity: 0;
        animation: reveal-fade linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
      }
    }
    @keyframes reveal-fade { to { opacity: 1; } }

    /* ── HERO ───────────────────────────────────────────── */
    .hero {
      min-height: 82dvh;
      display: flex; align-items: center;
      padding: calc(60px + var(--space-16)) 0 var(--space-16);
      position: relative; overflow: hidden;
    }
    .hero-grid {
      position: absolute; inset: 0; pointer-events: none;
      background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
      background-size: 72px 72px;
      mask-image: radial-gradient(ellipse 78% 54% at 50% 36%, black 0%, transparent 72%);
      opacity: 0.52;
    }
    .hero-glow {
      position: absolute; top: 12%; right: 8%;
      width: 520px; height: 340px; pointer-events: none;
      background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 68%);
    }
    .hero .container { position: relative; z-index: 1; }
    .hero-layout {
      display: grid;
      grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.15fr);
      gap: clamp(var(--space-8), 6vw, var(--space-20));
      align-items: center;
    }
    .hero-content { max-width: 720px; }
    .hero-kicker {
      font-size: var(--text-sm);
      color: var(--text-muted);
      margin-bottom: var(--space-3);
    }
    .hero-kicker strong { color: var(--text); font-weight: 600; }
    .hero-badge {
      display: inline-flex; align-items: center; gap: var(--space-2);
      font-size: var(--text-xs); font-family: var(--font-mono);
      color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
      background: color-mix(in oklch, var(--surface) 82%, var(--accent-subtle));
      padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
      margin-bottom: var(--space-6);
      letter-spacing: 0.03em;
    }
    .hero-badge .pulse {
      width: 6px; height: 6px; border-radius: 50%; background: var(--green);
      animation: pulse 2s ease-in-out infinite;
    }
    @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

    .hero h1 {
      font-size: clamp(2.2rem, 1.2rem + 3vw, 4.4rem);
      font-weight: 600;
      line-height: 1.05;
      letter-spacing: -0.03em;
      margin-bottom: var(--space-6);
      color: var(--text);
    }
    .hero h1 .name { color: var(--text); }
    .hero h1 .accent-word { color: var(--accent); }
    .hero-sub {
      font-size: var(--text-lg);
      color: var(--text-muted);
      max-width: 54ch;
      margin-bottom: var(--space-10);
      line-height: 1.6;
      font-weight: 400;
    }
    .hero-ctas {
      display: flex; flex-wrap: wrap; gap: var(--space-3);
    }
    .btn-primary {
      display: inline-flex; align-items: center; gap: var(--space-2);
      background: var(--accent); color: #fff;
      font-size: var(--text-sm); font-weight: 500;
      padding: var(--space-3) var(--space-6);
      border-radius: var(--radius-md); border: 1px solid color-mix(in oklch, var(--accent) 80%, black);
      transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    }
    .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }
    .btn-primary:active { transform: translateY(0); }
    .btn-ghost {
      display: inline-flex; align-items: center; gap: var(--space-2);
      background: transparent; color: var(--text-muted);
      font-size: var(--text-sm); font-weight: 500;
      padding: var(--space-3) var(--space-6);
      border-radius: var(--radius-md); border: 1px solid var(--border);
      transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    }
    .btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-hover); transform: translateY(-1px); }
    .btn-ghost:active { transform: translateY(0); }

    .hero-stack {
      display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-12);
      align-items: center;
    }
    .hero-stack-label { font-size: var(--text-xs); color: var(--text-faint); font-family: var(--font-mono); margin-right: var(--space-2); }
    .stack-chip {
      font-size: var(--text-xs); font-family: var(--font-mono);
      color: var(--text-muted); background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--radius-sm);
      padding: 2px var(--space-2);
      transition: color var(--transition), border-color var(--transition);
    }
    .stack-chip:hover { color: var(--text); border-color: var(--border-hover); }

    .hero-panel {
      background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 70%, var(--surface-2)));
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: var(--space-8);
      box-shadow: var(--card-shadow);
      position: relative;
      overflow: hidden;
    }
    .hero-panel::before {
      content: '';
      position: absolute;
      inset: 0 0 auto;
      height: 4px;
      background: linear-gradient(90deg, var(--accent), color-mix(in oklch, var(--accent) 35%, transparent));
    }
    .panel-label {
      font-size: var(--text-xs);
      color: var(--accent);
      font-family: var(--font-mono);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: var(--space-4);
    }
    .panel-name {
      font-size: var(--text-xl);
      color: var(--text);
      font-weight: 600;
      letter-spacing: -0.02em;
      margin-bottom: var(--space-2);
    }
    .panel-role {
      color: var(--text-muted);
      font-size: var(--text-sm);
      margin-bottom: var(--space-6);
    }
    .panel-list {
      display: grid;
      gap: var(--space-3);
      padding-top: var(--space-5);
      border-top: 1px solid var(--border);
    }
    .panel-list li {
      display: flex;
      gap: var(--space-3);
      color: var(--text-muted);
      font-size: var(--text-sm);
      line-height: 1.5;
    }
    .panel-list li::before {
      content: '';
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: var(--accent);
      flex: 0 0 auto;
      margin-top: 0.55em;
    }

    .profile-strip {
      margin-top: var(--space-8);
      margin-bottom: var(--space-16);
      position: relative;
      z-index: 2;
    }
    .profile-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: var(--space-4);
    }
    .profile-card {
      background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 76%, var(--surface-2)));
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: var(--space-6);
      box-shadow: var(--card-shadow);
      position: relative;
      overflow: hidden;
      transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
    }
    .profile-card::before {
      content: '';
      position: absolute;
      inset: 0 0 auto;
      height: 3px;
      background: linear-gradient(90deg, var(--accent), transparent 72%);
      opacity: 0.55;
    }
    .profile-card::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 18% 0%, var(--accent-glow), transparent 36%);
      opacity: 0;
      transition: opacity var(--transition);
      pointer-events: none;
    }
    .profile-card:hover {
      transform: translateY(-4px);
      border-color: var(--border-hover);
      box-shadow: var(--card-shadow-hover);
      background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 62%, var(--surface-2)));
    }
    .profile-card:hover::after {
      opacity: 1;
    }
    @media (prefers-reduced-motion: no-preference) {
      .profile-card {
        animation: card-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
      }
      .profile-card:nth-child(2) { animation-delay: 90ms; }
      .profile-card:nth-child(3) { animation-delay: 180ms; }
    }
    @keyframes card-rise {
      from { opacity: 0; transform: translateY(14px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .profile-card:nth-child(2) {
      transition-delay: 35ms;
    }
    .profile-card:nth-child(3) {
      transition-delay: 70ms;
    }
    .profile-card span {
      display: block;
      color: var(--accent);
      font-family: var(--font-mono);
      font-size: var(--text-xs);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: var(--space-3);
    }
    .profile-card h2 {
      font-size: var(--text-base);
      color: var(--text);
      margin-bottom: var(--space-2);
    }
    .profile-card p {
      color: var(--text-muted);
      font-size: var(--text-sm);
      line-height: 1.65;
    }

    @media (max-width: 860px) {
      .hero { min-height: auto; padding: calc(60px + var(--space-12)) 0 var(--space-12); }
      .hero-layout { grid-template-columns: 1fr; }
      .hero-panel { max-width: none; order: 2; }
      .profile-strip { margin-top: var(--space-6); }
      .profile-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 520px) {
      .container { padding: 0 var(--space-4); }
      .section { padding: var(--space-16) 0; }
      .hero { padding: calc(60px + var(--space-10)) 0 var(--space-12); }
      .hero-grid { background-size: 52px 52px; opacity: 0.36; }
      .hero-glow { top: 4%; right: -35%; width: 360px; height: 260px; }
      .hero-badge { margin-bottom: var(--space-4); max-width: 100%; }
      .hero h1 { font-size: clamp(2.25rem, 12vw, 3.4rem); line-height: 1.02; margin-bottom: var(--space-5); }
      .hero-sub { font-size: var(--text-base); margin-bottom: var(--space-8); }
      .hero-panel, .profile-card { padding: var(--space-5); }
      .panel-name { font-size: var(--text-lg); }
      .hero-ctas { flex-direction: column; }
      .hero-ctas .btn-primary,
      .hero-ctas .btn-ghost { justify-content: center; width: 100%; }
      .hero-stack { gap: var(--space-2); margin-top: var(--space-8); }
      .hero-stack-label { width: 100%; margin-right: 0; }
      .stack-chip { flex: 0 0 auto; text-align: center; }
      .profile-strip { margin-top: var(--space-8); }
      .profile-strip { margin-bottom: var(--space-12); }
      .profile-grid { gap: var(--space-3); }
      .profile-card { border-radius: var(--radius-lg); }
      .profile-card:hover { transform: translateY(-2px); }
      .profile-card p { line-height: 1.6; }
    }

    /* ── PROJECTS ───────────────────────────────────────── */
.section-label {
  font-size: var(--text-xs); font-family: var(--font-mono);
  color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: var(--space-3);
  line-height: 1.2;
}
.section-desc {
  font-size: var(--text-base); color: var(--text-muted);
  max-width: 52ch; margin-bottom: var(--space-12);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 860px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: 1fr;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative; overflow: hidden;
}

.project-card:hover { 
  border-color: var(--border-hover); 
  box-shadow: var(--card-shadow-hover); 
  transform: translateY(-4px); 
}

.project-card.featured { 
  background: linear-gradient(135deg, var(--surface), var(--surface-2)); 
}

.project-image {
  width: 100%;
  height: auto;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: block;
}

.project-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  justify-content: flex-start;
  flex: 1; /* Permite que el contenido empuje el card si es necesario */
}
.project-card {
  display: flex;
  flex-direction: column;
}


.project-live-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-family: var(--font-mono);
  color: var(--green); background: color-mix(in oklch, var(--green) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--green) 26%, transparent);
  padding: 2px var(--space-2); border-radius: var(--radius-full);
}
.project-live-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.project-header-left { display: flex; flex-direction: column; gap: var(--space-2); }
.project-title {
  font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; color: var(--text);
}

.project-problem-solution {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: color-mix(in oklch, var(--surface) 50%, var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-2);
}
.ps-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ps-label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ps-block p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.project-desc { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.7; margin-top: var(--space-2); }

.project-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.tag {
  font-size: var(--text-xs); font-family: var(--font-mono);
  color: var(--text-muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
}
.project-links-row { display: flex; gap: var(--space-2); padding-top: var(--space-2); }
.proj-btn {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.proj-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-hover); }
.proj-btn.accent { background: var(--accent-subtle); border-color: color-mix(in oklch, var(--accent) 30%, transparent); color: var(--accent); }
.proj-btn.accent:hover { background: var(--accent); color: #fff; border-color: var(--accent); }



@media (max-width: 520px) {
  .project-content { padding: var(--space-5); }
  .project-links-row { flex-wrap: wrap; }
  .proj-btn { flex: 1 1 140px; justify-content: center; }
}

/* ── SERVICES ───────────────────────────────────────── */
    .services-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4);
    }
    .service-card {
      background: transparent;
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: var(--space-8);
      display: flex; flex-direction: column; gap: var(--space-4);
      box-shadow: var(--card-shadow);
      transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    }
    .service-card:hover { border-color: var(--border-hover); box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
    .service-icon {
      width: 40px; height: 40px; border-radius: var(--radius-md);
      background: var(--accent-subtle); border: 1px solid color-mix(in oklch, var(--accent) 25%, transparent);
      display: flex; align-items: center; justify-content: center; color: var(--accent);
    }
    .service-title { font-size: var(--text-base); font-weight: 600; color: var(--text); }
    .service-desc { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6; }
    .service-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: auto; }
    .service-list li {
      font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono);
      display: flex; align-items: center; gap: var(--space-2);
    }
    .service-list li::before { content: '—'; color: var(--accent); flex-shrink: 0; }

    @media (max-width: 900px) { .services-grid { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 640px) {
      .services-grid { grid-template-columns: 1fr; }
      .service-card { padding: var(--space-6); }
    }

    /* ── ABOUT ──────────────────────────────────────────── */
    .about-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); align-items: center;
    }
    .about-text { display: flex; flex-direction: column; gap: var(--space-6); }
    .about-p { font-size: var(--text-base); color: var(--text-muted); line-height: 1.75; }
    .about-p strong { color: var(--text); font-weight: 500; }
    .about-stats {
      display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4);
      margin-top: var(--space-4);
    }
    .stat-box {
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
      padding: var(--space-5);
      box-shadow: var(--card-shadow);
      transition: box-shadow var(--transition), border-color var(--transition);
    }
    .stat-box:hover { border-color: var(--border-hover); box-shadow: var(--card-shadow-hover); }
    .stat-num { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.03em; color: var(--text); font-family: var(--font-mono); }
    .stat-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
    .about-right {
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
      padding: var(--space-8); font-family: var(--font-mono); font-size: var(--text-xs);
      box-shadow: var(--card-shadow);
      overflow-x: auto;
    }
    .code-header {
      display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6);
    }
    .code-dot { width: 10px; height: 10px; border-radius: 50%; }
    .code-dot.r { background: #8aa2ad; } .code-dot.y { background: #c4aa75; } .code-dot.g { background: #7fa08b; }
    .code-filename { color: var(--text-faint); margin-left: auto; font-size: var(--text-xs); }
    .code-line { line-height: 1.9; }
    .kw { color: #6f5f8f; } .fn { color: var(--accent); } .str { color: #4f8064; }
    .cm { color: var(--text-faint); } .op { color: var(--text-muted); } .num { color: #9a6b3f; }
    .indent { padding-left: var(--space-6); }
    .indent2 { padding-left: var(--space-12); }

    @media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }
    @media (max-width: 520px) {
      .about-stats { grid-template-columns: 1fr; }
      .about-right, .stat-box { padding: var(--space-5); }
      .code-line { white-space: nowrap; }
    }

    /* ── CONTACT ────────────────────────────────────────── */
    .contact-wrapper {
      max-width: 980px; margin: 0 auto; text-align: center;
    }
    .contact-methods {
      display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center; margin-top: var(--space-10);
    }
    .contact-card {
      display: flex; align-items: center; gap: var(--space-3);
      background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 72%, var(--surface-2)));
      border: 1px solid var(--border); border-radius: var(--radius-lg);
      padding: var(--space-4) var(--space-6);
      box-shadow: var(--card-shadow);
      transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    }
    .contact-card:hover { border-color: var(--border-hover); box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
    .contact-card i { color: var(--accent); }
    .contact-card-text { text-align: left; }
    .contact-card-label { font-size: var(--text-xs); color: var(--text-faint); font-family: var(--font-mono); }
    .contact-card-value { font-size: var(--text-sm); color: var(--text); font-weight: 500; }

    .contact-layout {
      max-width: 720px;
      margin-inline: auto;
      margin-top: var(--space-10);
      text-align: left;
    }
    .contact-form {
      background: linear-gradient(180deg, var(--surface), color-mix(in oklch, var(--surface) 72%, var(--surface-2)));
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      padding: var(--space-8);
      box-shadow: var(--card-shadow);
      display: grid;
      gap: var(--space-4);
    }
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: var(--space-4);
    }
    .form-field {
      display: grid;
      gap: var(--space-2);
    }
    .form-field label {
      font-size: var(--text-xs);
      color: var(--text-muted);
      font-family: var(--font-mono);
    }
    .form-field input,
    .form-field textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: color-mix(in oklch, var(--surface) 58%, var(--surface-2));
      color: var(--text);
      font: inherit;
      font-size: var(--text-sm);
      padding: var(--space-3);
      transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    }
    .form-field textarea {
      min-height: 140px;
      resize: vertical;
    }
    .form-field input:hover,
    .form-field textarea:hover { border-color: var(--border-hover); }
    .form-field input:focus,
    .form-field textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-subtle);
    }
    .form-help {
      font-size: var(--text-xs);
      color: var(--text-faint);
      font-family: var(--font-mono);
    }
    .form-status {
      min-height: 1.5em;
      font-size: var(--text-xs);
      color: var(--text-muted);
      font-family: var(--font-mono);
    }
    .form-socials {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-4);
      padding-top: var(--space-5);
      border-top: 1px solid var(--border);
    }
    .form-socials-label {
      color: var(--text-faint);
      font-family: var(--font-mono);
      font-size: var(--text-xs);
      line-height: 1.5;
    }
    .form-socials-links {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      flex: 0 0 auto;
    }
    .form-social-btn {
      width: 48px;
      height: 48px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border);
      background: color-mix(in oklch, var(--surface) 78%, var(--surface-2));
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--card-shadow);
      transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    }
    .form-social-btn:hover {
      border-color: var(--border-hover);
      background: var(--surface-2);
      box-shadow: var(--card-shadow-hover);
      transform: translateY(-1px);
    }
    .form-social-btn.github:hover { color: var(--text); }
    .form-social-btn.linkedin:hover { color: #0a66c2; }
    @media (max-width: 768px) {
      .form-row { grid-template-columns: 1fr; }
    }

    @media (max-width: 520px) {
      .contact-form { padding: var(--space-5); }
      .contact-card { padding: var(--space-5); }
      .contact-card { align-items: flex-start; }
      .contact-card-value { overflow-wrap: anywhere; }
      .contact-form .btn-primary { justify-content: center; width: 100%; }
      .form-socials { align-items: flex-start; flex-direction: column; gap: var(--space-3); }
      .form-socials-links { width: 100%; justify-content: flex-start; }
      .form-social-btn { width: 44px; height: 44px; }
      .form-field textarea { min-height: 120px; }
    }

    /* ── FOOTER ─────────────────────────────────────────── */
    .footer {
      border-top: 1px solid var(--border); padding: var(--space-8) 0;
      margin-top: var(--space-8);
    }
    .footer-inner {
      max-width: 1100px; margin: 0 auto; padding: 0 var(--space-6);
      display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4);
    }
    .footer-copy { font-size: var(--text-xs); color: var(--text-faint); font-family: var(--font-mono); }
    .footer-links { display: flex; gap: var(--space-2); }
    .footer-links a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: 1px solid var(--border);
      border-radius: var(--radius-full);
      background: var(--surface);
      font-size: var(--text-xs);
      color: var(--text-muted);
      box-shadow: var(--card-shadow);
      transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
    }
    .footer-links a:hover { color: var(--accent); background: var(--surface-2); border-color: var(--border-hover); transform: translateY(-1px); }
    .footer-links .brand-icon { font-size: 1rem; }

    @media (max-width: 640px) {
      .section-title { font-size: clamp(1.6rem, 8vw, 2.15rem); }
      .section-desc { margin-bottom: var(--space-8); }
      .profile-card,
      .project-card,
      .service-card,
      .stat-box,
      .about-right,
      .contact-form {
        box-shadow: 0 1px 2px rgba(0,0,0,0.16);
      }
      .project-card:hover,
      .service-card:hover,
      .stat-box:hover,
      .contact-card:hover {
        transform: none;
      }
    }

    @media (max-width: 520px) {
      .footer { padding: var(--space-6) 0; }
      .footer-inner { justify-content: center; text-align: center; }
      .footer-links { justify-content: center; width: 100%; }
    }

    /* ── DIVIDER ────────────────────────────────────────── */
    .divider { border: none; border-top: 1px solid var(--border); margin: 0; }

    /* ── ANIMATED TYPING ────────────────────────────────── */
    .typing-cursor::after { content: '|'; color: var(--accent); animation: blink 1s step-end infinite; }
    @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
