/* ===== VARIABLES ===== */
:root {
  --bg: #fafbfe;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555770;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-subtle: rgba(37, 99, 235, 0.08);
  --accent: #1d4ed8;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(37, 99, 235, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.2s ease;
  --home-bg: #d6e0eb;
  --home-text: #1f2a36;
  --home-nav: rgba(31, 42, 54, 0.84);
  --home-nav-hover-text: #111a24;
  --home-nav-hover-bg: rgba(31, 42, 54, 0.11);
  --home-nav-active-bg: rgba(31, 42, 54, 0.16);
  --home-nav-border: rgba(31, 42, 54, 0.16);
  --home-nav-active-border: rgba(31, 42, 54, 0.26);
  --home-top-border: rgba(31, 42, 54, 0.24);
  --home-grad-1: rgba(255, 255, 255, 0.46);
  --home-grad-2: rgba(181, 209, 233, 0.27);
  --home-grad-3: rgba(152, 184, 212, 0.2);
  --home-grad-4a: rgba(185, 204, 224, 0.26);
  --home-grad-4b: rgba(165, 188, 212, 0.22);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-subtle: rgba(59, 130, 246, 0.12);
  --accent: #93bbfd;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(59, 130, 246, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --home-bg: #2a2f36;
  --home-text: #eef3f8;
  --home-nav: rgba(236, 243, 250, 0.84);
  --home-nav-hover-text: #ffffff;
  --home-nav-hover-bg: rgba(255, 255, 255, 0.12);
  --home-nav-active-bg: rgba(255, 255, 255, 0.16);
  --home-nav-border: rgba(255, 255, 255, 0.08);
  --home-nav-active-border: rgba(255, 255, 255, 0.24);
  --home-top-border: rgba(255, 255, 255, 0.14);
  --home-grad-1: rgba(255, 255, 255, 0.09);
  --home-grad-2: rgba(200, 230, 255, 0.06);
  --home-grad-3: rgba(180, 220, 255, 0.04);
  --home-grad-4a: rgba(30, 35, 42, 0.4);
  --home-grad-4b: rgba(35, 41, 49, 0.34);
}

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

html { scroll-behavior: smooth; }

html,
body {
  cursor: auto;
}

a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
summary,
.hero-icosa,
.cta,
.theme-fab {
  cursor: pointer;
}

body {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", "Source Code Pro", Consolas, "Courier New", monospace;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

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

body.modal-open {
  overflow: hidden;
}

/* ===== HOME LAYOUT ===== */
.home {
  background: var(--home-bg);
  overflow: hidden;
  color: var(--home-text);
}

body.inner-page {
  overflow: auto;
}


.inner-content {
  width: min(720px, 92%);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.home .eyebrow,
.home .hero-line,
.home #typewriter,
.home .divider {
  color: var(--home-text);
}

.home .nav-links a {
  color: var(--home-nav);
  border-color: var(--home-nav-border);
}

.home .nav-links a:hover {
  color: var(--home-nav-hover-text);
  background: var(--home-nav-hover-bg);
}

.home .nav-links a[aria-current="page"] {
  color: var(--home-nav-hover-text);
  background: var(--home-nav-active-bg);
  border-color: var(--home-nav-active-border);
}

.bg-canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#pixelCanvas,
.bg-gradient {
  position: absolute;
  inset: 0;
}

#pixelCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.bg-gradient {
  background: radial-gradient(circle at 18% 20%, var(--home-grad-1), transparent 46%),
              radial-gradient(circle at 80% 22%, var(--home-grad-2), transparent 45%),
              radial-gradient(circle at 55% 78%, var(--home-grad-3), transparent 42%),
              linear-gradient(150deg, var(--home-grad-4a), var(--home-grad-4b));
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--home-top-border);
}

.top-name {
  color: var(--home-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.nav-menu-toggle:hover {
  border-color: var(--home-nav-active-border);
  background: var(--home-nav-hover-bg);
  color: var(--home-nav-hover-text);
  transform: translateY(-1px);
}

.topbar.menu-open .nav-menu-toggle {
  border-color: var(--home-nav-active-border);
  background: var(--home-nav-active-bg);
  color: var(--home-nav-hover-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.nav-links a[aria-current="page"] {
  color: var(--primary);
  border-color: var(--border-hover);
  background: var(--primary-subtle);
}

.nav-links a:hover {
  color: var(--text);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.hero-full {
  flex: 1 1 auto;
  min-height: clamp(420px, calc(100svh - 170px), 760px);
  padding: clamp(1.1rem, 4vh, 2.5rem) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.hero-icosa {
  position: relative;
  width: clamp(128px, 17vw, 192px);
  height: clamp(128px, 17vw, 192px);
  display: grid;
  place-items: center;
  overflow: visible;
  touch-action: none;
  cursor: auto;
  margin-top: -3.15rem;
  margin-bottom: 4rem;
}

.hero-icosa canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 164%;
  height: 164%;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.hero-icosa img {
  display: block;
  width: 120%;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.hero-icosa:hover canvas {
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
}

.hero-icosa::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 10px;
  border: 2px solid rgba(255, 236, 190, 0.3);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.hero-icosa.rippling::after {
  animation: rippleGlow 0.7s ease-out;
}

.hero-icosa.pulse {
  animation: icosaPulse 0.65s ease;
}

.eyebrow {
  text-transform: none;
  letter-spacing: 0.1em;
  font-size: 0.88rem;
  color: var(--muted);
}

.text-glass {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}

.text-glass-eyebrow {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.hero-line {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: clamp(1.02rem, 2.8vw, 1.62rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: none;
}

.text-glass-hero {
  padding: 0.44rem 0.92rem;
  border-radius: 12px;
  max-width: min(96vw, 860px);
}

.hero-name {
  white-space: nowrap;
}

.type-line {
  font-size: clamp(0.9rem, 2.4vw, 1.2rem);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.2rem;
}

.divider {
  color: var(--primary);
  font-weight: 400;
}

#typewriter {
  min-width: 9ch;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  font-size: 0.86em;
}

.cta-row {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-links .cta {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  min-height: 36px;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.resume-embed iframe {
  width: 100%;
  height: 680px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.resume-mobile-note {
  display: none;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .resume-embed {
    display: none;
  }

  .resume-mobile-note {
    display: block;
  }
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.16);
}

.cta.primary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.cta.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.16);
}

.cal-modal[hidden] { display: none; }

.cal-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 6, 20, 0.55);
  backdrop-filter: blur(6px);
}

.cal-modal-panel {
  position: relative;
  width: min(960px, 94vw);
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeUp 0.32s ease forwards;
}

.cal-modal.open {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .cal-modal-panel {
  background: rgba(15, 23, 42, 0.7);
}

.cal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cal-modal h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text);
}

.cal-close {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.42rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}

.cal-close:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

#cal-embed {
  min-height: 620px;
  border-radius: 12px;
  overflow: visible;
  flex: 1 0 auto;
}

#cal-embed iframe {
  width: 100%;
  min-height: inherit;
  border: 0;
}

.cal-status {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.78;
  color: var(--muted);
}

.cal-status.error {
  color: #fca5a5;
}

/* ===== LAYOUT ===== */
.container {
  width: min(720px, 90%);
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title:hover {
  color: var(--primary);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

nav a:hover {
  color: var(--text);
  background: var(--primary-subtle);
}

nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-subtle);
  font-weight: 600;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 2.5rem 0 2rem;
  margin-bottom: 0.5rem;
}

.profile-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.full-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.profile-role {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
}

.hero-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
}

.hero-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.hero-text a:hover {
  text-decoration: underline;
}

/* ===== STATUS LINE ===== */
.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.status-text {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== SECTION HEADINGS ===== */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ===== CARD GRID ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.projects-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(4px);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

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

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card p,
.card li {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.card ul {
  padding-left: 1.1rem;
  list-style: none;
}

.card ul li {
  position: relative;
  padding-left: 0.25rem;
}

.card ul li::before {
  content: "›";
  position: absolute;
  left: -1rem;
  color: var(--primary);
  font-weight: 700;
}

/* Linked cards */
a.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link .card {
  cursor: pointer;
}

.card-arrow {
  display: inline-block;
  color: var(--primary);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  font-weight: 600;
  transition: transform var(--transition);
}

.card:hover .card-arrow {
  transform: translateX(4px);
}

/* ===== ABOUT PAGE ===== */
.about-content {
  margin-bottom: 2rem;
}

.about-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* ===== SKILLS LIST ===== */
.skill-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.skill-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

/* ===== RESUME BUTTON ===== */
.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--primary);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  margin-top: 0.75rem;
  transition: background var(--transition), transform var(--transition);
}

.resume-link:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.resume-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
  margin-bottom: 2rem;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  transition: color var(--transition);
}

.contact-list a:hover {
  color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-size: 0.8rem;
  color: var(--muted);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ===== THEME TOGGLE ===== */
.theme-fab {
  position: fixed;
  right: calc(1.1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.theme-fab:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

@media (hover: none) {
  .hero-icosa:hover canvas {
    filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
  }

  .cta:hover,
  .nav-links a:hover,
  .nav-menu-toggle:hover,
  .theme-fab:hover,
  .cal-close:hover {
    transform: none;
  }
}

/* ===== FADE IN ANIMATION ===== */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.07s; }
.fade-in:nth-child(3) { animation-delay: 0.14s; }
.fade-in:nth-child(4) { animation-delay: 0.21s; }
.fade-in:nth-child(5) { animation-delay: 0.28s; }

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

@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes orbFlash {
  0% { transform: scale(1) translate(0); box-shadow: 0 0 28px rgba(124,255,178,0.9), 0 0 80px rgba(59,179,255,0.7); }
  35% { transform: scale(1.08) translate(2px, -2px) rotate(-1deg); box-shadow: 0 0 40px rgba(124,255,178,1), 0 0 110px rgba(59,179,255,0.85); }
  65% { transform: scale(0.98) translate(-2px, 2px) rotate(1deg); }
  100% { transform: scale(1) translate(0); }
}

@keyframes icosaSpin {
  from { transform: rotateY(0deg) rotateX(14deg); }
  to { transform: rotateY(360deg) rotateX(14deg); }
}

@keyframes icosaPulse {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 24px rgba(124,255,178,0.7)); }
  45% { transform: scale(1.06) rotate(2deg); filter: drop-shadow(0 0 40px rgba(124,255,178,0.9)) drop-shadow(0 0 70px rgba(59,179,255,0.7)); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes rippleGlow {
  0% { opacity: 0.65; transform: scale(0.65); border-color: rgba(124,255,178,0.6); }
  70% { opacity: 0.3; transform: scale(1.25); border-color: rgba(59,179,255,0.35); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .home .page-shell {
    width: min(760px, 94%);
    padding-top: calc(1.1rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.8rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-full {
    min-height: calc(100svh - 160px);
    padding: 1.4rem 0;
    gap: 0.5rem;
  }

  .hero-icosa {
    width: clamp(116px, 24vw, 166px);
    height: clamp(116px, 24vw, 166px);
    margin-top: -2.35rem;
    margin-bottom: 2.15rem;
  }

  .hero-line {
    font-size: clamp(0.95rem, 4.2vw, 1.34rem);
    font-weight: 700;
    gap: 0.45rem;
  }

  #typewriter {
    font-weight: 700;
  }

  .eyebrow {
    font-weight: 700;
  }

  .text-glass-hero {
    padding: 0.38rem 0.78rem;
  }

  .cta-row {
    width: min(430px, 100%);
    gap: 0.6rem;
  }

  .cta {
    padding: 0.62rem 1rem;
    font-weight: 700;
  }

  .cal-modal-panel {
    width: min(96vw, 760px);
    max-height: 92svh;
  }

  #cal-embed {
    min-height: min(84svh, 700px);
  }
}

@media (max-width: 640px) {
  .container { width: 92%; }

  header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem 0 1.25rem;
  }

  nav { justify-content: center; }

  .hero { padding: 1.5rem 0 1.25rem; }

  .profile-wrap {
    flex-direction: column;
    text-align: center;
  }

  .profile-info { align-items: center; }

  .hero-heading {
    text-align: center;
  }

  .hero-text {
    text-align: center;
  }

  .status-line {
    justify-content: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .home .page-shell {
    width: 94%;
    padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    min-height: 100svh;
  }

  .topbar {
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.45rem 0 0.75rem;
    position: relative;
  }

  .top-name {
    font-size: 0.88rem;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.42rem);
    right: 0;
    left: auto;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.32rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transition: opacity var(--transition), transform var(--transition);
    z-index: 8;
  }

  .topbar.menu-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 0.52rem 1.1rem;
    min-height: 40px;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    color: var(--text);
  }

  .hero-full {
    min-height: calc(100svh - 132px);
    padding: 1rem 0 0.9rem;
    gap: 0.5rem;
  }

  .hero-icosa {
    width: clamp(102px, 32vw, 136px);
    height: clamp(102px, 32vw, 136px);
    margin-top: -1.8rem;
    margin-bottom: 1.7rem;
  }

  .hero-line {
    font-size: clamp(0.88rem, 5.5vw, 1.16rem);
    font-weight: 700;
    gap: 0.32rem;
    line-height: 1.2;
  }

  .eyebrow {
    font-weight: 700;
  }

  .text-glass-eyebrow {
    padding: 0.17rem 0.6rem;
  }

  .text-glass-hero {
    padding: 0.3rem 0.64rem;
    border-radius: 10px;
  }

  #typewriter {
    min-width: 7.5ch;
    font-size: 0.84em;
  }

  .cta-row {
    margin-top: 1rem;
    width: min(360px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .cta {
    width: 100%;
    padding: 0.58rem 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 42px;
  }

  .theme-fab {
    width: 40px;
    height: 40px;
    right: calc(0.75rem + env(safe-area-inset-right, 0px));
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .cal-modal {
    align-items: end;
    place-items: stretch;
    overflow-y: auto;
  }

  .cal-modal-panel {
    width: 100vw;
    max-height: none;
    min-height: 100svh;
    border-radius: 16px 16px 0 0;
    padding: 0.9rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
  }

  .cal-modal h2 {
    font-size: 1rem;
  }

  #cal-embed {
    min-height: max(720px, calc(100svh - 92px));
    border-radius: 10px;
    overflow: visible;
  }

  .type-line {
    flex-direction: column;
    gap: 0.2rem;
  }
}
