/* ==========================================================================
   Rajan Kumar — Minimalist Personal Developer Portfolio
   Directly matching the visual language, typography, and motion of sahen.site.
   Deep surface (#070808), Geist Variable typography, compact island navigation,
   3D parallax layered wordmark, pinned hero social rail, and interactive stack stage.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Typography: Geist & Geist Mono
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;650;700&family=Geist+Mono:wght@400;500;600&display=swap');

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Variables (Exact sahen.site Baselines)
   -------------------------------------------------------------------------- */
:root {
  /* Dark Surface Palette (Default Baseline) */
  --bg: #070808;
  --bg-raised: #0c0d0d;
  --surface: #101111;
  --surface-hover: #171818;
  --line: #242626;
  --line-strong: #383b3a;
  --text: #f0f1ef;
  --text-soft: #c8cbc8;
  --text-muted: #858a87;
  --inverse-bg: #f3f3ef;
  --inverse-text: #080909;

  /* Restrained Editorial Accents */
  --nelo: #8fe2d8;        /* Mint / Teal */
  --pink: #efb6cf;        /* Pastel Pink */
  --aegis: #e3c991;       /* Warm Gold */
  --brand-japan: #c83f52; /* Accent Red */

  /* Sizing & Layout Scales */
  --content-width: min(1240px, calc(100% - clamp(32px, 6vw, 88px)));
  --reading-width: min(720px, calc(100% - 40px));
  --max-width: var(--content-width);
  --radius: .75rem;
  --radius-md: calc(var(--radius) * .82);

  /* Motion & Physics Tokens */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --motion-spring: cubic-bezier(.16, 1, .3, 1);
  --default-transition-duration: .15s;

  /* Typography */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Dynamic Mouse Coordinates */
  --mx: 0;
  --my: 0;
  --motion-spot-x: 50%;
  --motion-spot-y: 50%;
}

/* Accessible Light Mode Override */
[data-theme="light"] {
  --bg: #f4f4f1;
  --bg-raised: #fafaf7;
  --surface: #ecece7;
  --surface-hover: #e4e5df;
  --line: #d7d8d1;
  --line-strong: #bfc2bb;
  --text: #141616;
  --text-soft: #3f4341;
  --text-muted: #737975;
  --inverse-bg: #111313;
  --inverse-text: #f5f5f1;
  --nelo: #2f7d75;
  --pink: #a75278;
  --aegis: #8c6b31;
}

/* --------------------------------------------------------------------------
   2. Reset & Document Baseline
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  color-scheme: dark light;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--default-transition-duration) var(--ease-out),
              color var(--default-transition-duration) var(--ease-out);
}

/* Top 2px Progress Bar */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 2px;
  background: var(--text);
  opacity: 0;
  transform-origin: 0% 50%;
  transform: scaleX(0);
  pointer-events: none;
}
.nav-progress[data-state="loading"] {
  opacity: .72;
  transition: transform .9s var(--ease-out), opacity .12s;
  transform: scaleX(.72);
}
.nav-progress[data-state="done"] {
  opacity: 0;
  transition: transform .16s ease-out, opacity .22s 80ms;
  transform: scaleX(1);
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  background: var(--text);
  color: var(--inverse-text);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  z-index: 999;
  transition: top 0.18s var(--ease-out);
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* Page Containers */
.container {
  width: var(--content-width);
  margin-inline: auto;
  position: relative;
}

/* Site navigation spacer */
.site-nav-spacer {
  height: calc(68px + env(safe-area-inset-top));
}

/* --------------------------------------------------------------------------
   3. Floating Island Navbar (.island-nav)
   -------------------------------------------------------------------------- */
.island-nav {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  background: radial-gradient(150px circle at var(--motion-spot-x, 50%) var(--motion-spot-y, 50%), color-mix(in srgb, var(--text) 6%, transparent), transparent 72%), color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent), 0 12px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform .28s var(--ease-out), background-color .24s var(--ease-out), box-shadow .24s var(--ease-out), border-color .24s var(--ease-out);
}

.island-nav:hover,
.island-nav:focus-within {
  transform: translate(-50%) translateY(0) scale(1) !important;
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
}

.island-nav[data-compact="true"] {
  transform: translate(-50%) translateY(-2px) scale(.965);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent), 0 16px 42px rgba(0, 0, 0, 0.36), 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Home / Time Button */
.island-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding-inline: 10px 8px;
  text-decoration: none;
  color: var(--text);
  border-radius: 16px;
  position: relative;
  transition: transform .14s var(--ease-out), background-color .18s var(--ease-out), color .18s var(--ease-out);
}
.island-nav__home:hover {
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  transform: translateY(-1px);
}
.island-nav__home:active {
  transform: translateY(1px) scale(.97);
}

.island-nav__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  letter-spacing: -0.02em;
  color: var(--text-soft);
  font-weight: 500;
  line-height: 1;
}

.island-nav__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  flex-shrink: 0;
}

.island-nav__back-arrow {
  font-size: 0.86rem;
  color: var(--text-muted);
  transition: transform .18s var(--ease-out), color .18s ease;
}
.island-nav__home:hover .island-nav__back-arrow {
  transform: translateX(-2px);
  color: var(--text);
}

.island-nav__tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, -8px) scale(.95);
  background: var(--text);
  color: var(--inverse-text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out), visibility 0s linear .3s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 70;
}
.island-nav__tooltip::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translate(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--text);
  border-radius: 1px;
}
.island-nav__home:hover .island-nav__tooltip,
.island-nav__home:focus-visible .island-nav__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition-delay: .35s;
}

/* Divider line */
.island-nav__divider {
  width: 1px;
  height: 20px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  margin-inline: 2px;
}

/* Nav links container & sliding cursor */
.island-nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  isolation: isolate;
  --nav-cursor-x: 0px;
  --nav-cursor-width: 0px;
}

.island-nav__cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  height: 100%;
  width: var(--nav-cursor-width);
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface-hover) 75%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
  opacity: 0;
  transform: translate3d(var(--nav-cursor-x), 0, 0) scale(.96);
  pointer-events: none;
  transition: transform .24s var(--motion-spring), width .22s var(--motion-spring), opacity .12s ease;
}

.island-nav__links[data-cursor-visible="true"] .island-nav__cursor {
  opacity: 1;
  transform: translate3d(var(--nav-cursor-x), 0, 0) scale(1);
}

/* Nav Link Items */
.island-nav__item {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding-inline: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--motion-spring), color .14s ease, filter .14s ease;
}

.island-nav__item:hover,
.island-nav__item:focus-visible {
  color: var(--text);
  filter: brightness(1.04);
  transform: translateY(-1px) scale(1.012);
}

.island-nav__item:active {
  filter: brightness(.94);
  transform: translateY(1px) scale(.96);
}

.island-nav__item[aria-current="page"] {
  color: var(--text);
  font-weight: 650;
}

/* 3px active dot */
.island-nav__item::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translate(-50%, 2px) scale(.7);
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity .13s ease, transform .17s var(--motion-spring);
}

.island-nav__item[aria-current="page"]::after,
.island-nav__item:hover::after {
  opacity: .55;
  transform: translate(-50%, 0) scale(1);
}

.island-nav__icon {
  width: 15px;
  height: 15px;
  opacity: .72;
  transition: transform .17s var(--motion-spring), opacity .14s ease;
}
.island-nav__item:hover .island-nav__icon {
  opacity: 1;
  transform: translateY(-1px) rotate(-2deg) scale(1.05);
}

/* Language selector & Theme toggle */
.island-nav__controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.island-nav__locale-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  min-width: 36px;
  padding-inline: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  border-radius: 16px;
  cursor: pointer;
  transition: color .14s ease, background-color .18s var(--ease-out), transform .14s var(--ease-out);
}
.island-nav__locale-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  transform: translateY(-1px);
}

.lang-menu-container {
  position: relative;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(.98);
  transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility 0s linear .16s;
  z-index: 100;
}
.lang-popover.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.lang-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.lang-item-btn:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text);
}
.lang-item-btn.active {
  color: var(--text);
  font-weight: 650;
}
.lang-item-btn .check-mark {
  opacity: 0;
  color: var(--nelo);
  font-size: 0.85rem;
}
.lang-item-btn.active .check-mark {
  opacity: 1;
}

/* Theme toggle */
.island-nav__theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .14s ease, background-color .18s var(--ease-out), transform .14s var(--ease-out);
}
.island-nav__theme-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  transform: translateY(-1px);
}
.island-nav__theme-btn:active {
  transform: translateY(1px) scale(.96);
}

.theme-icon-sun, .theme-icon-moon {
  width: 15px;
  height: 15px;
}
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }
:root:not([data-theme="light"]) .theme-icon-sun { display: block; }
:root:not([data-theme="light"]) .theme-icon-moon { display: none; }

/* --------------------------------------------------------------------------
   4. Pinned Right Social Rail (.social-rail — ONLY Homepage Hero)
   -------------------------------------------------------------------------- */
.social-rail {
  position: fixed;
  top: 50%;
  right: max(14px, env(safe-area-inset-right));
  z-index: 48;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
  border-radius: 17px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent), 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  transform: translate(12px, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease-out), transform .22s var(--ease-out), border-color .18s var(--ease-out);
}

.social-rail[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.social-rail:hover,
.social-rail:focus-within {
  border-color: color-mix(in srgb, var(--text) 18%, transparent);
}

.social-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s var(--ease-out), background-color .17s var(--ease-out), transform .17s var(--ease-out);
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  transform: translate(-2px);
}

.social-link:active {
  transform: translate(-1px) scale(.96);
}

.social-brand-icon {
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-brand-icon svg {
  width: 100%;
  height: 100%;
}

/* Floating tooltip on left */
.social-tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translate(5px, -50%);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: opacity .14s var(--ease-out), transform .16s var(--ease-out);
}

.social-link:hover .social-tip,
.social-link:focus-visible .social-tip {
  opacity: 1;
  transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   5. Hero Section & 3D Layered Wordmark (.hero, .wordmark)
   -------------------------------------------------------------------------- */
.hero {
  --mx: 0;
  --my: 0;
  isolation: isolate;
  place-items: center;
  min-height: min(700px, 100svh - 64px);
  padding-block: clamp(60px, 8vw, 104px);
  display: grid;
  position: relative;
  overflow: hidden;
}

/* Dual radial background blur from sahen */
.hero::before {
  z-index: -3;
  background: radial-gradient(circle at 34% 52%, color-mix(in srgb, var(--pink) 15%, transparent), transparent 31%), radial-gradient(circle at 67% 46%, color-mix(in srgb, var(--nelo) 14%, transparent), transparent 34%);
  content: "";
  filter: blur(24px);
  opacity: .8;
  pointer-events: none;
  position: absolute;
  inset: 4% 7%;
}

/* Breathing Halo Ring */
.hero::after {
  z-index: -2;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  content: "";
  opacity: .5;
  width: min(820px, 74vw);
  transform: translate3d(calc(var(--mx) * -12px), calc(var(--my) * -8px), 0);
  transition: transform .22s var(--ease-out);
  pointer-events: none;
  border-radius: 50%;
  animation: 9s ease-in-out infinite alternate halo-breathe;
  position: absolute;
}

@keyframes halo-breathe {
  0% { transform: translate3d(calc(var(--mx) * -12px), calc(var(--my) * -8px), 0) scale(0.97); }
  100% { transform: translate3d(calc(var(--mx) * -12px), calc(var(--my) * -8px), 0) scale(1.03); }
}

/* Ambient geometry */
.hero-geometry {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .76;
}

.geo-line--two {
  width: 32%;
  transform: rotate(11deg) translate3d(calc(var(--mx) * -12px), 0, 0);
  bottom: 25%;
  right: 0;
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 16%, transparent), transparent);
  animation-delay: -3s;
}

.geo-ring--two {
  border: 1px solid color-mix(in srgb, var(--text) 7%, transparent);
  border-radius: 50%;
  aspect-ratio: 1;
  width: 112px;
  bottom: 13%;
  right: 12%;
  position: absolute;
  animation: 8s ease-in-out infinite alternate ring-drift;
}

@keyframes ring-drift {
  0% { transform: translate(0, 0) scale(0.96); }
  100% { transform: translate(-6px, 8px) scale(1.04); }
}

.hero-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(1060px, 100%);
  padding-inline: clamp(0px, 1vw, 10px);
}

/* Greeting aligned towards top-left of wordmark */
.hello-launcher {
  align-self: flex-start;
  margin: 0 0 10px clamp(8px, 4vw, 54px);
}

.hero-hello {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 620;
  line-height: 1;
  color: var(--text-soft);
  letter-spacing: -.035em;
  text-align: left;
  transform-origin: 18% 100%;
  animation: hello-arrive .56s var(--ease-out) both;
}

@keyframes hello-arrive {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 3-Layer 3D Wordmark */
.wordmark {
  position: relative;
  isolation: isolate;
  perspective: 1100px;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin-inline: auto;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

.wordmark h1,
.wordmark-layer {
  display: block;
  font-size: clamp(4.4rem, 9.5vw, 9.8rem);
  font-weight: 650;
  line-height: .78;
  letter-spacing: -.085em;
  padding-inline-end: .08em;
  text-align: center;
  white-space: nowrap;
}

/* Layer 1: Back outline */
.wordmark-layer--back {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 15%, transparent);
  opacity: .2;
  transform: translate3d(calc(18px - var(--mx) * 18px), calc(20px - var(--my) * 14px), -48px);
  animation: none;
}

/* Layer 2: Mid outline */
.wordmark-layer--mid {
  position: absolute;
  inset: 0;
  z-index: 2;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 15%, transparent);
  opacity: .42;
  transform: translate3d(calc(8px - var(--mx) * 11px), calc(9px - var(--my) * 8px), -24px);
  animation: none;
}

/* Layer 3: Foreground Title with Sheen Gradient & Tilt */
.wordmark h1 {
  position: relative;
  z-index: 4;
  color: transparent;
  background: linear-gradient(100deg, var(--pink) 0%, var(--text) 17%, var(--nelo) 33%, var(--pink) 50%, var(--text) 67%, var(--nelo) 83%, var(--pink) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: 5.6s ease-in-out infinite alternate wordmark-sheen;
  transform: translate3d(calc(var(--mx) * 7px), calc(var(--my) * 5px), 0) rotateX(calc(var(--my) * -2.2deg)) rotateY(calc(var(--mx) * 3.2deg));
  transform-origin: 50%;
  transition: transform .17s var(--ease-out);
  will-change: transform;
}

@keyframes wordmark-sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Tagline & Ambient Country Glow */
.hero-copy {
  position: relative;
  z-index: 8;
  margin-block-start: 34px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.45;
  letter-spacing: -.03em;
  color: var(--text-soft);
}

.hero-tagline {
  display: inline-block;
  padding: 4px 2px;
  cursor: default;
  transition: color .18s var(--ease-out), transform .18s var(--ease-out);
}

.hero-tagline .accent-country,
.hero-tagline span {
  display: inline-block;
  color: #c83f52;
  text-shadow: 0 0 5px #ff45567a, 0 0 14px #d6273d4d;
  background: linear-gradient(90deg, #8f2338, #f0b7b9 34%, #ff4d5f 58%, #b51f3b 76%, #8f2338) 0/220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  padding: 0 2px;
  animation: 2.8s ease-in-out infinite alternate country-glow;
}

@keyframes country-glow {
  0% { filter: drop-shadow(0 0 4px rgba(255, 69, 86, 0.4)); }
  100% { filter: drop-shadow(0 0 12px rgba(214, 39, 61, 0.7)); }
}

/* Hero Action Cards (.home-action) */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-block-start: 30px;
}

.home-action {
  min-height: 50px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
  transition: transform .15s var(--ease-out), border-color .19s var(--ease-out), box-shadow .19s var(--ease-out), background-color .19s var(--ease-out);
  border-radius: 14px;
  gap: 14px;
  padding-inline: 20px;
  font-size: 1rem;
  font-weight: 620;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.home-action:hover,
.home-action:focus-visible {
  border-color: color-mix(in srgb, var(--text) 30%, var(--line));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent), 0 10px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-2px);
}

.home-action:active {
  transform: translateY(1px) scale(.985);
}

.home-action .action-arrow {
  background: color-mix(in srgb, currentColor 9%, transparent);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  place-items: center;
  font-size: .92rem;
  display: inline-grid;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, currentColor 8%, transparent);
  transition: transform .17s var(--ease-out);
}

.home-action:hover .action-arrow,
.home-action:focus-visible .action-arrow {
  transform: translate(3px);
}

/* --------------------------------------------------------------------------
   6. Technology Stack Section (.stack-section, .stack-stage, .stack-grid)
   -------------------------------------------------------------------------- */
.stack-section {
  width: var(--content-width);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  padding-block: 18px 0;
}

.stack {
  padding: clamp(40px, 5vw, 64px) 0 clamp(60px, 8vw, 92px);
}

.stack-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

.stack-head h2 {
  margin: 0;
  font-size: clamp(2.7rem, 4.5vw, 4.15rem);
  font-weight: 650;
  line-height: .9;
  letter-spacing: -.065em;
  color: var(--text);
}

.stack-head p {
  margin: 9px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.stack-count {
  margin: 0 0 3px !important;
  font-size: 0.9rem !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Stage container with mouse spotlight */
.stack-stage {
  --mx: 50%;
  --my: 45%;
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raised) 88%, var(--bg));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent), 0 20px 54px rgba(0, 0, 0, 0.18);
  isolation: isolate;
  contain: layout paint style;
  overflow: hidden;
}

.stack-stage::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  background: radial-gradient(360px circle at var(--mx) var(--my), color-mix(in srgb, var(--text) 7%, transparent), transparent 68%);
  pointer-events: none;
}

/* 6-column grid matching sahen.site */
.stack-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--line) 82%, transparent);
}

/* Individual Tile */
.stack-item {
  --lx: 50%;
  --ly: 42%;
  --dx: 0px;
  --dy: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 126px;
  padding: 15px;
  background: color-mix(in srgb, var(--bg-raised) 87%, transparent);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transform: translateZ(0);
  transition: transform .22s var(--ease-out), background-color .22s var(--ease-out), box-shadow .22s var(--ease-out);
}

/* Featured & Wide Variations matching sahen.site 4-row layout */
.stack-item.is-featured {
  grid-column: span 2;
  min-height: 170px;
  padding: 18px;
}

.stack-item.is-wide {
  grid-column: span 2;
  min-height: 138px;
}

.stack-item:hover,
.stack-item:focus-visible {
  z-index: 3;
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 38%, transparent), 0 14px 34px rgba(0, 0, 0, 0.2);
  outline: none;
  transform: translateY(-1px) scale(1.006);
}

/* Ambient Brand Glow inside card */
.stack-item::before {
  content: "";
  position: absolute;
  inset: -34% 35% 30% -20%;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%);
  opacity: .45;
  pointer-events: none;
  transform: scale(.84);
  transition: opacity .24s var(--ease-out), transform .3s var(--ease-out);
}

.stack-item:hover::before,
.stack-item:focus-visible::before {
  opacity: .82;
  transform: scale(1.12);
}

/* Mouse spotlight inside each card */
.stack-local-light {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(150px circle at var(--lx) var(--ly), color-mix(in srgb, var(--brand) 20%, transparent), transparent 68%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease-out);
}

.stack-item:hover .stack-local-light,
.stack-item:focus-visible .stack-local-light {
  opacity: 1;
}

/* Icon Orb */
.stack-orb {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px color-mix(in srgb, var(--brand) 7%, transparent);
  transform: translate(var(--dx), var(--dy));
  transition: border-color .22s var(--ease-out), background-color .22s var(--ease-out), box-shadow .22s var(--ease-out);
}

.is-featured .stack-orb {
  width: 78px;
  height: 78px;
  border-radius: 21px;
}

.is-wide .stack-orb {
  width: 64px;
  height: 64px;
}

.stack-item:hover .stack-orb,
.stack-item:focus-visible .stack-orb {
  border-color: color-mix(in srgb, var(--brand) 58%, var(--line));
  background: color-mix(in srgb, var(--brand) 13%, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 14px 34px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* Glyph / SVG Icon */
.stack-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 7px 16px color-mix(in srgb, var(--brand) 16%, transparent));
  transition: transform .24s var(--ease-out), filter .24s var(--ease-out);
}
.is-featured .stack-glyph {
  width: 56px;
  height: 56px;
}
.is-wide .stack-glyph {
  width: 46px;
  height: 46px;
}
.stack-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stack-item:hover .stack-glyph,
.stack-item:focus-visible .stack-glyph {
  filter: drop-shadow(0 9px 20px color-mix(in srgb, var(--brand) 30%, transparent));
  transform: scale(1.07);
}

/* Stream particles */
.stack-trail {
  position: absolute;
  inset: 14px 10px auto 34%;
  z-index: 1;
  height: 56px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .18s var(--ease-out);
  -webkit-mask-image: linear-gradient(90deg, #0000, #000 16% 82%, #0000);
  mask-image: linear-gradient(90deg, #0000, #000 16% 82%, #0000);
}
.stack-trail span {
  position: absolute;
  top: 50%;
  left: -32px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 52%, transparent);
  opacity: 0;
}
.stack-item:hover .stack-trail,
.stack-item:focus-visible .stack-trail {
  opacity: .7;
}

/* Metadata */
.stack-meta {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3px;
  margin-top: 20px;
}

.stack-name {
  font-size: .98rem;
  font-weight: 620;
  letter-spacing: -.026em;
  line-height: 1.12;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.is-featured .stack-name {
  font-size: 1.2rem;
  font-weight: 660;
}
.is-wide .stack-name {
  font-size: 1.05rem;
}

.stack-category {
  font-size: .72rem;
  font-weight: 520;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Top-right arrow */
.stack-arrow {
  position: absolute;
  top: 13px;
  right: 14px;
  z-index: 3;
  font-size: .9rem;
  line-height: 1;
  color: var(--brand);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity .18s var(--ease-out), transform .22s var(--ease-out);
}

.stack-item:hover .stack-arrow,
.stack-item:focus-visible .stack-arrow {
  opacity: 1;
  transform: translate(0);
}

/* Stagger entrance: default visible so icons NEVER disappear */
.stack-item {
  opacity: 1;
}

.stack-stage.is-visible .stack-item {
  animation: .56s cubic-bezier(.16, 1, .3, 1) both stack-enter;
  animation-delay: calc(var(--i) * 28ms + 20ms);
}

@keyframes stack-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   7. Works Page (.work-page, .work-intro, .repo-grid, .repo-card)
   -------------------------------------------------------------------------- */
.work-page {
  width: var(--content-width);
  margin-inline: auto;
}

.work-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-block: clamp(30px, 5vw, 58px) clamp(20px, 3vw, 32px);
}

.work-intro h1 {
  font-size: clamp(4.2rem, 8.5vw, 7.8rem);
  font-weight: 650;
  line-height: .9;
  letter-spacing: -.08em;
  color: var(--text);
}
.work-intro h1 span.work-dot {
  color: var(--nelo);
}

.work-intro p {
  max-width: 28ch;
  color: var(--text-muted);
  padding-bottom: 3px;
  font-size: clamp(.91rem, 1.2vw, 1.04rem);
  line-height: 1.5;
}

.repo-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 43px;
  border-top: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.repo-count {
  font-variant-numeric: tabular-nums;
}

.repo-all-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color .18s var(--ease-out);
}
.repo-all-link:hover,
.repo-all-link:focus-visible {
  color: var(--text);
}
.repo-all-link span.arrow {
  transition: transform .18s var(--ease-out);
}
.repo-all-link:hover span.arrow {
  transform: translate(2px, -2px);
}

/* 3-Column Repository Grid */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.repo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 185px;
  padding: 17px clamp(12px, 1.7vw, 22px) 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background-color: transparent;
  isolation: isolate;
  transition: background-color .22s var(--ease-out);
}

.repo-card:nth-child(3n) {
  border-right: 0;
}

/* Card bottom border expander on hover */
.repo-card::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: color-mix(in srgb, var(--text) 55%, transparent);
  transform: scaleX(0);
  transform-origin: 0% 50%;
  pointer-events: none;
  transition: transform .32s var(--ease-out);
}

.repo-card:hover,
.repo-card:focus-visible {
  background-color: color-mix(in srgb, var(--surface-hover) 54%, transparent);
}
.repo-card:hover::after,
.repo-card:focus-visible::after {
  transform: scaleX(1);
}

.repo-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.repo-index {
  font-variant-numeric: tabular-nums;
  font-size: 0.77rem;
  color: var(--text-muted);
}

.repo-arrow {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color .18s ease, transform .22s var(--ease-out);
}
.repo-card:hover .repo-arrow,
.repo-card:focus-visible .repo-arrow {
  color: var(--text);
  transform: translate(3px, -3px) rotate(3deg);
}

.repo-name {
  margin-block-start: 15px;
  font-size: clamp(1.43rem, 2.1vw, 2.08rem);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -.055em;
  color: var(--text);
  transition: transform .22s var(--ease-out);
  overflow-wrap: anywhere;
}
.repo-card:hover .repo-name,
.repo-card:focus-visible .repo-name {
  transform: translateY(-2px);
}

.repo-description {
  margin-block-start: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.repo-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin-block-start: auto;
  padding-block-start: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.repo-language {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
}
.repo-language svg {
  width: 14px;
  height: 14px;
}

.repo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-soft);
  margin-left: auto;
}
.repo-badge.live {
  border-color: color-mix(in srgb, var(--nelo) 40%, transparent);
  color: var(--nelo);
}

/* Experience Section in Work Page */
.work-experience-section {
  margin-top: 4rem;
  padding-bottom: 2rem;
}

.experience-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.experience-head h2 {
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: .95;
  color: var(--text);
}

.experience-head p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.experience-list {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

.experience-item {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: clamp(20px, 3vw, 48px);
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .18s ease;
}

.exp-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.exp-role {
  font-size: 1.25rem;
  font-weight: 620;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.exp-company {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.exp-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 65ch;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.exp-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--line);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Apps Page (.apps-page, .apps-intro, .apps-list, .app-card)
   -------------------------------------------------------------------------- */
.apps-page {
  width: var(--content-width);
  margin-inline: auto;
}

.apps-intro {
  padding-block: clamp(56px, 8vw, 94px) clamp(34px, 5vw, 52px);
}

.apps-intro h1 {
  font-size: clamp(4.4rem, 10vw, 8.8rem);
  font-weight: 650;
  line-height: .8;
  letter-spacing: -.08em;
  color: var(--text);
}

.apps-intro p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.apps-list {
  display: grid;
  gap: 12px;
  padding-bottom: 72px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease, transform .12s var(--ease-out);
}

.app-card:hover {
  background: var(--surface-hover);
}

.app-card:active {
  transform: scale(.99);
}

.app-mark {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}
.app-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.app-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.app-desc {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.app-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform .18s var(--ease-out), color .18s var(--ease-out);
}
.app-card:hover .app-arrow {
  color: var(--text);
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   9. Contact Page (.contact-page, .contact-head, .contact-list, .contact-item)
   -------------------------------------------------------------------------- */
.contact-page {
  width: var(--content-width);
  margin-inline: auto;
  padding-block: clamp(54px, 9vw, 108px);
}

.contact-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .38fr);
  align-items: end;
  gap: clamp(34px, 7vw, 110px);
  padding-block-end: clamp(38px, 6vw, 68px);
}

.contact-head h1 {
  font-size: clamp(5.2rem, 12vw, 10.5rem);
  font-weight: 650;
  line-height: .8;
  letter-spacing: -.085em;
  color: var(--text);
}

.contact-head p {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.5;
}

.contact-list {
  border-top: 1px solid var(--line-strong);
}

.contact-item {
  display: grid;
  grid-template-columns: minmax(90px, .16fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 4vw, 58px);
  min-height: clamp(92px, 9vw, 124px);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: padding-inline .18s var(--ease-out), background-color .16s ease;
}

.contact-item:hover,
.contact-item:focus-visible {
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  padding-inline: 14px;
}

.contact-item > span.channel-label {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.contact-item strong.channel-value {
  min-width: 0;
  font-size: clamp(1.35rem, 3vw, 2.7rem);
  font-weight: 590;
  letter-spacing: -.045em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact-item b.channel-arrow {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: transform .18s var(--ease-out), color .18s var(--ease-out);
}

.contact-item:hover b.channel-arrow,
.contact-item:focus-visible b.channel-arrow {
  color: var(--text);
  transform: translate(4px, -4px);
}

/* Copy email button on contact page */
.copy-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin-left: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.copy-btn-inline:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Copy Toast notification */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--inverse-text);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  z-index: 1000;
}
.copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   10. Global Subpage Footer (.site-footer — Exact sahen.site layout)
   -------------------------------------------------------------------------- */
.site-footer {
  width: var(--content-width);
  border-top: 1px solid var(--line);
  min-height: 76px;
  color: var(--text-muted);
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: clamp(48px, 7vw, 84px) auto 0;
  font-size: .86rem;
  display: flex;
  padding-block: 20px;
}

.footer-links {
  gap: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color .16s var(--ease-out), transform .1s var(--ease-out);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
}

.site-footer a:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   11. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 920px) {
  .stack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stack-item.is-featured,
  .stack-item.is-wide {
    grid-column: span 1;
    min-height: 138px;
    padding: 15px;
  }
  .is-featured .stack-orb,
  .is-wide .stack-orb {
    border-radius: 17px;
    width: 62px;
    height: 62px;
  }
  .is-featured .stack-glyph,
  .is-wide .stack-glyph {
    width: 46px;
    height: 46px;
  }
  .is-featured .stack-name,
  .is-wide .stack-name {
    font-size: 1.02rem;
  }

  .repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .repo-card:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .repo-card:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  /* Social rail becomes a responsive bottom floating dock on hero */
  .social-rail {
    top: auto;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    flex-direction: row;
    left: 50%;
    transform: translate(-50%, 10px);
  }
  .social-rail[data-visible="true"] {
    transform: translate(-50%, 0);
  }
  .social-tip {
    display: none;
  }
  .social-link:hover,
  .social-link:focus-visible {
    transform: translateY(-2px);
  }
  .social-link:active {
    transform: translateY(-1px) scale(.96);
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-head {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 16px;
  }
  .contact-item {
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 88px;
  }
  .contact-item strong.channel-value {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer-links {
    gap: 10px 18px;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: min(640px, 100svh - 62px);
    padding-block: 46px 56px;
  }
  .hero::after {
    opacity: .38;
    width: min(520px, 112vw);
  }

  .hello-launcher {
    margin: 0 0 10px 2px;
  }
  .hero-hello {
    font-size: 1.16rem;
  }

  .wordmark {
    max-width: calc(100% - 8px);
  }
  .wordmark h1,
  .wordmark-layer {
    font-size: clamp(3.2rem, 16vw, 5.2rem);
    letter-spacing: -.075em;
    padding-inline-end: .14em;
  }
  .wordmark h1 {
    transform: none !important;
  }
  .wordmark-layer--mid {
    transform: translate3d(6px, 7px, -20px) !important;
  }
  .wordmark-layer--back {
    transform: translate3d(13px, 15px, -40px) !important;
  }

  .hero-copy {
    margin-block-start: 28px;
    font-size: 1.12rem;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 380px);
    margin-block-start: 26px;
    display: grid;
  }
  .hero-actions .home-action {
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding-inline: 16px !important;
  }

  .stack {
    padding-block: 34px 64px;
  }
  .stack-head {
    align-items: flex-start;
    margin-bottom: 17px;
  }
  .stack-head h2 {
    font-size: clamp(2.6rem, 12vw, 3.45rem);
  }
  .stack-count {
    margin-top: 3px !important;
    font-size: .8rem !important;
  }
  .stack-stage {
    border-radius: 16px;
  }
  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stack-item,
  .stack-item.is-featured,
  .stack-item.is-wide {
    min-height: 126px;
    padding: 12px;
  }
  .stack-orb,
  .is-featured .stack-orb,
  .is-wide .stack-orb {
    border-radius: 14px;
    width: 52px;
    height: 52px;
    transform: none;
  }
  .stack-glyph,
  .is-featured .stack-glyph,
  .is-wide .stack-glyph {
    width: 38px;
    height: 38px;
  }
  .stack-trail {
    display: none;
  }
  .stack-meta {
    margin-top: 18px;
  }
  .stack-name,
  .is-featured .stack-name,
  .is-wide .stack-name {
    font-size: .92rem;
  }
  .stack-arrow {
    top: 10px;
    right: 11px;
  }

  .work-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .repo-grid {
    grid-template-columns: 1fr;
  }
  .repo-card {
    border-right: 0 !important;
    min-height: 158px;
  }
}

@media (max-width: 560px) {
  .island-nav {
    gap: 2px;
    padding: 4px;
    border-radius: 20px;
  }
  .island-nav__item > span {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
  }
  .island-nav__item {
    width: 44px;
    padding-inline: 0 !important;
    justify-content: center;
  }
  .island-nav__links {
    gap: 2px;
  }
  .island-nav__home {
    min-width: 62px;
    padding-inline: 8px 6px !important;
    gap: 6px !important;
  }
  .island-nav__time {
    font-size: .68rem;
  }
  .island-nav__mark {
    width: 20px;
    height: 20px;
  }
  .island-nav__locale-btn {
    min-width: 34px;
    font-size: .72rem;
    padding-inline: 7px !important;
  }
}

@media (max-width: 420px) {
  .hero {
    min-height: auto;
    padding-block: 42px 50px;
  }
  .hero-actions {
    grid-template-columns: 1fr;
  }
  .island-nav__time {
    display: none;
  }
  .island-nav__home {
    min-width: 36px;
    padding-inline: 6px !important;
  }
  .island-nav__locale-btn {
    min-width: 32px;
    padding-inline: 6px !important;
  }
}

/* --------------------------------------------------------------------------
   12. Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .wordmark h1,
  .wordmark-layer {
    transform: none !important;
    animation: none !important;
  }
  .hero-hello,
  .hero::after,
  .geo-line--two,
  .geo-ring--two {
    animation: none !important;
  }
  .hero-tagline .accent-country,
  .hero-tagline span {
    animation: none !important;
  }
  .stack-stage .stack-item,
  .stack-stage.is-visible .stack-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .nav-progress {
    display: none;
  }
}

.hero-actions {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-decoration: none;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.hero-action-btn:hover {
  transform: translateY(-3px);
  color:#8fe2d8;
}

.action-arrow {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.hero-action-btn:hover .action-arrow {
  transform: translate(3px, -3px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-action-btn,
  .action-arrow {
    transition: none;
  }
}
