:root {
  color-scheme: dark;
  --background: #0f1419;
  --background-alt: #1a1f2e;
  --foreground: #ffffff;
  --foreground-muted: #c5ccd3;
  --surface: #1a1f2e;
  --surface2: #232a3a;
  --border: #3c4043;
  --accent: #4285f4;
  --accent2: #22d3ee;
  --focus-ring: #22d3ee;
  --touch-target-min: 44px;
}

[data-theme='light'] {
  color-scheme: light;
  --background: #f8fafc;
  --background-alt: #ffffff;
  --foreground: #0f172a;
  --foreground-muted: #475569;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #cbd5e1;
  --accent: #1a73e8;
  --accent2: #0e7490;
  --focus-ring: #0e7490;
}

[data-theme='dark'] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --background: #f8fafc;
    --background-alt: #ffffff;
    --foreground: #0f172a;
    --foreground-muted: #475569;
    --surface: #ffffff;
    --surface2: #f1f5f9;
    --border: #cbd5e1;
    --accent: #1a73e8;
    --accent2: #0e7490;
    --focus-ring: #0e7490;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: color-mix(in srgb, var(--background) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

.site-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--foreground);
  text-decoration: none;
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--foreground);
  cursor: pointer;
  font-family: inherit;
}

.site-nav-toggle-bars {
  display: block;
  position: relative;
  width: 1.25rem;
  height: 2px;
  background: var(--foreground);
  box-shadow: 0 -6px 0 var(--foreground), 0 6px 0 var(--foreground);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.site-header--nav-open .site-nav-toggle-bars {
  background: transparent;
  box-shadow: none;
}

.site-header--nav-open .site-nav-toggle-bars::before,
.site-header--nav-open .site-nav-toggle-bars::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.25rem;
  height: 2px;
  margin-left: -0.625rem;
  margin-top: -1px;
  background: var(--foreground);
  border-radius: 1px;
}

.site-header--nav-open .site-nav-toggle-bars::before {
  transform: rotate(45deg);
}

.site-header--nav-open .site-nav-toggle-bars::after {
  transform: rotate(-45deg);
}

.site-nav-backdrop {
  display: none;
}

.site-nav-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.site-nav a {
  color: var(--foreground-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  min-height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: var(--foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-field label {
  font-size: 0.8125rem;
  color: var(--foreground-muted);
}

.theme-select {
  min-height: var(--touch-target-min);
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa0a6' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.theme-select:hover {
  border-color: var(--accent2);
}

.theme-select:focus {
  outline: none;
}

.theme-select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hero {
  padding: 3rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--foreground-muted);
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0 1.5rem;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

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

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent2);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-screenshot {
  max-width: 56rem;
  margin: 0 auto;
}

.hero-screenshot img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--foreground) 8%, transparent);
}

section.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.tab {
  min-height: var(--touch-target-min);
  padding: 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.9375rem;
  cursor: pointer;
  font-family: inherit;
}

.tab[aria-selected='true'] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-panel {
  display: none;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.tab-panel.is-active {
  display: block;
}

.tab-panel p {
  margin: 0 0 1rem;
  color: var(--foreground-muted);
}

.tab-panel p:last-child {
  margin-bottom: 0;
}

.tab-panel ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--foreground-muted);
}

.tab-panel li {
  margin-bottom: 0.5rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.download-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.download-card h3 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

.download-card p {
  font-size: 0.875rem;
  color: var(--foreground-muted);
  margin: 0 0 1rem;
}

.download-card .btn {
  width: 100%;
}

.accordion {
  max-width: 44rem;
  margin: 0 auto;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--surface);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--touch-target-min);
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.accordion-trigger:hover {
  background: var(--surface2);
}

.accordion-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
}

.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  background: var(--foreground-muted);
  transition: transform 0.2s ease;
}

.accordion-icon::before {
  width: 10px;
  height: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.accordion-icon::after {
  width: 2px;
  height: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.accordion-trigger[aria-expanded='true'] .accordion-icon::after {
  transform: translate(-50%, -50%) scaleY(0);
}

.accordion-panel {
  padding: 0 1.25rem 1.25rem;
  color: var(--foreground-muted);
  display: none;
}

.accordion-panel.is-open {
  display: block;
}

.accordion-panel p {
  margin: 0 0 0.75rem;
}

.accordion-panel p:last-child {
  margin-bottom: 0;
}

.footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--foreground-muted);
}

.footer p {
  margin: 0.5rem 0;
}

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

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

/* Mac first-open: high-visibility + terminal-style visuals */
.mac-install-highlight {
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 16px;
  border: 2px solid var(--accent2);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent2) 12%, var(--surface)) 0%,
    var(--surface) 45%,
    color-mix(in srgb, #f59e0b 8%, var(--surface)) 100%
  );
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--foreground) 6%, transparent),
    0 12px 40px color-mix(in srgb, var(--accent) 15%, transparent);
  scroll-margin-top: 5rem;
}

.mac-install-highlight--after-downloads {
  margin-top: 2.5rem;
}

.mac-install-eyebrow {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 6px;
}

.mac-install-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  margin: 0 0 0.65rem;
  line-height: 1.25;
  color: var(--foreground);
}

.mac-install-intro {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--foreground);
  max-width: 38rem;
}

.mac-install-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.mac-install-step {
  margin: 0;
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.mac-step-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent2);
}

.mac-step-text {
  margin: 0 0 1rem;
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.55;
}

.mac-step-text kbd {
  display: inline-block;
  margin: 0 0.1em;
  padding: 0.15em 0.45em;
  font-size: 0.8em;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 600;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 0 var(--border);
}

.terminal-shot {
  margin: 0;
  max-width: 32rem;
}

.terminal-window {
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  text-align: left;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #5c5c5c 0%, #464646 100%);
  border-bottom: 1px solid #333;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.terminal-dot--red {
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}
.terminal-dot--yellow {
  background: #febc2e;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}
.terminal-dot--green {
  background: #28c840;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: #d4d4d4;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  padding-right: 52px;
}

.terminal-body {
  padding: 1rem 1.125rem 1.125rem;
  min-height: 5rem;
  background: #0d1117;
  font-family: ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #c9d1d9;
}

.terminal-body--finder {
  min-height: auto;
  background: #e8eaed;
  color: #202124;
  padding: 0.75rem 1rem 1rem;
}

.finder-row {
  font-size: 0.75rem;
  color: #5f6368;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 0.65rem;
}

.finder-app-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.finder-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #4285f4, #1a53c0);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.terminal-lines {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-meta {
  display: block;
  color: #8b949e;
  margin-bottom: 0.35rem;
}

.terminal-prompt {
  color: #7ee787;
  font-weight: 600;
  user-select: none;
}

.terminal-cmd {
  color: #ffa657;
  font-weight: 600;
  font-size: 0.9375rem;
}

.terminal-window--command .terminal-cmd {
  color: #79c0ff;
}

.terminal-cursor {
  display: inline-block;
  width: 0.5ch;
  margin-left: 1px;
  background: #7ee787;
  animation: terminal-blink 1s step-end infinite;
}

.terminal-cursor--dim {
  background: #484f58;
  animation: none;
}

@keyframes terminal-blink {
  50% {
    opacity: 0;
  }
}

.mac-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.btn-copy-terminal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent2);
  color: #0f172a;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent2) 45%, transparent);
}

.btn-copy-terminal:hover {
  filter: brightness(1.08);
}

.btn-copy-terminal:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.mac-copy-feedback {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent2);
  min-height: 1.25em;
}

.mac-install-alt {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--foreground-muted);
}

@media (max-width: 767px) {
  .site-nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .site-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: color-mix(in srgb, var(--foreground) 35%, transparent);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .site-header--nav-open .site-nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .site-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 160;
    width: min(100% - 2.5rem, 20rem);
    max-height: min(100vh, 100dvh);
    margin: 0;
    padding: calc(4.25rem + env(safe-area-inset-top, 0px)) 1.25rem
      calc(1.5rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1.5rem;
    background: var(--background-alt);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px color-mix(in srgb, var(--foreground) 12%, transparent);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    pointer-events: none;
    visibility: hidden;
  }

  .site-header--nav-open .site-nav-panel {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .site-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.25rem;
  }

  .site-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .theme-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .theme-select {
    width: 100%;
    max-width: 100%;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 2rem;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .tab {
    flex-shrink: 0;
  }

  section.section {
    padding: 2rem 0;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .terminal-shot,
  .terminal-window {
    max-width: 100%;
  }

  .terminal-lines {
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
  }

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

@media (prefers-reduced-motion: reduce) {
  .site-nav-panel,
  .site-nav-backdrop,
  .site-nav-toggle-bars {
    transition: none;
  }
}

@media (max-width: 480px) {
  .mac-install-highlight {
    padding: 1.25rem 1rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 12px;
  }

  .btn-copy-terminal {
    width: 100%;
    justify-content: center;
  }
}
