:root {
  --bg: #060910;
  --bg-deep: #04070d;
  --navy: #0c1626;
  --ice: #eef3f8;
  --muted: #93a0b3;
  --faint: #6d7b90;
  --steel: #a8b4c4;
  --blue: #7eb6ff;
  --blue-mid: #4d8fdc;
  --glow: rgba(110, 168, 255, 0.28);
  --line: rgba(186, 210, 235, 0.12);
  --line-strong: rgba(200, 220, 240, 0.2);
  --glass: rgba(14, 24, 40, 0.55);
  --max: 1120px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ice);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(46, 92, 160, 0.22), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(18, 48, 86, 0.35), transparent 50%),
    linear-gradient(180deg, #071018 0%, var(--bg) 28%, #05080f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(150, 180, 210, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 180, 210, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: #c5ddff;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ice);
  color: #071018;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.site-header,
.hero,
section,
.page-hero,
.legal,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 16, 0.72);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  display: flex;
  align-items: center;
  min-height: 84px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  color: var(--ice);
}

.brand:hover {
  color: var(--ice);
}

.brand img {
  display: block;
  height: 58px;
  width: auto;
  max-width: min(300px, 70vw);
  background: transparent;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.lang-switch a {
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 6px 8px;
  border-radius: 999px;
}

.lang-switch a:hover,
.lang-switch a[aria-current="true"] {
  color: var(--ice);
}

.lang-switch a[aria-current="true"] {
  background: rgba(126, 182, 255, 0.12);
}

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

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ice);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ice);
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.btn-primary {
  color: #071018;
  background: linear-gradient(180deg, #f4f8ff 0%, #c5dcfa 52%, #9ec4f0 100%);
  box-shadow: 0 0 0 1px rgba(220, 235, 255, 0.35), 0 8px 28px rgba(126, 182, 255, 0.32);
}

.btn-primary:hover {
  color: #061018;
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(200, 225, 255, 0.35), 0 16px 40px rgba(110, 168, 255, 0.38);
}

.btn-ghost {
  color: var(--ice);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  color: var(--ice);
  transform: translateY(-2px);
  border-color: rgba(180, 210, 255, 0.4);
  background: rgba(126, 182, 255, 0.08);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* Hero */
section.hero {
  position: relative;
  display: grid;
  align-items: end;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 72px);
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.hero-slides,
.hero-slide,
.hero-veil {
  position: absolute;
  inset: 0;
}

.hero-slide {
  background-position: center 48%;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-veil {
  background:
    linear-gradient(90deg, rgba(6, 9, 16, 0.84) 0%, rgba(6, 9, 16, 0.45) 46%, rgba(6, 9, 16, 0.2) 100%),
    linear-gradient(180deg, rgba(6, 9, 16, 0.32) 0%, transparent 36%, rgba(6, 9, 16, 0.78) 100%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 48px));
  max-width: 36rem;
  margin-left: max(24px, calc((100vw - var(--max)) / 2));
  padding: 18vh 0 88px;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 6.4vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0 0 22px;
}

.lede {
  margin: 0;
  max-width: 28rem;
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero .lede {
  color: rgba(238, 243, 248, 0.84);
}

.hero .btn-ghost {
  background: rgba(6, 9, 16, 0.32);
  border-color: rgba(238, 243, 248, 0.3);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

.iris {
  margin: 0;
  display: grid;
  place-items: center;
}

.iris img {
  width: min(320px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(110, 168, 255, 0.12);
}

.product-mark {
  margin: 0;
  display: grid;
  place-items: center;
}

.product-mark img {
  width: 88px;
  height: 88px;
  background: transparent;
}

/* Sections */
section {
  padding: 108px 0;
}

.section-head {
  max-width: 36rem;
  margin-bottom: 48px;
}

.section-head h2,
.page-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

/* App cards */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  color: inherit;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.app-card:hover {
  color: inherit;
  transform: translateY(-6px);
  border-color: rgba(150, 190, 240, 0.32);
  box-shadow: 0 18px 50px rgba(8, 20, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-card img:not(.wordmark),
.app-glyph,
.app-card .app-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  border-radius: 16px;
  flex-shrink: 0;
}

.app-card--feature {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  min-height: 0;
}

.app-card--feature .app-logo,
.app-card--feature img:not(.wordmark) {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(8, 20, 40, 0.4);
}

.app-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.app-card--feature h3 {
  font-size: 1.7rem;
}

.app-card .wordmark,
.legal .wordmark {
  display: block;
  width: min(220px, 100%);
  height: auto;
  background: transparent;
}

.legal .wordmark,
.hero-wordmark {
  width: min(280px, 100%);
  margin: 8px 0 16px;
}

.hero-wordmark {
  width: min(320px, 100%);
  margin: 12px 0 20px;
}

.hero-app-icon {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin: 12px 0 20px;
}

.hero-companion-icon {
  width: 128px;
  height: 128px;
  border-radius: 32px;
  box-shadow: 0 18px 50px rgba(8, 20, 40, 0.45);
}

.teslapp-mark,
.app-card .wordmark[src*="teslapp"],
.legal .wordmark[src*="teslapp"],
.product-mark img[src*="teslapp"] {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.page-hero .lede {
  font-size: 1.25rem;
  color: var(--ice);
  margin: 0 0 12px;
}

.flow-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: flow;
}

.flow-line li {
  counter-increment: flow;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ice);
  font-size: 0.92rem;
}

.flow-line li::before {
  content: counter(flow);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(126, 182, 255, 0.16);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
}

.legal .app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 8px 0 0;
}

.app-glyph {
  display: grid;
  place-items: center;
  background: rgba(126, 182, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.app-card .meta {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 22px 0 8px;
}

.app-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.app-card .go {
  margin-top: 22px;
  color: var(--steel);
  font-size: 0.92rem;
}

.app-card:hover .go {
  color: var(--blue);
}

/* Philosophy */
.philosophy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 48px;
}

.philosophy article h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 500;
}

.philosophy p {
  margin: 0;
  color: var(--muted);
}

.about-copy {
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.about-copy p:first-child {
  margin-top: 0;
}

.about-grid .philosophy {
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 36px;
}

/* Inner pages */
.page-hero {
  padding: 72px 0 28px;
}

.legal {
  padding: 24px 0 96px;
  max-width: 740px;
  color: var(--muted);
}

.legal h2 {
  color: var(--ice);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 36px 0 8px;
}

.legal h3 {
  color: var(--ice);
  font-size: 1rem;
  margin: 22px 0 6px;
}

.legal ul {
  padding-left: 1.15rem;
}

.faq details {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  color: var(--ice);
  font-weight: 500;
}

.contact-box {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.contact-box + .contact-box {
  margin-top: 14px;
}

.contact-section {
  padding-top: 12px;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 40px;
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--ice);
  font-size: 0.92rem;
}

.contact-form .optional {
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 8, 14, 0.55);
  color: var(--ice);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.contact-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%), linear-gradient(135deg, var(--steel) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.contact-form .btn {
  justify-self: start;
  margin-top: 4px;
  cursor: pointer;
}

.form-note {
  margin: 0;
  font-size: 0.85rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Screenshots (companion page) */
.device {
  background: #070b12;
  border: 7px solid #1b2433;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.4);
}

.device img {
  display: block;
  width: 100%;
  aspect-ratio: 787 / 1024;
  object-fit: cover;
}

button.device {
  width: 100%;
  padding: 0;
  font: inherit;
  appearance: none;
  cursor: zoom-in;
}

.shots-layout {
  display: grid;
  grid-template-columns: minmax(260px, 400px) 1fr;
  gap: 28px;
}

.shot-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.shot-rail button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.shot-rail button img {
  display: block;
  width: 100%;
  aspect-ratio: 787 / 1024;
  object-fit: cover;
}

.shot-rail button span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 8px;
  color: var(--faint);
}

.shot-rail button[aria-current="true"],
.shot-rail button:hover {
  border-color: rgba(126, 182, 255, 0.5);
}

.shot-caption h3 {
  margin: 12px 0 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  background: rgba(4, 8, 14, 0.9);
  padding: 24px;
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(920px, 100%);
  max-height: 92vh;
  border-radius: 10px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ice);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  color: var(--faint);
  font-size: 0.9rem;
}

.site-footer .inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--ice);
}

.reveal {
  animation: rise 1s var(--ease) both;
}

.reveal-2 {
  animation-delay: 0.1s;
}

.reveal-3 {
  animation-delay: 0.18s;
}

@keyframes rise {
  from {
    opacity: 0.15;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.is-soon {
  pointer-events: none;
  opacity: 0.72;
}

@media (max-width: 900px) {
  .app-card--feature {
    flex-direction: column;
  }

  .hero,
  .app-grid,
  .philosophy,
  .shots-layout,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  section.hero {
    min-height: 78vh;
  }

  .hero-copy {
    margin-left: auto;
    margin-right: auto;
    padding: 12vh 0 64px;
  }

  .iris {
    order: -1;
  }

  .iris img {
    width: 180px;
  }

  .brand img {
    max-width: min(220px, 48vw);
  }

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

  .nav {
    display: none;
    position: absolute;
    top: 84px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    background: rgba(8, 12, 20, 0.96);
    border-bottom: 1px solid var(--line);
  }

  .nav.open {
    display: flex;
  }

  .nav a,
  .nav .btn {
    padding: 12px 0;
  }

  section {
    padding: 80px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
