/* ==========================================================
  ROBOTICS JOURNEY PORTFOLIO — STYLE B (FIXED)
========================================================== */

:root {
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 60px rgba(0,0,0,.28);

  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);

  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.14);

  --accent: #7dd3fc;
  --accent2: #c4b5fd;
  --accent3: #5eead4;
  --accent-gold: #f6c445;

  --bgTop: rgb(5 6 12);
  --bgMid: rgb(8 26 58);
  --bgBottom: rgb(11 16 48);

  --glow1: .12;
  --glow2: .10;
  --glow3: .08;

  --spaceStrength: 1;
  --skyStrength: 0;
  --seaStrength: 0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  color: var(--text);
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 1400px 900px at 15% 8%, rgba(125, 211, 252, var(--glow1)), transparent 50%),
    radial-gradient(ellipse 1000px 800px at 85% 20%, rgba(196, 181, 253, var(--glow2)), transparent 55%),
    radial-gradient(ellipse 1300px 1000px at 50% 85%, rgba(94, 234, 212, var(--glow3)), transparent 55%),
    linear-gradient(
      180deg,
      var(--bgTop) 0%,
      var(--bgTop) 8%,
      var(--bgMid) 40%,
      var(--bgMid) 60%,
      var(--bgBottom) 92%,
      var(--bgBottom) 100%
    );
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; }

/* ==========================================================
  COMMON UI
========================================================== */

.section {
  position: relative;
  z-index: 1;
  padding: 92px 0;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.3vw, 40px);
  letter-spacing: -0.02em;
}

.subhead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

.glass {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.glass.inset {
  border-radius: var(--radius);
  box-shadow: none;
  padding: 18px;
}

/* ==========================================================
  TOPBAR
========================================================== */

.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: min(1120px, calc(100% - 28px));
  margin: 14px auto 0;
  padding: 12px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  box-shadow: 0 0 18px rgba(125, 211, 252, .55);
}

.brand-text {
  font-weight: 800;
  letter-spacing: .03em;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.burger {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.82);
  border-radius: 2px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 80;
}

.mobile-menu {
  position: fixed;
  top: 14px;
  right: 14px;
  width: min(360px, calc(100% - 28px));
  z-index: 90;
  padding: 14px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  cursor: pointer;
}

.mobile-nav {
  display: grid;
  gap: 8px;
  padding: 6px;
}

.mobile-nav a {
  text-decoration: none;
  font-weight: 800;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
}

/* ==========================================================
  HERO
========================================================== */

.hero {
  padding-top: 120px;
  padding-bottom: 110px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 26px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: .06em;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: -0.03em;
  line-height: 1.0;
}

.hero-tagline {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.accent {
  color: var(--text);
  text-shadow: 0 0 18px rgba(255,255,255,.12);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
  font-weight: 800;
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.10);
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}

.btn.primary {
  border-color: rgba(125, 211, 252, .38);
  background: radial-gradient(circle at 20% 10%, rgba(125, 211, 252, .30), transparent 65%),
              rgba(255,255,255,.08);
}

.btn.ghost {
  background: rgba(0,0,0,.18);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.hero-card {
  padding: 18px;
}

.hero-card-inner {
  display: grid;
  gap: 16px;
}

.avatar-wrap {
  height: 190px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.hero-card-meta {
  display: grid;
  gap: 12px;
}

.meta-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.meta-value {
  margin: 4px 0 0;
  font-weight: 800;
}

.scroll-hint {
  margin-top: 36px;
  display: grid;
  place-items: center;
}

.scroll-dot {
  width: 22px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  position: relative;
}
.scroll-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDot 1.5s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { transform: translate(-50%, 0); opacity: .9; }
  70% { transform: translate(-50%, 12px); opacity: .25; }
  100% { transform: translate(-50%, 0); opacity: .9; }
}

/* ==========================================================
  ABOUT
========================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
  margin-top: 22px;
}

.about-copy {
  padding: 22px;
}

.about-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.mini-card {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  border-radius: var(--radius);
  padding: 14px;
}

.mini-title {
  margin: 0 0 6px;
  font-weight: 900;
}

.mini-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.about-photo {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.photo-frame {
  height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  overflow: hidden;
  position: relative;
}

.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.photo-notes {
  padding: 12px 6px 0;
}

/* ==========================================================
  PROJECTS (FIXED)
========================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.project-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(125,211,252,.35);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
}

.thumb {
  position: relative;
  height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0,0,0,.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  background: rgba(0,0,0,.3);
}

.project-titlebox {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.project-titlebox h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.project-body {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  flex: 1;
}

.project-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.taglist {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.hint {
  margin-top: 16px;
  color: var(--muted);
}

/* ==========================================================
  SKILLS (Context-Based Layout)
========================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.skill-card {
  padding: 20px;
}

.skill-card h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--text);
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.12);
  transition: background 180ms ease, border-color 180ms ease;
}

.skill-item:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(125,211,252,.25);
}

.skill-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

.skill-context {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Optional: Add accent indicator */
.skill-item::before {
  content: "";
  display: none; /* Set to 'block' if you want a colored accent line */
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent3));
  border-radius: 2px;
  position: absolute;
  left: 0;
  top: 0;
}

/* Responsive */
@media (max-width: 980px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .skill-card {
    padding: 16px;
  }

  .skill-item {
    padding: 10px 12px;
  }

  .skill-name {
    font-size: 14px;
  }

  .skill-context {
    font-size: 12px;
  }
}
/* ==========================================================
  EXPERIENCE (Dashed line with dots on top - like reference)
========================================================== */

.timeline {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 50px;
}

/* Dashed vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--accent-gold);
  opacity: 0.6;
}

.timeline-item {
  position: relative;
  padding: 20px;
  margin-bottom: 16px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Dot sitting ON TOP of the dashed line */
.timeline-dot {
  position: absolute;
  left: -50px;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent-gold);
  border: 3px solid rgba(15, 20, 30, 0.9);
  box-shadow: 
    0 0 0 4px rgba(246, 196, 69, 0.25),
    0 0 16px rgba(246, 196, 69, 0.4);
  z-index: 2;
  /* Center the dot on the line */
  transform: translateX(-50%);
  left: -32px;
}

.timeline-content h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}

/* Company/Organization name */
.timeline-org {
  margin: 0 0 4px;
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 15px;
}

.timeline-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  opacity: 0.7;
}

.timeline-content ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  padding-left: 18px;
}

.timeline-content li {
  margin-bottom: 6px;
}

.timeline-content li:last-child {
  margin-bottom: 0;
}

/* ==========================================================
  CONTACT + RESUME
========================================================== */

/* ==========================================================
  FOOTER - Extended for underwater view
========================================================== */

.footer {
  padding-bottom: 250px;
}

.footer-bottom {
  margin-top: 28px;
  margin-bottom: 150px;
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}

.contact-resume {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.contact-resume h3 {
  margin: 0 0 4px;
}

.resume-updated {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.resume-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.resume-btn {
  min-width: 140px;
  justify-content: center;
}

.contact-links {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.icon-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
  font-weight: 900;
}

.icon-link:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.08);
  border-color: rgba(125,211,252,.3);
}

.icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.contact-form {
  grid-column: span 2;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.contact-form h3 {
  margin: 0 0 4px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input, textarea {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}

input:focus, textarea:focus {
  border-color: rgba(125,211,252,.4);
  background: rgba(0,0,0,.25);
}

input::placeholder, textarea::placeholder {
  color: rgba(255,255,255,.35);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.footer-bottom {
  margin-top: 28px;
  text-align: center;
}

.tiny {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.tiny code {
  background: rgba(0,0,0,.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ==========================================================
  PROJECT DETAIL PAGE
========================================================== */

.project-detail {
  padding: 22px;
  margin-top: 22px;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.8vw, 44px);
  letter-spacing: -0.02em;
}

.detail-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

.detail-block {
  margin-top: 24px;
}

.detail-block h4 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.two-col .inset h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--accent);
}

.two-col .inset p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.demo-box {
  height: 220px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255,255,255,.20);
  background: rgba(0,0,0,.16);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  transition: transform 180ms ease, background 180ms ease;
}

.back-link:hover {
  transform: translateX(-3px);
  background: rgba(255,255,255,.06);
}

/* ==========================================================
  ENVIRONMENT LAYER
  - Fixed position background with animated elements
  - Opacity controlled by scroll-driven CSS variables
========================================================== */

.env-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* ==========================================================
  STARS (Space only)
========================================================== */

.stars {
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,.85) 45%, transparent 50%),
    radial-gradient(1px 1px at 25% 70%, rgba(255,255,255,.7) 45%, transparent 50%),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,.65) 45%, transparent 50%),
    radial-gradient(2px 2px at 85% 80%, rgba(255,255,255,.75) 45%, transparent 50%),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,.6) 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 40% 35%, rgba(255,255,255,.72) 45%, transparent 50%),
    radial-gradient(1px 1px at 62% 88%, rgba(255,255,255,.58) 45%, transparent 50%),
    radial-gradient(2px 2px at 92% 15%, rgba(255,255,255,.80) 45%, transparent 50%),
    radial-gradient(1px 1px at 18% 52%, rgba(255,255,255,.65) 45%, transparent 50%),
    radial-gradient(1.5px 1.5px at 78% 62%, rgba(255,255,255,.70) 45%, transparent 50%);
  opacity: calc(0.6 * var(--spaceStrength));
  animation: drift 22s linear infinite;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-2%, 1.5%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ==========================================================
  NEBULA (Subtle glow - always present but fades)
========================================================== */

.nebula {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(600px 400px at 20% 30%, rgba(167, 139, 250, .12), transparent 60%),
    radial-gradient(700px 500px at 80% 20%, rgba(34, 211, 238, .10), transparent 62%),
    radial-gradient(900px 700px at 60% 75%, rgba(94, 234, 212, .08), transparent 66%);
  filter: blur(2px);
  opacity: 0.85;
}

/* ==========================================================
  FLOATERS CONTAINER
========================================================== */

.floaters {
  position: absolute;
  inset: 0;
}

.floater {
  position: absolute;
  width: 120px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  animation: floaty 8s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

/* ==========================================================
  SPACE ASSETS
========================================================== */

/* ----- Satellite ----- */
.sat {
  top: 18%;
  left: 8%;
  width: 130px;
  height: 38px;
  border-radius: 12px;
  opacity: calc(0.45 * var(--spaceStrength));
  animation-delay: 0s;
}

/* ----- Spacecraft ----- */
.craft {
  top: 34%;
  right: 10%;
  width: 160px;
  height: 42px;
  border-radius: 999px;
  opacity: calc(0.45 * var(--spaceStrength));
  animation-delay: -3s;
}

/* ----- Moon ----- */
.moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #e8e8e8 0%,
    #c9c9c9 25%,
    #b0b0b0 50%,
    #969696 75%,
    #787878 100%
  );
  box-shadow:
    inset -15px -10px 30px rgba(0,0,0,.35),
    inset 5px 5px 20px rgba(255,255,255,.15),
    0 0 40px rgba(255,255,255,.12),
    0 0 80px rgba(200,200,220,.08);
  opacity: calc(0.85 * var(--spaceStrength));
  animation: moonFloat 20s ease-in-out infinite;
  z-index: 1;
}

.moon-crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(120,120,120,.4),
    rgba(80,80,80,.6)
  );
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.3);
}

.crater-1 {
  width: 18px;
  height: 18px;
  top: 20%;
  left: 25%;
}

.crater-2 {
  width: 12px;
  height: 12px;
  top: 55%;
  left: 45%;
}

.crater-3 {
  width: 22px;
  height: 22px;
  top: 35%;
  right: 18%;
  opacity: 0.7;
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ----- James Webb Space Telescope ----- */
.jwst {
  position: absolute;
  top: 28%;
  left: 6%;
  width: 100px;
  height: 80px;
  opacity: calc(0.65 * var(--spaceStrength));
  animation: jwstFloat 15s ease-in-out infinite;
  z-index: 1;
}

/* Hexagonal Mirror Array */
.jwst-mirror {
  position: absolute;
  top: 0;
  left: 30px;
  width: 60px;
  height: 52px;
}

.hex {
  position: absolute;
  width: 18px;
  height: 10px;
  background: linear-gradient(
    135deg,
    rgba(255,215,100,.8) 0%,
    rgba(255,180,50,.6) 50%,
    rgba(200,150,50,.7) 100%
  );
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  box-shadow: 0 0 8px rgba(255,200,100,.4);
}

/* Arrange hexagons in honeycomb pattern */
.h1 { top: 0; left: 50%; transform: translateX(-50%); }
.h2 { top: 8px; left: 25%; transform: translateX(-50%); }
.h3 { top: 8px; left: 75%; transform: translateX(-50%); }
.h4 { top: 20px; left: 50%; transform: translateX(-50%); }
.h5 { top: 20px; left: 10%; transform: translateX(-50%); }
.h6 { top: 20px; left: 90%; transform: translateX(-50%); }
.h-center { 
  top: 32px; 
  left: 50%; 
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(100,200,255,.7) 0%,
    rgba(50,150,255,.5) 100%
  );
}

/* Sunshield */
.jwst-shield {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 70px;
  height: 35px;
  background: linear-gradient(
    180deg,
    rgba(180,180,200,.15) 0%,
    rgba(120,120,140,.08) 50%,
    rgba(80,80,100,.05) 100%
  );
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(2px);
}

/* Sunshield structure lines */
.jwst-shield::before,
.jwst-shield::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.1);
}

.jwst-shield::before {
  top: 33%;
  left: 10%;
  right: 10%;
  height: 1px;
}

.jwst-shield::after {
  top: 66%;
  left: 5%;
  right: 5%;
  height: 1px;
}

@keyframes jwstFloat {
  0%, 100% { 
    transform: translateY(0) rotate(-5deg); 
  }
  50% { 
    transform: translateY(-12px) rotate(5deg); 
  }
}

/* ----- Twinkling Stars ----- */
.star-twinkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 6px rgba(255,255,255,.8);
  opacity: calc(0.8 * var(--spaceStrength));
  animation: twinkle 2s ease-in-out infinite;
}

.st-1 { top: 12%; left: 45%; animation-delay: 0s; }
.st-2 { top: 22%; left: 72%; animation-delay: 0.4s; width: 2px; height: 2px; }
.st-3 { top: 8%; left: 28%; animation-delay: 0.8s; }
.st-4 { top: 38%; left: 85%; animation-delay: 1.2s; width: 2px; height: 2px; }
.st-5 { top: 18%; left: 58%; animation-delay: 1.6s; }

@keyframes twinkle {
  0%, 100% { 
    opacity: calc(0.3 * var(--spaceStrength)); 
    transform: scale(1); 
  }
  50% { 
    opacity: calc(1 * var(--spaceStrength)); 
    transform: scale(1.4); 
  }
}

/* ----- Asteroid ----- */
.asteroid {
  position: absolute;
  top: 42%;
  right: 25%;
  width: 25px;
  height: 20px;
  border-radius: 50% 40% 45% 50%;
  background: linear-gradient(
    135deg,
    rgba(139,119,101,.7) 0%,
    rgba(100,85,72,.6) 50%,
    rgba(70,60,50,.5) 100%
  );
  box-shadow: inset -4px -3px 8px rgba(0,0,0,.4);
  opacity: calc(0.5 * var(--spaceStrength));
  animation: asteroidDrift 30s linear infinite;
}

@keyframes asteroidDrift {
  0% { 
    transform: translateX(0) translateY(0) rotate(0deg); 
  }
  100% { 
    transform: translateX(-80px) translateY(20px) rotate(360deg); 
  }
}

/* ==========================================================
  SKY ASSETS
========================================================== */

/* ==========================================================
  QUADCOPTER DRONE (X-Config, Camera Facing Right)
========================================================== */

.quadcopter {
  position: absolute;
  top: 52%;
  left: -120px;
  width: 90px;
  height: 90px;
  opacity: calc(0.7 * var(--skyStrength));
  animation: quadFly 35s linear infinite;
  z-index: 2;
}

/* Central body */
.quad-body {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: linear-gradient(
    135deg,
    rgba(70,70,80,.95) 0%,
    rgba(45,45,55,.9) 100%
  );
  border-radius: 4px;
  box-shadow:
    0 3px 8px rgba(0,0,0,.3),
    inset 0 1px 2px rgba(255,255,255,.15);
  z-index: 5;
}

/* Camera gimbal - facing right */
.quad-camera {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  width: 6px;
  height: 8px;
  background: linear-gradient(
    90deg,
    rgba(50,50,60,.9) 0%,
    rgba(30,30,40,.85) 100%
  );
  border-radius: 2px 3px 3px 2px;
}

/* Camera lens (green dot) */
.quad-camera::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: rgba(100,220,150,.9);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(100,255,150,.7);
}

/* Arm group container */
.quad-arm-group {
  position: absolute;
  inset: 0;
}

/* Arms extending from center in X pattern */
.quad-arm {
  position: absolute;
  width: 30px;
  height: 4px;
  background: linear-gradient(
    90deg,
    rgba(80,80,90,.9) 0%,
    rgba(60,60,70,.85) 100%
  );
  border-radius: 2px;
  top: 50%;
  left: 50%;
  transform-origin: 0% 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* Position arms in X pattern from center */
.arm-fl {
  transform: translate(0, -50%) rotate(-45deg);
}

.arm-fr {
  transform: translate(0, -50%) rotate(45deg);
}

.arm-bl {
  transform: translate(0, -50%) rotate(-135deg);
}

.arm-br {
  transform: translate(0, -50%) rotate(135deg);
}

/* Rotor assemblies at corners */
.quad-rotor {
  position: absolute;
  width: 28px;
  height: 28px;
}

/* Position rotors at corners */
.rotor-fl {
  top: 8px;
  left: 8px;
}

.rotor-fr {
  top: 8px;
  right: 8px;
}

.rotor-bl {
  bottom: 8px;
  left: 8px;
}

.rotor-br {
  bottom: 8px;
  right: 8px;
}

/* Motor housing */
.quad-motor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: linear-gradient(
    135deg,
    rgba(100,100,110,.95) 0%,
    rgba(70,70,80,.9) 100%
  );
  border-radius: 50%;
  box-shadow:
    0 2px 4px rgba(0,0,0,.25),
    inset 0 1px 2px rgba(255,255,255,.1);
  z-index: 2;
}

/* Spinning propeller disc */
.quad-prop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    transparent 20%,
    rgba(200,210,220,.25) 25%,
    rgba(180,190,200,.18) 50%,
    rgba(160,170,180,.12) 70%,
    transparent 75%
  );
  border: 1px solid rgba(255,255,255,.15);
  animation: propSpin 0.08s linear infinite;
  box-shadow: 0 0 12px rgba(255,255,255,.1);
}

/* Alternate spin direction */
.rotor-fr .quad-prop,
.rotor-bl .quad-prop {
  animation-direction: reverse;
}

@keyframes propSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hide landing gear - not visible from top-down view */
.quad-landing,
.quad-leg {
  display: none;
}

/* Flight animation - flies left to right */
@keyframes quadFly {
  0% {
    transform: translateX(0) translateY(0);
  }
  20% {
    transform: translateX(25vw) translateY(-15px);
  }
  40% {
    transform: translateX(50vw) translateY(10px);
  }
  60% {
    transform: translateX(75vw) translateY(-8px);
  }
  80% {
    transform: translateX(95vw) translateY(5px);
  }
  100% {
    transform: translateX(calc(100vw + 150px)) translateY(0);
  }
}

/* ==========================================================
  CLOUDS
========================================================== */

.cloud {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  opacity: calc(0.28 * var(--skyStrength));
  animation: cloudMove 25s linear infinite;
}

.cloud-1 {
  top: 44%;
  left: -15%;
  width: 240px;
  height: 90px;
  animation-duration: 50s;
}

.cloud-2 {
  top: 60%;
  left: -25%;
  width: 300px;
  height: 100px;
  animation-duration: 65s;
  animation-delay: -20s;
}

.cloud-3 {
  top: 52%;
  left: -20%;
  width: 200px;
  height: 70px;
  animation-duration: 55s;
  animation-delay: -35s;
  opacity: calc(0.2 * var(--skyStrength));
}

@keyframes cloudMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 350px)); }
}

/* ==========================================================
  UNDERWATER ASSETS
========================================================== */

/* ==========================================================
  SANDY OCEAN FLOOR - Solid continuous sand across full width
========================================================== */

.ocean-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 250px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(194, 168, 128, 0.15) 15%,
    rgba(186, 160, 120, 0.35) 35%,
    rgba(178, 152, 112, 0.5) 50%,
    rgba(168, 142, 102, 0.65) 65%,
    rgba(158, 132, 92, 0.75) 80%,
    rgba(148, 122, 82, 0.85) 90%,
    rgba(140, 115, 75, 0.9) 100%
  );
  opacity: calc(1 * var(--seaStrength));
  z-index: 1;
}

/* Additional solid sand base layer */
.ocean-floor::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(
    180deg,
    rgba(170, 145, 105, 0.7) 0%,
    rgba(155, 130, 90, 0.85) 50%,
    rgba(140, 115, 75, 0.95) 100%
  );
  z-index: 0;
}

/* Subtle texture overlay */
.ocean-floor::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(ellipse 100px 30px at 10% 90%, rgba(180, 155, 115, 0.3), transparent),
    radial-gradient(ellipse 150px 40px at 30% 85%, rgba(175, 150, 110, 0.25), transparent),
    radial-gradient(ellipse 200px 50px at 55% 92%, rgba(170, 145, 105, 0.3), transparent),
    radial-gradient(ellipse 120px 35px at 75% 88%, rgba(180, 155, 115, 0.25), transparent),
    radial-gradient(ellipse 180px 45px at 90% 95%, rgba(175, 150, 110, 0.3), transparent);
  z-index: 1;
}

/* Sand ripples - subtle lines in the sand */
.sand-ripple {
  position: absolute;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(140, 115, 80, 0.4) 15%,
    rgba(130, 105, 70, 0.5) 50%,
    rgba(140, 115, 80, 0.4) 85%,
    transparent 100%
  );
  border-radius: 50%;
  z-index: 2;
}

.ripple-1 {
  bottom: 60px;
  left: 0;
  width: 35%;
}

.ripple-2 {
  bottom: 90px;
  left: 25%;
  width: 50%;
}

.ripple-3 {
  bottom: 40px;
  right: 0;
  width: 40%;
}

/* Sand mounds - gentle bumps on top of the sand */
.sand-mound {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(
    180deg,
    rgba(175, 150, 110, 0.5) 0%,
    rgba(160, 135, 95, 0.6) 50%,
    rgba(150, 125, 85, 0.7) 100%
  );
  z-index: 2;
}

.mound-1 {
  left: 5%;
  width: 180px;
  height: 40px;
}

.mound-2 {
  left: 40%;
  width: 250px;
  height: 55px;
}

.mound-3 {
  right: 8%;
  width: 200px;
  height: 45px;
}

/* Seaweed */
.seaweed {
  position: absolute;
  bottom: 0;
  width: 12px;
  background: linear-gradient(
    180deg,
    rgba(50, 110, 70, 0.8) 0%,
    rgba(35, 90, 55, 0.9) 100%
  );
  border-radius: 6px 6px 0 0;
  transform-origin: bottom center;
  animation: seaweedSway 4s ease-in-out infinite;
  z-index: 3;
}

.sw-1 {
  left: 8%;
  height: 90px;
  animation-delay: 0s;
}

.sw-2 {
  left: 11%;
  height: 65px;
  width: 8px;
  animation-delay: -1.2s;
}

.sw-3 {
  right: 15%;
  height: 80px;
  animation-delay: -2.5s;
}

@keyframes seaweedSway {
  0%, 100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

/* Rocks */
.rock {
  position: absolute;
  bottom: 0;
  background: linear-gradient(
    145deg,
    rgba(95, 90, 85, 0.8) 0%,
    rgba(75, 70, 65, 0.85) 40%,
    rgba(60, 55, 50, 0.9) 100%
  );
  border-radius: 45% 55% 50% 50% / 55% 50% 50% 45%;
  box-shadow: 
    inset -3px -3px 8px rgba(0,0,0,0.3),
    2px 2px 6px rgba(0,0,0,0.2);
  z-index: 3;
}

.rock-1 {
  left: 20%;
  width: 60px;
  height: 42px;
}

.rock-2 {
  right: 25%;
  width: 48px;
  height: 32px;
}

/* ==========================================================
  LOBSTER - Walking on ocean floor (facing RIGHT)
========================================================== */

.lobster {
  position: absolute;
  bottom: 35px;
  left: -140px;
  width: 120px;
  height: 50px;
  opacity: calc(0.9 * var(--seaStrength));
  animation: lobsterWalk 55s linear infinite;
  z-index: 4;
}

/* Lobster colors */
:root {
  --lobster-dark: rgba(139, 35, 35, 0.95);
  --lobster-mid: rgba(178, 54, 54, 0.92);
  --lobster-light: rgba(205, 75, 75, 0.9);
  --lobster-highlight: rgba(225, 100, 100, 0.85);
}

/* ==========================================================
  ANTENNAE - Extend forward (to the right)
========================================================== */

.lobster-antenna {
  position: absolute;
  right: -15px;
  width: 40px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--lobster-mid) 0%,
    var(--lobster-light) 40%,
    rgba(205, 75, 75, 0.3) 100%
  );
  border-radius: 1px;
  transform-origin: left center;
  animation: antennaWiggle 2s ease-in-out infinite;
}

.antenna-l {
  top: 18px;
  transform: rotate(-15deg);
  animation-delay: 0s;
}

.antenna-r {
  top: 28px;
  transform: rotate(15deg);
  animation-delay: -0.5s;
}

@keyframes antennaWiggle {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(-8deg); }
}

/* ==========================================================
  HEAD - On the right (front)
========================================================== */

.lobster-head {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  height: 24px;
  background: linear-gradient(
    90deg,
    var(--lobster-mid) 0%,
    var(--lobster-light) 50%,
    var(--lobster-highlight) 100%
  );
  border-radius: 30% 50% 50% 30% / 50% 50% 50% 50%;
  box-shadow:
    inset -3px 0 6px rgba(255, 150, 150, 0.3),
    2px 0 6px rgba(0, 0, 0, 0.2);
}

/* Eyes - on the front of head */
.lobster-eye {
  position: absolute;
  right: 4px;
  width: 5px;
  height: 5px;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.eye-l {
  top: 5px;
}

.eye-r {
  bottom: 5px;
}

/* ==========================================================
  BODY SEGMENTS - Small near tail, large near head
========================================================== */

.lobster-body {
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
}

.lobster-segment {
  background: linear-gradient(
    0deg,
    var(--lobster-dark) 0%,
    var(--lobster-mid) 50%,
    var(--lobster-light) 100%
  );
  border-radius: 4px;
  margin-left: -4px;
  box-shadow:
    inset 0 -3px 4px rgba(255, 150, 150, 0.25),
    inset 0 3px 4px rgba(0, 0, 0, 0.2);
}

/* seg-1 is smallest (near tail), seg-3 is largest (near head) */
.seg-1 {
  width: 12px;
  height: 14px;
  z-index: 1;
}

.seg-2 {
  width: 15px;
  height: 17px;
  z-index: 2;
}

.seg-3 {
  width: 18px;
  height: 20px;
  z-index: 3;
}

/* ==========================================================
  TAIL FAN - On the left (back), close to body
========================================================== */

.lobster-tail {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}

.tail-fan {
  background: linear-gradient(
    270deg,
    var(--lobster-mid) 0%,
    var(--lobster-light) 60%,
    rgba(205, 75, 75, 0.5) 100%
  );
  border-radius: 0 3px 3px 0;
  transform-origin: right center;
}

.fan-l {
  width: 18px;
  height: 6px;
  transform: rotate(25deg);
  margin-left: 4px;
}

.fan-c {
  width: 22px;
  height: 8px;
}

.fan-r {
  width: 18px;
  height: 6px;
  transform: rotate(-25deg);
  margin-left: 4px;
}

/* ==========================================================
  CLAWS - Arms connected to pincers
========================================================== */

.lobster-claw {
  position: absolute;
  right: 25px;
}

.claw-l {
  top: 2px;
}

.claw-r {
  bottom: 2px;
}

.claw-arm {
  width: 22px;
  height: 6px;
  background: linear-gradient(
    180deg,
    var(--lobster-light) 0%,
    var(--lobster-mid) 100%
  );
  border-radius: 3px;
}

/* Angle claws outward to go around the head */
.claw-l .claw-arm {
  transform: rotate(-35deg);
  transform-origin: left center;
}

.claw-r .claw-arm {
  transform: rotate(35deg);
  transform-origin: left center;
}

.claw-pincer {
  position: absolute;
  width: 28px;
  height: 18px;
}

/* Position pincers at the END of the angled arms */
.claw-l .claw-pincer {
  right: -22px;
  top: -12px;
  transform: rotate(-25deg);
}

.claw-r .claw-pincer {
  right: -22px;
  bottom: -12px;
  transform: rotate(25deg);
}

.pincer-top,
.pincer-bottom {
  position: absolute;
  right: 0;
  width: 20px;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--lobster-mid) 0%,
    var(--lobster-light) 50%,
    var(--lobster-highlight) 100%
  );
  border-radius: 3px 8px 8px 3px;
  transform-origin: left center;
}

.pincer-top {
  top: 2px;
  animation: clawSnap 3s ease-in-out infinite;
}

.pincer-bottom {
  bottom: 2px;
  animation: clawSnapReverse 3s ease-in-out infinite;
}

.claw-r .pincer-top {
  animation-delay: -1.5s;
}

.claw-r .pincer-bottom {
  animation-delay: -1.5s;
}

@keyframes clawSnap {
  0%, 70%, 100% {
    transform: rotate(-3deg);
  }
  80%, 90% {
    transform: rotate(-12deg);
  }
}

@keyframes clawSnapReverse {
  0%, 70%, 100% {
    transform: rotate(3deg);
  }
  80%, 90% {
    transform: rotate(12deg);
  }
}

/* ==========================================================
  LEGS - At the bottom, beneath the body
========================================================== */

.lobster-legs {
  position: absolute;
  left: 42px;
  bottom: -2px;
  width: 40px;
  height: 16px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
}

.lobster-leg {
  width: 3px;
  height: 14px;
  background: linear-gradient(
    180deg,
    var(--lobster-mid) 0%,
    var(--lobster-dark) 100%
  );
  border-radius: 2px;
  transform-origin: top center;
  animation: legWalk 0.5s ease-in-out infinite;
}

.leg-1 {
  animation-delay: 0s;
}

.leg-2 {
  animation-delay: -0.125s;
}

.leg-3 {
  animation-delay: -0.25s;
}

.leg-4 {
  animation-delay: -0.375s;
}

@keyframes legWalk {
  0%, 100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

/* ==========================================================
  WALKING ANIMATION - Left to right
========================================================== */

@keyframes lobsterWalk {
  0% {
    transform: translateX(0) translateY(0);
  }
  20% {
    transform: translateX(25vw) translateY(-3px);
  }
  40% {
    transform: translateX(50vw) translateY(2px);
  }
  60% {
    transform: translateX(70vw) translateY(-2px);
  }
  80% {
    transform: translateX(90vw) translateY(1px);
  }
  100% {
    transform: translateX(calc(100vw + 160px)) translateY(0);
  }
}

/* ==========================================================
  AUTONOMOUS UNDERWATER VEHICLE (AUV)
  - Facing RIGHT, swimming LEFT to RIGHT
========================================================== */

.auv {
  position: absolute;
  bottom: 22%;
  left: -200px;
  width: 160px;
  height: 50px;
  opacity: calc(0.9 * var(--seaStrength));
  animation: auvSwim 45s linear infinite;
  z-index: 3;
}

/* Main cylindrical hull */
.auv-hull {
  position: absolute;
  top: 50%;
  left: 30px;
  transform: translateY(-50%);
  width: 100px;
  height: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 200, 50, 0.95) 0%,
    rgba(240, 180, 40, 0.9) 30%,
    rgba(220, 160, 30, 0.85) 70%,
    rgba(200, 140, 20, 0.9) 100%
  );
  border-radius: 14px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 8px rgba(255, 255, 255, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.15);
}

/* Nose cone - NOW ON THE RIGHT (front of AUV) */
.auv-nose {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 20px;
  height: 24px;
  background: linear-gradient(
    180deg,
    rgba(60, 60, 70, 0.95) 0%,
    rgba(45, 45, 55, 0.9) 50%,
    rgba(35, 35, 45, 0.95) 100%
  );
  border-radius: 20% 50% 50% 20% / 30% 50% 50% 30%;
  box-shadow:
    2px 0 6px rgba(0, 0, 0, 0.2),
    inset -2px 0 4px rgba(255, 255, 255, 0.1);
}

/* Sensor dome on nose - NOW ON THE RIGHT */
.auv-sensor {
  position: absolute;
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
  width: 10px;
  height: 14px;
  background: linear-gradient(
    270deg,
    rgba(100, 150, 180, 0.8) 0%,
    rgba(80, 130, 160, 0.7) 100%
  );
  border-radius: 50%;
  box-shadow:
    inset -2px 0 4px rgba(150, 200, 230, 0.5),
    0 0 8px rgba(100, 180, 220, 0.3);
}

/* Hull panels/stripes */
.auv-panel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 3px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.panel-1 {
  left: 25px;
}

.panel-2 {
  left: 55px;
}

/* Tail section - NOW ON THE LEFT (back of AUV) */
.auv-tail {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 35px;
  height: 22px;
  background: linear-gradient(
    180deg,
    rgba(80, 80, 90, 0.95) 0%,
    rgba(60, 60, 70, 0.9) 50%,
    rgba(50, 50, 60, 0.95) 100%
  );
  border-radius: 10px 4px 4px 10px;
  box-shadow:
    -2px 0 6px rgba(0, 0, 0, 0.2),
    inset 2px 0 4px rgba(255, 255, 255, 0.1);
}

/* Propeller - NOW ON THE LEFT (back) */
.auv-propeller {
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  width: 8px;
  height: 20px;
  background: linear-gradient(
    180deg,
    rgba(150, 150, 160, 0.9) 0%,
    rgba(120, 120, 130, 0.85) 50%,
    rgba(150, 150, 160, 0.9) 100%
  );
  border-radius: 2px;
  animation: propellerSpin 0.1s linear infinite;
}

@keyframes propellerSpin {
  0% {
    transform: translateY(-50%) scaleY(1);
  }
  25% {
    transform: translateY(-50%) scaleY(0.3);
  }
  50% {
    transform: translateY(-50%) scaleY(1);
  }
  75% {
    transform: translateY(-50%) scaleY(0.3);
  }
  100% {
    transform: translateY(-50%) scaleY(1);
  }
}

/* Fins */
.auv-fin {
  position: absolute;
  background: linear-gradient(
    90deg,
    rgba(220, 160, 30, 0.9) 0%,
    rgba(200, 140, 20, 0.85) 100%
  );
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Front fins (now on right side) */
.fin-top {
  top: 3px;
  right: 25px;
  width: 20px;
  height: 6px;
  border-radius: 2px 4px 4px 2px;
  transform: rotate(15deg);
}

.fin-bottom {
  bottom: 3px;
  right: 25px;
  width: 20px;
  height: 6px;
  border-radius: 2px 4px 4px 2px;
  transform: rotate(-15deg);
}

/* Rear fins (now on left side) */
.fin-rear-top {
  top: 6px;
  left: 15px;
  width: 16px;
  height: 5px;
  background: linear-gradient(
    90deg,
    rgba(80, 80, 90, 0.9) 0%,
    rgba(60, 60, 70, 0.85) 100%
  );
  border-radius: 3px 2px 2px 3px;
  transform: rotate(20deg);
}

.fin-rear-bottom {
  bottom: 6px;
  left: 15px;
  width: 16px;
  height: 5px;
  background: linear-gradient(
    90deg,
    rgba(80, 80, 90, 0.9) 0%,
    rgba(60, 60, 70, 0.85) 100%
  );
  border-radius: 3px 2px 2px 3px;
  transform: rotate(-20deg);
}

/* Lights on hull */
.auv-light {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(100, 255, 150, 0.9);
  box-shadow:
    0 0 8px rgba(100, 255, 150, 0.8),
    0 0 16px rgba(100, 255, 150, 0.5);
  animation: lightBlink 2s ease-in-out infinite;
}

.light-1 {
  top: 50%;
  right: 35px;
  transform: translateY(-50%);
}

.light-2 {
  top: 50%;
  right: 50px;
  transform: translateY(-50%);
  animation-delay: -1s;
}

@keyframes lightBlink {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 8px rgba(100, 255, 150, 0.8),
      0 0 16px rgba(100, 255, 150, 0.5);
  }
  50% {
    opacity: 0.5;
    box-shadow:
      0 0 4px rgba(100, 255, 150, 0.5),
      0 0 8px rgba(100, 255, 150, 0.3);
  }
}

/* AUV swimming animation - left to right */
@keyframes auvSwim {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  15% {
    transform: translateX(20vw) translateY(-25px) rotate(-3deg);
  }
  30% {
    transform: translateX(40vw) translateY(20px) rotate(2deg);
  }
  50% {
    transform: translateX(60vw) translateY(-15px) rotate(-2deg);
  }
  70% {
    transform: translateX(80vw) translateY(25px) rotate(3deg);
  }
  85% {
    transform: translateX(95vw) translateY(-10px) rotate(-1deg);
  }
  100% {
    transform: translateX(calc(100vw + 220px)) translateY(0) rotate(0deg);
  }
}

/* ==========================================================
  BUBBLES
========================================================== */

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255,255,255,.25),
    rgba(255,255,255,.05)
  );
  opacity: calc(0.6 * var(--seaStrength));
  animation: bubbleRise 8s ease-in infinite;
}

.b1 {
  width: 20px;
  height: 20px;
  left: 16%;
  bottom: -25px;
  animation-duration: 8s;
}

.b2 {
  width: 14px;
  height: 14px;
  left: 72%;
  bottom: -25px;
  animation-duration: 10s;
  animation-delay: -2s;
}

.b3 {
  width: 24px;
  height: 24px;
  left: 45%;
  bottom: -25px;
  animation-duration: 11s;
  animation-delay: -4s;
}

.b4 {
  width: 12px;
  height: 12px;
  left: 85%;
  bottom: -25px;
  animation-duration: 9s;
  animation-delay: -1s;
}

.b5 {
  width: 16px;
  height: 16px;
  left: 30%;
  bottom: -25px;
  animation-duration: 12s;
  animation-delay: -6s;
}

.b6 {
  width: 10px;
  height: 10px;
  left: 60%;
  bottom: -25px;
  animation-duration: 8.5s;
  animation-delay: -3s;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: calc(0.6 * var(--seaStrength));
  }
  50% {
    transform: translateY(-50vh) translateX(10px) scale(0.9);
  }
  80% {
    opacity: calc(0.3 * var(--seaStrength));
  }
  100% {
    transform: translateY(-100vh) translateX(-5px) scale(0.5);
    opacity: 0;
  }
}

/* ==========================================================
  SMALL FISH - Swimming forward (facing direction of travel)
========================================================== */

.fish {
  position: absolute;
  width: 25px;
  height: 12px;
  opacity: calc(0.7 * var(--seaStrength));
}

/* Fish body - pointing RIGHT by default */
.fish::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 0;
  width: 18px;
  height: 12px;
  background: linear-gradient(
    180deg,
    rgba(150, 180, 210, 0.85) 0%,
    rgba(120, 150, 180, 0.8) 50%,
    rgba(100, 130, 160, 0.85) 100%
  );
  border-radius: 50% 40% 40% 50% / 50% 50% 50% 50%;
}

/* Fish tail - on the LEFT (back) */
.fish::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: rgba(130, 160, 190, 0.75);
  clip-path: polygon(100% 50%, 0 0, 0 100%);
}

/* Fish eye */
.fish-1::before,
.fish-2::before,
.fish-3::before {
  box-shadow: inset -4px 2px 0 1px rgba(30, 30, 40, 0.6);
}

.fish-1 {
  bottom: 30%;
  animation: fishSwimRight 28s linear infinite;
}

.fish-2 {
  bottom: 38%;
  animation: fishSwimRight 35s linear infinite;
  animation-delay: -12s;
  transform: scale(0.75);
}

.fish-3 {
  bottom: 25%;
  animation: fishSwimRight 24s linear infinite;
  animation-delay: -20s;
  transform: scale(1.15);
}

/* Fish swimming left to right */
@keyframes fishSwimRight {
  0% {
    left: -40px;
    transform: translateY(0) scaleX(1);
  }
  25% {
    transform: translateY(-15px) scaleX(1);
  }
  50% {
    transform: translateY(10px) scaleX(1);
  }
  75% {
    transform: translateY(-8px) scaleX(1);
  }
  100% {
    left: calc(100% + 40px);
    transform: translateY(0) scaleX(1);
  }
}

/* ==========================================================
  SPACE ELEMENTS: Moon & James Webb Space Telescope
========================================================== */

/* ===== MOON ===== */
.moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #e8e8e8 0%,
    #c9c9c9 25%,
    #b0b0b0 50%,
    #969696 75%,
    #787878 100%
  );
  box-shadow:
    inset -15px -10px 30px rgba(0,0,0,.35),
    inset 5px 5px 20px rgba(255,255,255,.15),
    0 0 40px rgba(255,255,255,.12),
    0 0 80px rgba(200,200,220,.08);
  opacity: calc(0.85 * var(--spaceStrength));
  animation: moonFloat 20s ease-in-out infinite;
  z-index: 1;
}

.moon-crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(120,120,120,.4),
    rgba(80,80,80,.6)
  );
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.3);
}

.crater-1 {
  width: 18px;
  height: 18px;
  top: 20%;
  left: 25%;
}

.crater-2 {
  width: 12px;
  height: 12px;
  top: 55%;
  left: 45%;
}

.crater-3 {
  width: 22px;
  height: 22px;
  top: 35%;
  right: 18%;
  opacity: 0.7;
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ===== JAMES WEBB SPACE TELESCOPE ===== */
.jwst {
  position: absolute;
  top: 28%;
  left: 6%;
  width: 100px;
  height: 80px;
  opacity: calc(0.65 * var(--spaceStrength));
  animation: jwstFloat 15s ease-in-out infinite;
  z-index: 1;
}

/* Hexagonal Mirror Array */
.jwst-mirror {
  position: absolute;
  top: 0;
  left: 30px;
  width: 60px;
  height: 52px;
}

.hex {
  position: absolute;
  width: 18px;
  height: 10px;
  background: linear-gradient(
    135deg,
    rgba(255,215,100,.8) 0%,
    rgba(255,180,50,.6) 50%,
    rgba(200,150,50,.7) 100%
  );
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  box-shadow: 0 0 8px rgba(255,200,100,.4);
}

/* Arrange hexagons in honeycomb pattern */
.h1 { top: 0; left: 50%; transform: translateX(-50%); }
.h2 { top: 8px; left: 25%; transform: translateX(-50%); }
.h3 { top: 8px; left: 75%; transform: translateX(-50%); }
.h4 { top: 20px; left: 50%; transform: translateX(-50%); }
.h5 { top: 20px; left: 10%; transform: translateX(-50%); }
.h6 { top: 20px; left: 90%; transform: translateX(-50%); }
.h-center { 
  top: 32px; 
  left: 50%; 
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(100,200,255,.7) 0%,
    rgba(50,150,255,.5) 100%
  );
}

/* Sunshield */
.jwst-shield {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 70px;
  height: 35px;
  background: linear-gradient(
    180deg,
    rgba(180,180,200,.15) 0%,
    rgba(120,120,140,.08) 50%,
    rgba(80,80,100,.05) 100%
  );
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(2px);
}

/* Add some structure lines to sunshield */
.jwst-shield::before,
.jwst-shield::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.1);
}

.jwst-shield::before {
  top: 33%;
  left: 10%;
  right: 10%;
  height: 1px;
}

.jwst-shield::after {
  top: 66%;
  left: 5%;
  right: 5%;
  height: 1px;
}

@keyframes jwstFloat {
  0%, 100% { 
    transform: translateY(0) rotate(-5deg); 
  }
  50% { 
    transform: translateY(-12px) rotate(5deg); 
  }
}

/* ===== ADDITIONAL SPACE OBJECTS ===== */

/* Small distant stars (twinkling) */
.star-twinkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  opacity: calc(0.8 * var(--spaceStrength));
  animation: twinkle 2s ease-in-out infinite;
}

.star-twinkle:nth-child(1) { top: 15%; left: 45%; animation-delay: 0s; }
.star-twinkle:nth-child(2) { top: 25%; left: 70%; animation-delay: 0.5s; }
.star-twinkle:nth-child(3) { top: 10%; left: 30%; animation-delay: 1s; }

@keyframes twinkle {
  0%, 100% { opacity: calc(0.3 * var(--spaceStrength)); transform: scale(1); }
  50% { opacity: calc(1 * var(--spaceStrength)); transform: scale(1.3); }
}

/* Distant planet/asteroid */
.asteroid {
  position: absolute;
  top: 42%;
  right: 25%;
  width: 25px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(139,119,101,.7) 0%,
    rgba(100,85,72,.6) 50%,
    rgba(70,60,50,.5) 100%
  );
  box-shadow: inset -4px -3px 8px rgba(0,0,0,.4);
  opacity: calc(0.5 * var(--spaceStrength));
  animation: asteroidDrift 25s linear infinite;
}

@keyframes asteroidDrift {
  0% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(-50px) rotate(360deg); }
}

/* ==========================================================
  PROJECT DETAIL - Image Container Fix
========================================================== */

.project-detail .demo-box {
  position: relative;
  overflow: hidden;
  display: block;
}

.project-detail .demo-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Ensure the detail blocks have proper spacing */
.detail-block {
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.project-detail .detail-header {
  position: relative;
  z-index: 1;
}

.project-detail .two-col {
  position: relative;
  z-index: 1;
}

.project-detail .detail-actions {
  position: relative;
  z-index: 1;
}

/* ==========================================================
  REVEAL ANIMATIONS
========================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for items in a group */
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }

/* ==========================================================
  RESPONSIVE
========================================================== */

@media (max-width: 980px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .contact-form {
    grid-column: span 1;
  }

  .two-col,
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .timeline {
    padding-left: 40px;
  }

  .timeline::before {
    left: 14px;
  }

  .timeline-dot {
    left: -26px;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 70px 0;
  }

  .hero {
    padding-top: 100px;
    padding-bottom: 80px;
  }

  .topbar {
    top: 10px;
    padding: 10px 12px;
  }

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

  .hero-title {
    font-size: clamp(36px, 10vw, 52px);
  }

  .detail-title {
    font-size: clamp(24px, 6vw, 36px);
  }

  .thumb {
    height: 180px;
  }

  .timeline {
    padding-left: 34px;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-dot {
    left: -24px;
    width: 14px;
    height: 14px;
  }

  .timeline-item {
    padding: 16px;
  }

  .contact-links {
    gap: 10px;
  }

  .icon-link {
    padding: 12px 14px;
  }

  .resume-actions {
    flex-direction: column;
  }

  .resume-btn {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .container {
    width: calc(100% - 24px);
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-badges {
    justify-content: center;
  }

  .project-titlebox {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px 10px;
  }

  .project-titlebox h3 {
    font-size: 14px;
  }
}

/* ==========================================================
  PRINT STYLES (optional)
========================================================== */

@media print {
  .env-layer,
  .topbar,
  .scroll-hint,
  .burger,
  .mobile-menu,
  .scrim {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .glass {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    box-shadow: none !important;
  }

  .section {
    padding: 30px 0;
  }
}