/* ---------- Design tokens ---------- */
:root {
  --bg: #12100c;
  --bg-elevated: #1a1611;
  --bg-card: #1f1a14;
  --border: #2e2620;
  --border-hover: #3d332a;
  --text: #f5efe6;
  --text-muted: #b5a693;
  --text-faint: #7d6f60;
  --accent: #f0a24f;
  --accent-strong: #d9822c;
  --accent-soft: rgba(240, 162, 79, 0.14);
  --secondary: #e2734f;
  --radius: 14px;
  --max-width: 1120px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6f0;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #ece2d4;
    --border-hover: #ddccb6;
    --text: #241b10;
    --text-muted: #6b5a48;
    --text-faint: #9c8a76;
    --accent: #c2670a;
    --accent-strong: #a35509;
    --accent-soft: rgba(194, 103, 10, 0.1);
    --secondary: #c65a3a;
    --shadow: 0 20px 60px -20px rgba(30, 22, 12, 0.15);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 80%);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #3a1d02;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px var(--accent-soft);
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
  min-height: 80vh;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 30%, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-credentials {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

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

.tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-elevated);
}

/* Portrait */
.hero-visual {
  display: flex;
  justify-content: center;
}

.portrait-frame {
  width: min(100%, 380px);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
  position: relative;
  transform: perspective(1000px) rotateY(-4deg);
  transition: transform 0.4s ease;
}

.portrait-frame:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

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

/* ---------- Sections ---------- */
.section { padding: 100px 24px; }

.section-head { max-width: 640px; margin-bottom: 56px; }

.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

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

/* About cards */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.card-link:hover {
  border-color: var(--border-hover);
}

.card-media {
  height: 260px;
  margin: -32px -32px 24px -32px;
  border-bottom: 1px solid var(--border);
}

.card-photo .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
  display: block;
}

.card-media-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.card-media-logo img {
  max-width: 88%;
  max-height: 100%;
  object-fit: contain;
}

.card-media-dark { background: #05060a; }

.card-media-light {
  background: #ffffff;
}

.card h3 { font-size: 1.2rem; margin-bottom: 12px; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 0.98rem; }

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.video-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.video-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.video-card:hover .video-thumb img { transform: scale(1.06); }

.video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55));
  z-index: 1;
}

.play-icon {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.video-card:hover .play-icon { transform: scale(1.1); }

.video-card h3 {
  font-size: 1.05rem;
  padding: 20px 20px 8px;
  font-weight: 700;
}

.video-card p {
  padding: 0 20px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.content-cta { text-align: center; }

/* OrbitGeo panel */
.orbit-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px;
}

.orbit-text h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; margin-bottom: 18px; letter-spacing: -0.02em; }
.orbit-text p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 28px; max-width: 50ch; }

.orbit-visual {
  position: relative;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  border: 1px solid var(--border-hover);
  border-radius: 50%;
  animation: spin linear infinite;
}

.ring-1 { width: 100%; height: 100%; animation-duration: 40s; border-top-color: var(--accent); }
.ring-2 { width: 70%; height: 70%; animation-duration: 28s; animation-direction: reverse; border-right-color: var(--secondary); }
.ring-3 { width: 42%; height: 42%; animation-duration: 18s; border-bottom-color: var(--accent); }

.orbit-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px 6px var(--accent-soft);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Research drone visual */
.drone-visual {
  position: relative;
  height: 260px;
  border-radius: 18px;
  overflow: hidden;
  background-color: var(--bg-elevated);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 26px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drone-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, var(--accent-soft) 45%, transparent);
  animation: drone-scan-sweep 5s ease-in-out infinite;
}

@keyframes drone-scan-sweep {
  0% { transform: translateY(-120%); }
  50% { transform: translateY(160%); }
  100% { transform: translateY(-120%); }
}

.drone {
  position: relative;
  z-index: 2;
  animation: drone-hover 3.2s ease-in-out infinite;
}

@keyframes drone-hover {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
}

.drone-arm { stroke: var(--text-faint); }
.drone-body { fill: var(--accent); }

.drone-prop {
  fill: none;
  stroke: var(--secondary);
  transform-box: fill-box;
  transform-origin: center;
  animation: drone-prop-blur 0.35s linear infinite;
}

.prop-2, .prop-3 { animation-delay: 0.12s; }
.prop-4 { animation-delay: 0.24s; }

@keyframes drone-prop-blur {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 0.5; }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.contact-card:hover .contact-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-icon svg { width: 20px; height: 20px; }

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.contact-value {
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.88rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; text-align: left; }
  .hero-visual { order: -1; }
  .terminal { transform: none; }
  .about-grid, .video-grid { grid-template-columns: 1fr 1fr; }
  .orbit-panel { grid-template-columns: 1fr; padding: 36px; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .about-grid, .video-grid, .contact-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 20px; }
  .hero { padding-bottom: 64px; }
}
