:root {
  --bg: #08090a;
  --surface: rgba(15, 16, 18, 0.72);
  --solid: #0f1012;
  --text: #fafafa;
  --soft: #aaaeb4;
  --muted: #92979e;
  --border: rgba(255, 255, 255, 0.09);
  --border-hot: rgba(255, 255, 255, 0.22);
  --cloud: rgba(255, 255, 255, 0.13);
  --streak: rgba(165, 184, 202, 0.28);
  --shape: rgba(111, 144, 112, 0.2);
  --cursor-a: #fff;
  --cursor-b: #08090a;
  --shadow: rgba(0, 0, 0, 0.42);
  --nav: rgba(12, 13, 15, 0.72);
  --width: 848px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gh-0: rgba(255, 255, 255, 0.06);
  --gh-1: rgba(165, 184, 202, 0.28);
  --gh-2: rgba(165, 184, 202, 0.48);
  --gh-3: rgba(220, 230, 240, 0.72);
  --gh-4: #fafafa;
}

html[data-theme="light"] {
  --bg: #fff;
  --surface: rgba(255, 255, 255, 0.78);
  --solid: #fff;
  --text: #08090a;
  --soft: #63666a;
  --muted: #656b73;
  --border: rgba(8, 9, 10, 0.1);
  --border-hot: rgba(8, 9, 10, 0.23);
  --cloud: rgba(220, 224, 228, 0.47);
  --streak: rgba(32, 55, 72, 0.36);
  --shape: rgba(165, 214, 167, 0.2);
  --cursor-a: #08090a;
  --cursor-b: #fff;
  --shadow: rgba(28, 34, 40, 0.1);
  --nav: rgba(255, 255, 255, 0.78);
  --gh-0: rgba(8, 9, 10, 0.06);
  --gh-1: rgba(32, 55, 72, 0.22);
  --gh-2: rgba(32, 55, 72, 0.42);
  --gh-3: rgba(32, 55, 72, 0.68);
  --gh-4: #08090a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; scrollbar-color: var(--muted) var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--soft);
  background: var(--bg);
  font: 15px/1.65 "Inter", sans-serif;
  cursor: auto;
  transition: color .35s ease, background .35s ease;
}
a, button { color: inherit; font: inherit; cursor: pointer; }
a { text-decoration: none; }
button { border: 0; }
img, svg { display: block; max-width: 100%; }
::selection { color: var(--bg); background: var(--text); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 999px; background: var(--muted); }

/* Triangular cursor — small base size, smooth easing */
.cursor {
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  width: 10px;
  height: 12px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.2));
  transform: translate3d(-50%,-50%,0);
  transform-origin: 50% 58%;
  transition: width .3s var(--ease), height .3s var(--ease), opacity .2s ease;
}
.cursor::before, .cursor span {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0,100% 88%,56% 72%,50% 100%,44% 72%,0 88%);
  content: "";
}
.cursor::before { background: var(--cursor-a); }
.cursor span { inset: 1px; background: var(--cursor-b); }
body.has-cursor .cursor { opacity: 1; }
body.has-cursor,
body.has-cursor * { cursor: none !important; }
.cursor.is-hovering { width: 21px; height: 23px; }
.cursor.is-pressed { width: 12px; height: 14px; }

/* Atmospheric background */
.weather { position: fixed; z-index: -10; inset: 0; overflow: hidden; pointer-events: none; }
#streaks { position: absolute; inset: 0; }
.streak {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--length);
  height: 1px;
  border-radius: 999px;
  opacity: var(--opacity);
  background: linear-gradient(90deg,transparent,var(--streak) 25%,var(--streak),transparent);
  animation: streak-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
  transform: rotate(37deg);
}


/* Nav */
.site-header { position: fixed; z-index: 100; top: 0; right: 0; left: 0; }
.nav { display: grid; width: min(var(--width),calc(100% - 32px)); min-height: 64px; align-items: center; margin: auto; grid-template-columns: 1fr auto; }
.home { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--soft); transition: .25s; }
.home:hover, .nav-icon:hover { color: var(--text); background: var(--surface); }
.home svg { width: 19px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.7; }
.nav-actions { display: flex; justify-self: end; gap: 4px; }
.nav-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 10px; color: var(--soft); background: transparent; transition: .25s; font: 500 12px monospace; }
.nav-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.6; }
.terminal { position: fixed; z-index: 90; top: 72px; right: max(16px,calc((100vw - 848px)/2)); width: min(310px,calc(100% - 32px)); padding: 14px 16px 17px; border: 1px solid var(--border); border-radius: 13px; color: var(--soft); background: var(--solid); box-shadow: 0 20px 60px var(--shadow); font: 11px/1.65 monospace; opacity: 0; pointer-events: none; transform: translateY(-10px) scale(.98); transition: .32s var(--ease); }
.terminal.is-open { opacity: 1; pointer-events: auto; transform: none; }
.terminal strong { color: var(--text); }
.terminal-bar { display: flex; gap: 5px; margin-bottom: 11px; }
.terminal-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

/* Main */
main, footer { width: min(var(--width),calc(100% - 32px)); margin: auto; }
main { padding-top: 64px; }
.section { padding: 72px 0 8px; }
.section-heading { margin-bottom: 24px; }
.section-heading p { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.section-heading h2 { color: var(--text); font-size: clamp(1.55rem, 3vw, 1.85rem); font-weight: 700; letter-spacing: -.04em; }
.hero { position: relative; min-height: 650px; padding: 108px 0 76px; }
.hero-heading { max-width: 620px; }
.hero h1 { color: var(--text); font-size: clamp(2.8rem,6.1vw,4.25rem); font-weight: 800; letter-spacing: -.055em; line-height: 1; }
.hero-heading p { margin-top: 9px; color: var(--text); font-size: 13px; font-weight: 700; }
#age-counter { font-variant-numeric: tabular-nums; }
.portrait { position: absolute; top: 87px; right: 3%; display: grid; width: 126px; height: 126px; padding: 6px; place-items: center; border: 2px solid var(--text); border-radius: 50%; color: var(--text); background: var(--bg); box-shadow: 0 15px 35px var(--shadow); font-size: 24px; font-weight: 800; transition: transform .45s var(--ease); }
.portrait:hover { transform: translateY(-4px) rotate(2deg); }
.portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover;  }
.portrait-orbit { position: absolute; inset: -6px; border: 1px solid var(--border); border-radius: 50%; animation: spin 12s linear infinite; }
.portrait-orbit::after { position: absolute; top: 4px; right: 15px; width: 4px; height: 4px; border-radius: 50%; background: var(--text); content: ""; }
.portrait > b { position: absolute; top: -20px; right: -4px; color: var(--muted); font-size: 10px; letter-spacing: 2px; }
  .bio { max-width: 680px; margin-top: 52px; }
  .bio p { margin-bottom: 13px; }
.bio strong { color: var(--text); font-weight: 600; }
.bio a { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.bio a:hover { text-decoration-color: var(--text); }
.socials { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.social { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--soft); transition: .3s var(--ease); }
.social:hover { border-color: var(--border-hot); color: var(--text); background: var(--surface); transform: translateY(-3px); }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.social .mail { fill: none; stroke: currentColor; stroke-width: 1.5; }
.machine { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--muted); font-size: 11px; }
.machine strong { color: var(--soft); }
.machine em { color: var(--text); font-style: normal; font-weight: 600; }
.machine-link { cursor: none; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; transition: text-decoration-color .25s; }
.machine-link:hover { text-decoration-color: var(--text); }

/* Center alignment mechanics for HTML5 Dialog */
.spec-dialog {
  width: min(620px, calc(100% - 40px));
  max-height: min(90vh, 760px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  
  /* Absolute viewport centering positioning */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0; 
}

.spec-dialog::backdrop { 
  background: rgba(0, 0, 0, 0.7); 
  backdrop-filter: blur(5px); 
}

/* 3D Scene Wrapper inside the Dialog */
.spec-cuboid {
  position: relative;
  transform-style: preserve-3d;
  /* Balanced initial view orientation angles */
  transform: rotateX(6deg) rotateY(-10deg);
  perspective: 1800px;
  cursor: none;
  user-select: none;
}
.spec-cuboid:active { cursor: none; }

.spec-cuboid-face {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-hot, #ff5722);
  border-radius: 18px;
  background: var(--solid, #111);
  box-sizing: border-box;
}

/* Front & Back Panel Thickness calculations */
.spec-cuboid-front {
  position: relative;
  max-height: min(86vh, 740px);
  overflow-y: auto;
  padding: 28px 26px 26px;
  border-radius: 18px;
  background: var(--solid, #111);
  box-shadow: 0 30px 80px var(--shadow, rgba(0,0,0,0.5));
  transform: translateZ(15px); /* Thickness/2 */
}

.spec-cuboid-back { 
  transform: rotateY(180deg) translateZ(15px); 
}

/* Left, Right, Top, Bottom depth slices mapped to match 30px thickness total */
.spec-cuboid-right  { width: 30px; right: -15px; transform: rotateY(90deg); }
.spec-cuboid-left   { width: 30px; left: -15px; transform: rotateY(-90deg); }
.spec-cuboid-top    { height: 30px; top: -15px; transform: rotateX(90deg); }
.spec-cuboid-bottom { height: 30px; bottom: -15px; transform: rotateX(-90deg); }

/* Native Scrollbar customization inside front face */
.spec-cuboid-front::-webkit-scrollbar { width: 6px; }
.spec-cuboid-front::-webkit-scrollbar-thumb { background: var(--border-hot, #ff5722); border-radius: 10px; }

/* Existing layout details preserved */
.spec-dialog h2 { color: var(--text, #fff); font-size: 19px; font-weight: 700; margin: 0; }
.spec-sub { margin-top: 4px; color: var(--muted, #888); font-size: 12px; }
.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border, #333);
  border-radius: 50%;
  color: var(--soft, #ccc);
  background: var(--surface, #222);
  font-size: 12px;
  cursor: none;
  z-index: 10;
}
.close-btn:hover { color: var(--text, #fff); border-color: var(--border-hot, #ff5722); }
.spec-hero { overflow: hidden; margin-top: 18px; border: 1px solid var(--border, #333); border-radius: 13px; }
.spec-hero .laptop-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.spec-cards { display: grid; gap: 10px; margin-top: 14px; grid-template-columns: repeat(2, 1fr); }
.spec-card { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--border, #333); border-radius: 11px; background: var(--surface, #222); }
.spec-card img { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; }
.spec-label { display: block; color: var(--muted, #888); font-size: 10px; text-transform: uppercase; }
.spec-card strong { color: var(--text, #fff); font-size: 12px; font-weight: 600; }
.spec-dialog .specs { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border, #333); font-size: 12px; }

.projects-list { 
  overflow: hidden; 
  border: 1px solid var(--border, rgba(255,255,255,0.1)); 
  border-radius: 15px; 
  background: var(--surface, rgba(255,255,255,0.03)); 
  backdrop-filter: blur(14px); 
}

.project { 
  display: grid; 
  min-height: 120px; 
  align-items: center; 
  padding: 30px 25px; 
  grid-template-columns: 36px minmax(0, 1fr) 144px;
  gap: 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1)); 
  position: relative;
  transition: background .3s ease;
  text-decoration: none;
  cursor: auto;
}

.project:last-child { border-bottom: 0; }
.project:hover { background: rgba(255, 255, 255, 0.04); }

.number { 
  color: var(--muted, #666); 
  font: 13px monospace; 
  align-self: start;
  margin-top: 4px;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project header { 
  display: inline-flex; 
  align-items: center; 
  gap: 14px; 
  flex-wrap: wrap;
}

.project h3 { 
  color: var(--text, #fff); 
  font-size: 20px; 
  margin: 0;
  font-weight: 500;
}

.status-badge { 
  padding: 3px 8px; 
  border: 1px solid var(--border, rgba(255,255,255,0.2)); 
  border-radius: 20px; 
  color: var(--muted, #aaa); 
  font: 9px monospace; 
  letter-spacing: .08em; 
  text-transform: uppercase;
}

.project p { 
  margin: 0;
  color: var(--muted, #aaa); 
  font-size: 14px; 
  max-width: 54ch;
}
.project p a {
  color: var(--soft);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}
.project p a:hover { text-decoration-color: var(--text); }
.project p strong { color: var(--soft, #fff); }

.arrow { 
  justify-self: end; 
  color: var(--muted, #666); 
  font-size: 22px; 
  transition: transform .35s var(--ease, ease), color .35s ease; 
}
.project:hover .arrow { 
  color: var(--text, #fff); 
  transform: translate(4px, -4px); 
}

/* --- JS Dynamic Thumbnail Layout --- */
.thumb-wrapper {
  position: relative;
  align-self: start;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
}

.project-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-hot, #ff5722);
  border-radius: 10px;
  background: var(--solid, #111);
  opacity: 1;
  transition: transform .3s ease;
}

/* Activate thumbnail state smoothly when row is hovered */
.project:hover .project-thumb { 
  opacity: 1; 
  transform: scale(1.03);
}

.project-thumb img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 10px;
}

/* Stack grid */
.stack-grid { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); }
.stack-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 22px 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); backdrop-filter: blur(12px); transition: .3s var(--ease); }
.stack-item:hover { border-color: var(--border-hot); box-shadow: 0 12px 30px var(--shadow); transform: translateY(-3px); }
.stack-item img { width: 34px; height: 34px; object-fit: contain; }
.stack-item img.invert-on-dark { filter: invert(1); }
html[data-theme="light"] .stack-item img.invert-on-dark { filter: none; }
.stack-item span { color: var(--soft); font-size: 11px; font-weight: 600; }

/* GitHub contributions */
.github-card { padding: 22px 22px 20px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); backdrop-filter: blur(14px); }
.github-status { color: var(--muted); font-size: 12px; }
.github-scroll { overflow-x: auto; padding-bottom: 6px; }
.github-months { display: grid; min-width: 780px; margin-bottom: 6px; grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; color: var(--muted); font-size: 11px; }
.github-months span { grid-row: 1; }
.github-grid { display: grid; min-width: 780px; grid-auto-flow: column; grid-auto-columns: 13px; grid-template-rows: repeat(7, 13px); gap: 3px; }
.github-grid i { display: block; width: 13px; height: 13px; border-radius: 3px; background: var(--gh-0); }
.github-grid i[data-level="1"] { background: var(--gh-1); }
.github-grid i[data-level="2"] { background: var(--gh-2); }
.github-grid i[data-level="3"] { background: var(--gh-3); }
.github-grid i[data-level="4"] { background: var(--gh-4); }
.github-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.github-total { color: var(--text); font-size: 13px; font-weight: 600; }
.github-legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.github-legend i { display: block; width: 13px; height: 13px; border-radius: 3px; background: var(--gh-0); }
.github-legend i[data-level="1"] { background: var(--gh-1); }
.github-legend i[data-level="2"] { background: var(--gh-2); }
.github-legend i[data-level="3"] { background: var(--gh-3); }
.github-legend i[data-level="4"] { background: var(--gh-4); }
.github-card.has-error .github-status { color: var(--soft); }
.github-note { margin-top: 12px; color: var(--muted); font-size: 12px; }

.education { display: flex; flex-direction: column; gap: 10px; }
.education-card { display: flex; min-height: 96px; align-items: center; gap: 17px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); backdrop-filter: blur(12px); transition: .35s var(--ease); }
.education-card:hover { border-color: var(--border-hot); box-shadow: 0 12px 34px var(--shadow); transform: translateY(-2px); }
.school-image { display: grid; overflow: hidden; width: 62px; height: 62px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--text); background: var(--solid); font-size: 10px; font-weight: 700; }
.school-image img { width: 100%; height: 100%; object-fit: cover; }
.school-body { min-width: 0; flex: 1; }
.school-body h3 { color: var(--text); font-size: 14px; font-weight: 600; }
.school-body p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.school-body strong { color: var(--soft); }
.education-card time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.experience { display: flex; flex-direction: column; gap: 10px; }
.experience-card {
  display: grid;
  gap: 8px;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: .35s var(--ease);
}
.experience-card:hover {
  border-color: var(--border-hot);
  box-shadow: 0 12px 34px var(--shadow);
  transform: translateY(-2px);
}
.experience-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.experience-card h3 { color: var(--text); font-size: 16px; font-weight: 600; }
.experience-card .org { color: var(--soft); font-size: 12px; font-weight: 600; }
.experience-card p { color: var(--muted); font-size: 13px; max-width: 62ch; }
.page-hero { padding: 108px 0 12px; }
.page-hero h1 { color: var(--text); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.055em; line-height: 1; }
.page-hero p { margin-top: 10px; max-width: 52ch; }
.page-hero > p:first-child {
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.contact .section-heading h2 { max-width: 680px; font-size: clamp(1.7rem,4vw,2.6rem); }
.contact .section-heading h2 strong { color: var(--soft); }


.contact-cuboid {
  display: flex;
  justify-content: center;
  padding: 30px 0 38px;
  perspective: 1400px;
  cursor: none;
  user-select: none;
}

.contact-cuboid:active {
  cursor: none;
}

.cuboid {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 160px; /* Explicit height matching the card matches layout geometry */
  transform-style: preserve-3d;
  /* Starting position */
  transform: rotateX(-15deg) rotateY(20deg); 
  will-change: transform;
}

/* Removal of CSS hover transition to avoid fighting with JS control */

.cuboid-face {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-hot, #ff5722);
  border-radius: 15px;
  background: var(--surface, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(14px);
  box-sizing: border-box;
}

/* Front & Back depth: Z-axis translate handles total depth (68px / 2 = 34px) */
.cuboid-front {
  position: absolute;
  transform: translateZ(34px);
  background: transparent;
  backdrop-filter: none;
  border: 0;
}
.cuboid-front .contact-card { box-shadow: 0 22px 60px var(--shadow); }

.cuboid-back { 
  transform: rotateY(180deg) translateZ(34px); 
}

/* Side panels: Explicitly sizing widths/heights relative to the 68px depth */
.cuboid-right { 
  width: 68px; 
  left: auto;
  right: -34px; 
  transform: rotateY(90deg); 
}
.cuboid-left { 
  width: 68px; 
  left: -34px; 
  transform: rotateY(-90deg); 
}

/* Top & Bottom panels */
.cuboid-top { 
  height: 68px; 
  top: -34px; 
  transform: rotateX(90deg); 
}
.cuboid-bottom { 
  height: 68px; 
  bottom: -34px; 
  transform: rotateX(-90deg); 
}

/* Card Styling fixes */
.contact-card { 
  display: flex; 
  height: 100%; 
  align-items: center; 
  gap: 28px; 
  padding: 25px 28px; 
  border: 1px solid var(--border, #ccc); 
  border-radius: 15px; 
  background: var(--surface, #fff); 
  backdrop-filter: blur(14px); 
  box-sizing: border-box;
}
.contact-image { display: grid; overflow: hidden; width: 94px; height: 94px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border-hot, #ff5722); border-radius: 50%; color: var(--text); font-weight: 800; }
.contact-image img { width: 100%; height: 100%; object-fit: cover; }
.contact-content { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 25px; }
.contact-button { display: inline-flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 16px; border-radius: 10px; color: var(--bg, #fff); background: var(--text, #000); font-size: 12px; font-weight: 700; transition: .3s; text-decoration: none;}
.contact-button:hover { opacity: .86; transform: translateY(-2px); }

footer { padding: 40px 0 48px; color: var(--muted); font-size: 12px; }
footer strong { color: var(--soft); }
.image-fallback.is-missing::after { content: attr(data-fallback); }
.image-fallback.is-missing img { display: none; }
.reveal { opacity: 1; }
.reveal.will-reveal { opacity: 0; filter: blur(7px); transform: translateY(20px); transition: opacity .75s var(--ease),filter .75s var(--ease),transform .75s var(--ease); }
.reveal.is-visible { opacity: 1; filter: blur(0); transform: none; }

@keyframes streak-fall { 0%{opacity:0;translate:-80px -60px}14%{opacity:var(--opacity)}78%{opacity:var(--opacity)}100%{opacity:0;translate:240px 210px} }
@keyframes cloud-drift { to{translate:80px 5px} }
@keyframes spirit-float { 50%{translate:0 -11px} }
@keyframes shape-float { to{translate:20px -14px;rotate:9deg} }
@keyframes spin { to{rotate:360deg} }

@media (max-width:720px) {
  .nav { grid-template-columns:1fr auto; }
  .nav-actions { grid-column:2; }
  .hero { padding-top:65px; }
  .portrait { position:relative; top:auto; right:auto; width:112px; height:112px; margin:34px 0 0 auto; }
  .bio { margin-top:34px; }
  .project { grid-template-columns:24px minmax(0, 1fr); gap: 12px; }
  .thumb-wrapper { grid-column: 2; max-width: 220px; }
  .project > b { display:none; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .education-card { align-items:flex-start; flex-wrap:wrap; }
  .education-card time { width:100%; padding-left:79px; }
  .contact-card { align-items:flex-start; flex-direction:column; }
  .contact-content { width:100%; }
}
@media (max-width:480px) {
  body { font-size:14px; }
  .hero h1 { font-size:2.75rem; }
  .machine { align-items:flex-start; flex-direction:column; }
  .section { padding:68px 0; }
  .project { padding:20px 16px; }
  .project header { align-items:flex-start; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .education-card time { padding-left:0; }
  .contact-content { align-items:flex-start; flex-direction:column; }
  .contact-button { width:100%; justify-content:space-between; }
  .spec-cards { grid-template-columns: 1fr; }
}
@media (pointer:coarse) {
  body, body.has-cursor, body.has-cursor *, .nav-icon, a, button { cursor: auto !important; }
  a, button { cursor: pointer !important; }
  .cursor { display: none; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
  body { cursor:auto; }
  .cursor { display:none; }
  .reveal { opacity:1; filter:none; transform:none; }
}
/* ===== Get in touch card (interactive) ===== */
.gt-wrap { max-width: 600px; margin: 0 auto; perspective: 1000px; }
.gt-card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  text-align: left;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .25s ease-out, border-color .35s var(--ease), box-shadow .35s var(--ease);
  will-change: transform;
}
.gt-card:hover { border-color: var(--border-hot); box-shadow: 0 22px 60px var(--shadow); }
.gt-card::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), var(--cloud), transparent 65%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.gt-card:hover::before { opacity: 1; }
.gt-card > * { position: relative; }

.gt-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--soft); font-size: 11px; font-weight: 600; letter-spacing: .04em;
}
.gt-status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ecf6e;
  box-shadow: 0 0 0 0 rgba(62, 207, 110, .55);
  animation: gt-pulse 2s infinite;
}
@keyframes gt-pulse {
  70% { box-shadow: 0 0 0 8px rgba(62, 207, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 110, 0); }
}

.gt-title { color: var(--text); font-size: clamp(1.45rem, 3.6vw, 2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.gt-sub { margin-top: 8px; color: var(--soft); font-size: 14px; }
.gt-sub strong { color: var(--text); font-weight: 600; }

.gt-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 30px; }

.gt-signature {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0; border: 0; background: none; color: var(--text);
  line-height: 1; text-align: left;
}
.gt-signature span {
  font-family: "Mrs Saint Delafield", "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(2.6rem, 7vw, 3.4rem);
  padding: 0 4px 2px;
  transform: rotate(-4deg); transform-origin: left bottom;
  transition: transform .4s var(--ease);
}
.gt-signature:hover span { transform: rotate(-2deg) scale(1.04); }
.gt-signature svg { width: 100%; height: 10px; margin-top: -2px; opacity: .55; overflow: visible; }
.gt-signature path {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 260; stroke-dashoffset: 260;
}
.gt-card.is-drawn .gt-signature path,
.gt-signature.is-replay path { animation: gt-draw 1.2s ease forwards; }
@keyframes gt-draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }

.gt-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px;
  color: var(--bg); background: var(--text);
  font-size: 13px; font-weight: 700; text-decoration: none;
  transform: translate(var(--bx, 0px), var(--by, 0px));
  transition: transform .25s ease-out, opacity .25s, box-shadow .3s var(--ease);
}
.gt-button b { font-weight: 500; transition: transform .25s var(--ease); }
.gt-button:hover { opacity: .9; box-shadow: 0 10px 28px var(--shadow); }
.gt-button:hover b { transform: translate(3px, -3px); }


.gt-card :focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

@media (max-width: 520px) {
  .gt-card { padding: 24px; }
  .gt-row { align-items: flex-start; flex-direction: column; }
  .gt-button { width: 100%; justify-content: space-between; }
}
@media (hover: none), (prefers-reduced-motion: reduce) {
  .gt-card { transform: none !important; }
  .gt-button { transform: none !important; }
  .gt-status i { animation: none; }
}

/* ===== Tech enthusiast touches ===== */
:root { --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; --accent: #3ecf6e; }
.section-heading p { font-family: var(--mono); letter-spacing: .06em; text-transform: none; }
.section-heading p::before { content: "~/"; margin-right: 2px; color: var(--accent); }
.status-badge, .number { font-family: var(--mono); }
.hero-heading p.role { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.role .prompt { color: var(--accent); }
.caret { display: inline-block; width: 7px; height: 1.1em; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.terminal { width: min(360px, calc(100% - 32px)); font-family: var(--mono); font-size: 11px; }
.term-out { max-height: 210px; margin-top: 8px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; }
.term-out .cmd { color: var(--text); }
.term-out .ok { color: var(--accent); }
.term-in { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.term-in span { color: var(--accent); }
.term-in input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: none; font: inherit; caret-color: var(--accent); }
.terminal-toggle kbd { display: none; }
@media (prefers-reduced-motion: reduce) { .caret, .gt-status i { animation: none; } }
/* ===== Stack categories ===== */
.stack-groups { display: flex; flex-direction: column; gap: 26px; }
.stack-title { margin-bottom: 12px; color: var(--muted); font: 500 12px var(--mono); letter-spacing: .06em; }
.stack-title::before { content: "// "; color: var(--accent); }
.stack-groups .stack-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

/* ===== Discord presence dot ===== */
.social-discord { position: relative; }
.presence-dot {
position: absolute; right: 1px; bottom: 1px;
width: 12px; height: 12px; border-radius: 50%;
border: 2px solid var(--bg);
background: var(--muted);
opacity: 0; transform: scale(.6);
transition: opacity .3s ease, transform .3s var(--ease), background .3s ease;
}
.social-discord[data-status] .presence-dot { opacity: 1; transform: scale(1); }
.social-discord[data-status="online"] .presence-dot { background: #3ecf6e; animation: gt-pulse 2s infinite; }
.social-discord[data-status="idle"] .presence-dot { background: #f0b232; }
.social-discord[data-status="dnd"] .presence-dot { background: #f23f43; }
.social-discord[data-status="offline"] .presence-dot { background: var(--muted); }

/* Discord presence indicator — desktop and mobile */
a.social-discord {
  position: relative;
  overflow: visible !important;
  flex-shrink: 0;
}

a.social-discord .presence-dot {
  display: block !important;
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid var(--bg);
  border-radius: 50%;
  pointer-events: none;
}

/* Show the dot when Discord reports online */
a.social-discord[data-status="online"] .presence-dot {
  background: #3ecf6e;
  opacity: 1;
  transform: scale(1);
}

/* Portfolio actions and keyboard access */
:root { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; --accent: #147944; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 100000; padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--bg); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.hero-heading .hero-availability { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px; color: var(--soft); font: 11px/1.6 var(--mono); }
.hero-availability > span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.hero-heading { padding-right: 135px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.primary-link, .secondary-link { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border-hot); border-radius: 10px; font-size: 13px; font-weight: 600; transition: transform .2s, background .2s; }
.primary-link { background: var(--text); color: var(--bg); }
.secondary-link { color: var(--text); }
.hero-actions a:hover { transform: translateY(-2px); }
.secondary-link:hover { background: var(--surface); }
.project-featured { background: linear-gradient(120deg, rgba(62,207,110,.055), transparent 75%); }
.featured-badge { color: var(--accent); border-color: var(--accent); }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0; }
.project-tags li { padding: 3px 8px; border-radius: 5px; background: var(--cloud); color: var(--soft); font: 10px/1.7 var(--mono); }
.project-source { align-self: flex-start; display: inline-flex; align-items: center; gap: 14px; min-height: 44px; color: var(--text); font-size: 12px; font-weight: 600; }
.project-source:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-details summary { padding: 8px 0; color: var(--soft); font-size: 12px; cursor: pointer; }
.project-details[open] p { margin-bottom: 8px; }
.project-info { min-width: 0; }
.project p { color: var(--soft); }
.terminal:not(.is-open) { visibility: hidden; }
.github-card.has-error .github-scroll, .github-card.has-error .github-foot { display: none; }
.text-link { color: var(--soft); }
@media (max-width: 720px) {
  .hero-heading { padding-right: 0; }
  .hero { min-height: auto; padding-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.will-reveal { opacity: 1; filter: none; transform: none; }
  body a, body button, body summary { cursor: pointer !important; }
  .weather { display: none; }
}
