:root {
  color-scheme: dark;
  --bg: #080b0d;
  --panel: #11181b;
  --panel-strong: #172225;
  --text: #f3f5ef;
  --muted: #aeb9b1;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #d7f36b;
  --accent-ink: #111500;
  --warm: #e3b46e;
  --max: 1120px;
  --header-h: 72px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(8, 11, 13, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  height: var(--header-h);
  justify-content: space-between;
  left: 0;
  padding: 0 clamp(18px, 4vw, 44px);
  position: fixed;
  right: 0;
  top: 0;
  transition:
    background 180ms ease,
    height 180ms ease;
  z-index: 20;
}

.site-header.is-compact {
  background: rgba(8, 11, 13, 0.94);
  height: 60px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 12px;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: var(--accent-ink);
  display: inline-flex;
  font-size: 0.76rem;
  height: 32px;
  justify-content: center;
  letter-spacing: 0;
  width: 32px;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a {
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.hero {
  min-height: 92vh;
  overflow: hidden;
  position: relative;
}

.hero-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(8, 11, 13, 0.92) 0%, rgba(8, 11, 13, 0.72) 38%, rgba(8, 11, 13, 0.16) 78%),
    linear-gradient(0deg, rgba(8, 11, 13, 0.98) 0%, rgba(8, 11, 13, 0) 36%);
  inset: 0;
  position: absolute;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92vh;
  padding: calc(var(--header-h) + 48px) clamp(20px, 6vw, 72px) 96px;
  position: relative;
  width: min(720px, 100%);
  z-index: 1;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(4.6rem, 12vw, 9.4rem);
  line-height: 0.86;
  margin-bottom: 30px;
}

h2 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  margin-bottom: 0;
  max-width: 860px;
}

h3 {
  font-size: 1.28rem;
  margin-bottom: 14px;
}

.hero-copy {
  color: #dce4dc;
  font-size: clamp(1.03rem, 2vw, 1.25rem);
  line-height: 1.72;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.section-pad {
  padding: clamp(72px, 10vw, 132px) clamp(20px, 5vw, 56px);
}

.section-heading,
.intro-grid,
.project-grid,
.tesla-dashboard,
.note-list,
.contact,
.site-footer {
  margin-inline: auto;
  max-width: var(--max);
}

.section-heading {
  margin-bottom: clamp(30px, 5vw, 54px);
}

.intro {
  background: #0b1011;
}

.intro-grid {
  color: var(--muted);
  display: grid;
  font-size: 1.05rem;
  gap: clamp(24px, 5vw, 72px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  line-height: 1.86;
}

.work {
  background: #101615;
}

.project-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 260px;
  padding: 26px;
}

.project-index {
  color: var(--warm);
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  margin-bottom: 48px;
}

.project-card p {
  color: var(--muted);
  line-height: 1.72;
}

.tesla {
  background: #0b1113;
}

.tesla-dashboard {
  background:
    linear-gradient(135deg, rgba(215, 243, 107, 0.12), rgba(255, 255, 255, 0.03) 34%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: 0.8fr 1fr;
  padding: clamp(24px, 4vw, 36px);
}

.tesla-summary {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.tesla-label,
.battery-card p,
.privacy-note {
  color: var(--muted);
}

.tesla-label {
  font-size: 0.86rem;
  margin-bottom: 12px;
}

.tesla-summary strong {
  display: block;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.94;
  text-transform: capitalize;
}

.status-pill {
  background: rgba(215, 243, 107, 0.12);
  border: 1px solid rgba(215, 243, 107, 0.32);
  border-radius: 999px;
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 12px;
}

.battery-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.battery-topline {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.battery-topline span {
  color: var(--muted);
}

.battery-topline strong {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.9;
}

.battery-shell {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  height: 18px;
  margin-bottom: 16px;
  overflow: hidden;
}

.battery-shell span {
  background: linear-gradient(90deg, var(--accent), var(--warm));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 260ms ease;
  width: 0%;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.metric-grid div {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.metric-grid dd {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.privacy-note {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  line-height: 1.72;
  margin: 0;
  padding-top: 20px;
}

.notes {
  background: #080b0d;
}

.note-list {
  border-top: 1px solid var(--line);
}

.note-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 78px;
  padding: 18px 0;
  transition: color 160ms ease;
}

.note-row span {
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.note-row:hover {
  color: var(--accent);
}

.contact {
  align-items: start;
  display: grid;
  gap: clamp(28px, 6vw, 72px);
  grid-template-columns: 0.95fr 1.05fr;
}

.contact-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 36px);
}

.contact-panel p {
  color: var(--muted);
  line-height: 1.75;
}

.contact-link {
  color: var(--accent);
  display: inline-flex;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 850;
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.92rem;
  justify-content: space-between;
  padding: 30px clamp(20px, 5vw, 56px) 42px;
}

@media (max-width: 760px) {
  :root {
    --header-h: 64px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    height: auto;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .site-header.is-compact {
    height: auto;
  }

  .site-nav {
    font-size: 0.86rem;
    gap: 16px;
    overflow-x: auto;
    width: 100%;
  }

  .hero {
    min-height: 96vh;
  }

  .hero-content {
    min-height: 96vh;
    padding-top: 128px;
  }

  h1 {
    font-size: clamp(4rem, 18vw, 6.2rem);
  }

  .intro-grid,
  .project-grid,
  .tesla-dashboard,
  .metric-grid,
  .contact {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 220px;
  }

  .note-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
