/* ============================================================
   Methindu Damsara portfolio
   Premium minimal identity. Apple / Linear feel:
   large elegant type, generous space, monochrome base with a
   single teal accent, soft ambient light, cinematic reveals.
   No em dashes anywhere in this file.
   ============================================================ */

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

:root {
  /* dark mode (default) */
  --bg: #08090c;
  --bg-2: #0d0f14;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.04);
  --accent: #34e1c4;
  --accent-rgb: 52, 225, 196;
  --accent-soft: rgba(52, 225, 196, 0.12);
  --text: #f3f5f7;
  --text-dim: #a2a8b2;
  --text-mute: #838b97;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.05);
  --glass: rgba(10, 12, 16, 0.55);
  --shadow: 0 24px 60px -38px rgba(0, 0, 0, 0.72);
  --glow-a: rgba(52, 225, 196, 0.24);
  --glow-b: rgba(52, 225, 196, 0.09);

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-h: 64px;
  --maxw: 1080px;
  /* deliberate radius scale: chips, cards, feature cards */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #ffffff;
  --surface: rgba(10, 14, 20, 0.018);
  --surface-2: rgba(10, 14, 20, 0.035);
  --accent: #0c9a85;
  --accent-rgb: 12, 154, 133;
  --accent-soft: rgba(12, 154, 133, 0.1);
  --text: #0d1014;
  --text-dim: #545b66;
  --text-mute: #636b78;
  --line: rgba(10, 14, 20, 0.1);
  --line-2: rgba(10, 14, 20, 0.2);
  --line-soft: rgba(10, 14, 20, 0.05);
  --glass: rgba(246, 247, 249, 0.62);
  --shadow: 0 30px 80px -46px rgba(20, 30, 40, 0.4);
  --glow-a: rgba(12, 154, 133, 0.18);
  --glow-b: rgba(12, 154, 133, 0.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  transition: background 0.6s var(--ease-soft), color 0.6s var(--ease-soft);
}

body.is-home { overflow-x: hidden; }

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

::selection {
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--text);
}

/* keyboard focus ring (only for keyboard nav, not mouse clicks) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ---------- ambient light ---------- */

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* primary cursor-following ambient light */
  background:
    radial-gradient(60vmax 60vmax at var(--gx, 50%) var(--gy, 18%), var(--glow-a), transparent 60%);
  transition: background-position 0.6s var(--ease-soft);
  transform-origin: 50% 30%;
  will-change: transform, opacity;
  animation: breathe 11s var(--ease-soft) infinite;
}

/* two slow-drifting aurora orbs (autonomous, not cursor driven) */
.glow::before,
.glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  filter: blur(8px);
}
.glow::before {
  width: 62vmax;
  height: 62vmax;
  top: -14vmax;
  right: -10vmax;
  background: radial-gradient(circle at center, var(--glow-a), transparent 62%);
  animation: aurora-a 30s ease-in-out infinite;
}
.glow::after {
  width: 54vmax;
  height: 54vmax;
  bottom: -16vmax;
  left: -12vmax;
  background: radial-gradient(circle at center, var(--glow-b), transparent 60%);
  animation: aurora-b 38s ease-in-out infinite;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(var(--line-soft) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 85%);
  mask-image: radial-gradient(circle at 50% 30%, #000, transparent 85%);
}

/* ---------- topbar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 44px);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-soft), background 0.4s var(--ease-soft);
}
.topbar.scrolled { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}
.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.brand-name { color: var(--text); }

.nav {
  display: inline-flex;
  align-items: center;
  gap: clamp(4px, 1.4vw, 14px);
}
.nav a {
  position: relative;
  padding: 8px 4px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }
.nav a.active { color: var(--text); }
.nav a.active::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); transform: rotate(10deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: block; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }

.bar-actions { display: inline-flex; align-items: center; gap: 10px; }

/* hamburger button (mobile only) */
.nav-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--text); }
.nt-bars { position: relative; width: 17px; height: 12px; }
.nt-bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nt-bars span:nth-child(1) { top: 0; }
.nt-bars span:nth-child(2) { top: 5px; }
.nt-bars span:nth-child(3) { top: 10px; }
.nav-toggle[aria-expanded="true"] .nt-bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nt-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nt-bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- page shell ---------- */

main.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + clamp(56px, 11vw, 130px)) clamp(20px, 6vw, 44px) clamp(40px, 8vw, 90px);
}

.page-head { margin-bottom: clamp(44px, 8vw, 88px); max-width: 30ch; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.page-title .hi {
  background: linear-gradient(110deg, var(--accent), var(--text) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  margin-top: 26px;
  max-width: 56ch;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.62;
  letter-spacing: -0.01em;
}

/* let the browser balance headline breaks and avoid orphan words */
.page-title,
.hero-name,
.entry-title,
.proj-title,
.channel-label,
.nl-t { text-wrap: balance; }
.lede,
.prose p,
.entry-body,
.proj-desc { text-wrap: pretty; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.22s var(--ease-soft), border-color 0.22s var(--ease-soft), background 0.22s var(--ease-soft), color 0.22s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.btn .arrow { transition: transform 0.3s var(--ease); color: var(--accent); }
.btn:hover { transform: translateY(-1px); border-color: var(--text-mute); }
.btn:active { transform: translateY(0); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04120f;
}
.btn.primary .arrow { color: #04120f; }
.btn.primary:hover { box-shadow: 0 10px 26px -14px rgba(var(--accent-rgb), 0.5); border-color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + 20px) clamp(20px, 6vw, 44px) clamp(40px, 8vh, 80px);
}

.hero-inner { max-width: 940px; margin: auto 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-dim);
  margin-bottom: clamp(26px, 4vw, 38px);
  background: var(--surface);
}
.hero-eyebrow .live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5);
  animation: live 2.6s var(--ease) infinite;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.9rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero-name .line { display: block; overflow: hidden; }
.hero-name .grad {
  background: linear-gradient(110deg, var(--text) 20%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  margin-top: clamp(22px, 4vw, 34px);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hero-role b { color: var(--text); font-weight: 600; }

.hero-ctas {
  margin-top: clamp(32px, 5vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.hero-meta {
  margin-top: clamp(30px, 5vw, 54px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 5vw, 54px);
  justify-content: center;
  color: var(--text-mute);
}
.hero-meta .m { text-align: center; }
.hero-meta .mk {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.hero-meta .mv {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.scroll-cue {
  margin-top: clamp(28px, 6vh, 60px);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-cue .bar {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--text-mute), transparent);
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}

/* ---------- generic section ---------- */

.section { margin-bottom: clamp(56px, 9vw, 110px); }
.section:last-of-type { margin-bottom: 0; }

.section-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-label .num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
}
.section-label h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  letter-spacing: -0.02em;
}

.prose p { color: var(--text-dim); font-size: clamp(1rem, 1.6vw, 1.14rem); line-height: 1.7; max-width: 64ch; }
.prose p + p { margin-top: 18px; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: clamp(34px, 6vw, 72px);
  align-items: start;
}

.portrait {
  position: sticky;
  top: calc(var(--topbar-h) + 30px);
}
.portrait-frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.portrait-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.9s var(--ease);
}
.portrait-frame:hover img { transform: scale(1.03); }
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
[data-theme="light"] .portrait-frame::after { background: linear-gradient(180deg, transparent 60%, rgba(20, 30, 40, 0.14)); }
.portrait-cap {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #eef2f4;
  font-weight: 500;
}
.portrait-cap .hi { color: var(--accent); }

.facts { display: grid; gap: 0; margin-top: clamp(30px, 5vw, 46px); }
.fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.fact:first-child { border-top: 1px solid var(--line); }
.fact .fk { color: var(--text-mute); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.fact .fv { color: var(--text); text-align: right; font-weight: 500; }
.fact .fv.hi { color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.pill {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.pill:hover { border-color: var(--accent); color: var(--text); }

/* ---------- timeline (background) ---------- */

.timeline { position: relative; display: grid; gap: clamp(8px, 1.4vw, 14px); }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}
.entry:hover { border-color: var(--line-2); background: var(--surface-2); }
.entry-when {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.entry-tag {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  letter-spacing: -0.02em;
}
.entry-sub { margin-top: 5px; color: var(--text-dim); font-weight: 500; }
.entry-sub .sep { color: var(--accent); margin: 0 8px; opacity: 0.7; }
.entry-body { margin-top: 12px; color: var(--text-dim); font-size: 0.97rem; line-height: 1.65; max-width: 60ch; }

/* institution / brand logo chip in the card corner */
.entry-logo {
  position: absolute;
  top: clamp(16px, 2.4vw, 24px);
  right: clamp(16px, 2.4vw, 24px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 62px;
  background: #ffffff;
  border: 1px solid rgba(10, 14, 20, 0.08);
  border-radius: var(--r-sm);
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.5);
}
.entry-logo img { display: block; width: auto; height: 46px; }
.entry-logo.mark img { height: 36px; }
/* reserve a right gutter so card text never runs under the floating logo chip */
.entry:has(.entry-logo) { padding-right: clamp(108px, 9vw, 124px); }

/* Microsoft mark (4 squares + wordmark) */
.ms-squares {
  display: grid;
  grid-template-columns: repeat(2, 17px);
  grid-template-rows: repeat(2, 17px);
  gap: 2px;
  flex: none;
}
.ms-squares i { display: block; }
.ms-squares i:nth-child(1) { background: #f25022; }
.ms-squares i:nth-child(2) { background: #7fba00; }
.ms-squares i:nth-child(3) { background: #00a4ef; }
.ms-squares i:nth-child(4) { background: #ffb900; }
.ms-word { font-family: "Segoe UI", system-ui, sans-serif; font-size: 16px; font-weight: 600; color: #5e5e5e; letter-spacing: -0.01em; }

/* ---------- projects ---------- */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.6vw, 24px);
}
.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  min-height: 230px;
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}
.proj::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 0%, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.proj:hover { border-color: var(--line-2); }
.proj:hover::before { opacity: 1; }
.proj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.proj-num { font-family: var(--font-display); font-weight: 600; font-size: 0.84rem; color: var(--text-mute); }
.proj-stat {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
}
.proj-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.proj-desc { color: var(--text-dim); font-size: 0.97rem; line-height: 1.65; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 22px; }
.proj-tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mute);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.ph { color: var(--text-mute); }

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.6vw, 22px);
}
.channel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.channel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 80% at 0% 50%, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.channel:hover { border-color: var(--line-2); transform: translateY(-2px); }
.channel:hover::before { opacity: 1; }
.channel-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.channel-icon svg { display: block; }
.channel-body { flex: 1; }
.channel-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}
.channel-sub { display: block; margin-top: 3px; font-size: 0.86rem; color: var(--text-dim); }
.channel-arrow {
  color: var(--text-mute);
  font-size: 1.1rem;
  transition: transform 0.35s var(--ease), color 0.3s var(--ease);
}
.channel:hover .channel-arrow { color: var(--accent); transform: translate(3px, -3px); }

.contact-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.4vw, 22px);
  margin-top: clamp(20px, 3vw, 28px);
}
.meta-cell {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.meta-cell .ck { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }
.meta-cell .cv { margin-top: 9px; font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; letter-spacing: -0.01em; }
.meta-cell .cv.hi { color: var(--accent); }

/* ---------- next link (bottom of content pages) ---------- */

.next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(56px, 9vw, 110px);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft);
}
.next-link:hover { border-color: var(--text-mute); background: var(--surface-2); }
.next-link .nl-k { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); }
.next-link .nl-t {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}
.next-link .nl-arrow {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--accent);
  transition: transform 0.4s var(--ease);
}
.next-link:hover .nl-arrow { transform: translateX(8px); }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: clamp(50px, 8vw, 90px) auto 0;
  padding: 30px clamp(20px, 6vw, 44px) 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--text-mute);
  font-size: 0.86rem;
}
.foot a { color: var(--text-dim); transition: color 0.25s var(--ease); }
.foot a:hover { color: var(--accent); }
.foot-links { display: inline-flex; gap: 20px; }

/* ---------- cinematic reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s var(--ease-soft),
    transform 0.6s var(--ease-soft);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* hero staggered entrance */
.enter { opacity: 0; transform: translateY(14px); }
.is-loaded .enter {
  animation: enter 0.66s var(--ease-soft) forwards;
  animation-delay: var(--d, 0ms);
}

/* ---------- keyframes ---------- */

@keyframes enter {
  to { opacity: 1; transform: none; }
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.45); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0); }
}
@keyframes cue {
  0% { transform: scaleY(0); transform-origin: top; }
  40% { transform: scaleY(1); transform-origin: top; }
  60% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ambient background motion */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.07); opacity: 1; }
}
@keyframes aurora-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 5vh) scale(1.12); }
}
@keyframes aurora-b {
  0%, 100% { transform: translate(0, 0) scale(1.05); }
  50% { transform: translate(7vw, -4vh) scale(0.95); }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .portrait { position: relative; top: 0; max-width: 380px; order: -1; }
  .proj-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    z-index: 45;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px clamp(18px, 5vw, 44px) 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav a { padding: 15px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: none; }
  .nav a::after { display: none; }
  .nav a.active { color: var(--accent); }
}

@media (max-width: 600px) {
  :root { --topbar-h: 58px; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .entry-when { display: inline-flex; align-items: baseline; gap: 10px; }
  .entry-tag { display: inline; margin-top: 0; }
  /* keep the brand chips on mobile: reflow from the absolute corner to a badge atop each card */
  .entry:has(.entry-logo) { padding-right: clamp(22px, 3vw, 32px); }
  .entry-logo {
    position: static;
    order: -1;
    justify-self: start;
    width: 56px;
    height: 50px;
    margin-bottom: 12px;
    border-radius: var(--r-sm);
  }
  .entry-logo img { height: 34px; }
  .entry-logo.mark img { height: 28px; }
  .contact-meta { grid-template-columns: 1fr; }
  .hero-meta { gap: 18px 30px; }
  .next-link { flex-direction: row; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-name { font-size: clamp(2.4rem, 13vw, 3.2rem); }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { flex: 1; justify-content: center; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .enter { opacity: 1; transform: none; filter: none; }
  /* keep a calm static glow, no motion (animations neutralized above) */
  .glow { opacity: 1; transform: none; }
}
