/*
 * Git Identity Manager — website
 * Palette, radii, and surfaces are lifted from the app's own design tokens
 * (src/app.css). Dark is the base; light is applied for a light OS preference,
 * exactly as the app does it.
 */

:root {
  --canvas: #0b0a10;
  --canvas-raised: #110f18;
  --surface: rgba(32, 28, 44, 0.55);
  --surface-solid: #191622;
  --surface-sunken: rgba(11, 10, 16, 0.45);
  --edge: rgba(167, 139, 250, 0.13);
  --edge-strong: rgba(167, 139, 250, 0.22);
  --edge-hover: rgba(167, 139, 250, 0.34);

  --fg-strong: #f4f2fa;
  --fg: #cfcada;
  --fg-muted: #9c94ad;
  --fg-subtle: #746c85;

  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-strong: #8b5cf6;
  --accent-text: #baa4fb;
  --on-accent: #0b0a10;
  --accent-soft: rgba(167, 139, 250, 0.12);

  --positive: #6ee7b7;
  --positive-soft: rgba(52, 211, 153, 0.1);
  --positive-edge: rgba(52, 211, 153, 0.22);
  --warning: #fde68a;
  --warning-soft: rgba(251, 191, 36, 0.1);
  --warning-edge: rgba(251, 191, 36, 0.24);
  --danger: #fecdd3;

  --glow: rgba(144, 80, 248, 0.5);

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1120px;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --canvas: #faf9fd;
    --canvas-raised: #ffffff;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-sunken: #f4f2fb;
    --edge: rgba(76, 40, 130, 0.14);
    --edge-strong: rgba(76, 40, 130, 0.22);
    --edge-hover: rgba(76, 40, 130, 0.34);

    --fg-strong: #1c1726;
    --fg: #2c2738;
    --fg-muted: #5b5470;
    --fg-subtle: #7c7591;

    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-strong: #7c3aed;
    --accent-text: #6d28d9;
    --on-accent: #ffffff;
    --accent-soft: rgba(124, 58, 237, 0.1);

    --positive: #047857;
    --positive-soft: rgba(5, 150, 105, 0.1);
    --positive-edge: rgba(5, 150, 105, 0.25);
    --warning: #b45309;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --warning-edge: rgba(217, 119, 6, 0.28);
    --danger: #b91c1c;

    --glow: rgba(124, 58, 237, 0.28);
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  overflow-x: hidden;
}

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

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

h1,
h2,
h3 {
  color: var(--fg-strong);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--fg-strong);
  background: var(--accent-soft);
  padding: 0.1em 0.36em;
  border-radius: 5px;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 3px;
}

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

.eyebrow {
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 14px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  border-bottom: 1px solid var(--edge);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  color: var(--fg-strong);
}

.brand img {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 0 10px var(--glow));
}

.brand span {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__inner .brand {
  min-width: 0;
}

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

.site-nav a:not(.button) {
  color: var(--fg-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.site-nav a:not(.button):hover {
  color: var(--fg-strong);
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
  white-space: nowrap;
}

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

.button--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.button--ghost {
  border-color: var(--edge-strong);
  background: var(--surface);
  color: var(--fg);
}

.button--ghost:hover {
  border-color: var(--edge-hover);
  color: var(--fg-strong);
}

.button svg {
  width: 16px;
  height: 16px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 108px) 0 clamp(64px, 10vw, 120px);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -260px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-58%);
  background: radial-gradient(
    circle,
    var(--glow) 0%,
    rgba(64, 40, 176, 0.12) 42%,
    transparent 70%
  );
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  max-width: 15ch;
}

.hero__lede {
  margin: 22px 0 0;
  font-size: 1.08rem;
  color: var(--fg-muted);
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.hero__note {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--fg-subtle);
}

/* ---------- app window mock ---------- */

.window {
  position: relative;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius);
  background: var(--canvas-raised);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.reveal {
  animation: window-in 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--edge);
  background: var(--surface-sunken);
}

.window__lights {
  display: flex;
  gap: 7px;
}

.window__lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--edge-strong);
}

.window__title {
  font-size: 0.8rem;
  color: var(--fg-subtle);
  font-weight: 500;
}

.window__body {
  position: relative;
  padding: 22px;
}

.window__graph {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  color: var(--accent);
}

.idcard {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 18px;
}

.idcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.idcard__repo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--fg-strong);
  font-size: 0.95rem;
}

.idcard__repo svg {
  width: 16px;
  height: 16px;
  color: var(--fg-subtle);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--edge-strong);
  color: var(--fg-muted);
}

.badge--warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-edge);
}

.badge--positive {
  color: var(--positive);
  background: var(--positive-soft);
  border-color: var(--positive-edge);
}

.badge--accent {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: var(--edge-strong);
}

.idcard__meta {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.idcard__rows {
  margin-top: 12px;
  border-top: 1px solid var(--edge);
}

.idcard__row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge);
  font-size: 0.82rem;
}

.idcard__row .k {
  font-family: var(--font-mono);
  color: var(--fg-subtle);
  font-size: 0.78rem;
}

.idcard__row .v {
  font-family: var(--font-mono);
  color: var(--fg-strong);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idcard__row .scope {
  font-size: 0.68rem;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.diff {
  margin-top: 16px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.diff__label {
  padding: 7px 12px;
  background: var(--surface-sunken);
  color: var(--fg-subtle);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--edge);
}

.diff__line {
  padding: 5px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff__line--del {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.07);
}

.diff__line--add {
  color: var(--positive);
  background: var(--positive-soft);
}

.idcard__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.idcard__actions .button {
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(56px, 9vw, 104px) 0;
  border-top: 1px solid var(--edge);
}

.section__head {
  max-width: 52ch;
  margin-bottom: 48px;
}

.section__head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.section__head p {
  margin: 16px 0 0;
  color: var(--fg-muted);
  font-size: 1.02rem;
}

/* Two-column head: heading left, supporting sentence right. */
.section__head--split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 56px;
  align-items: end;
}

.section__head--split p {
  margin: 0;
  padding-bottom: 4px;
}

/* feature grid */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.feature {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
  transition: border-color 0.16s ease;
}

.feature:hover {
  border-color: var(--edge-hover);
}

.feature__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--edge-strong);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature__icon svg {
  width: 20px;
  height: 20px;
}

.feature h3 {
  font-size: 1.06rem;
}

.feature p {
  margin: 9px 0 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

/* how it works — commit graph timeline, with the resolved state alongside */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.how__after {
  position: sticky;
  top: 96px;
}

.how__after > p {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--fg-subtle);
}

.idcard--resolved {
  border-color: var(--positive-edge);
}

.idcard__verify {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--positive);
}

.idcard__verify svg {
  width: 15px;
  height: 15px;
}

.steps {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 34px;
}

.steps::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--accent-strong), var(--edge));
}

.step {
  position: relative;
  padding: 16px 0 24px;
}

.step::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--canvas);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.step h3 {
  font-size: 1.05rem;
}

.step p {
  margin: 7px 0 0;
  color: var(--fg-muted);
  font-size: 0.94rem;
  max-width: 60ch;
}

/* privacy panel */

.privacy {
  border: 1px solid var(--positive-edge);
  border-radius: var(--radius);
  background: var(--positive-soft);
  padding: clamp(28px, 4vw, 44px);
}

.privacy h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.privacy p {
  color: var(--fg-muted);
  margin: 14px 0 0;
  max-width: 60ch;
}

.privacy ul {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.privacy li {
  position: relative;
  padding-left: 26px;
  font-size: 0.92rem;
  color: var(--fg);
}

.privacy li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid var(--positive);
}

/* download */

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

.dl {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
}

.dl__os {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  color: var(--fg-strong);
  font-size: 1.02rem;
}

.dl__os svg {
  width: 22px;
  height: 22px;
  color: var(--fg-muted);
}

.dl__primary {
  margin-top: 18px;
}

.dl__primary .button {
  width: 100%;
}

.dl__alt {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.84rem;
}

.dl__alt span {
  color: var(--fg-subtle);
}

.dl__hint {
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.8rem;
  color: var(--fg-subtle);
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.release-meta__note {
  font-size: 0.86rem;
  color: var(--fg-subtle);
}

.callout {
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--warning-edge);
  background: var(--warning-soft);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--fg);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--edge);
  padding: 48px 0;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
}

.site-footer__brand {
  max-width: 34ch;
}

.site-footer__brand p {
  margin: 12px 0 0;
  font-size: 0.86rem;
  color: var(--fg-subtle);
}

.site-footer__links {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px 48px;
  align-items: start;
}

.site-footer__links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.site-footer__links a {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.site-footer__links a:hover {
  color: var(--fg-strong);
}

/* ---------- changelog ---------- */

.log {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) 24px;
}

.log__intro {
  margin-bottom: 48px;
}

.log__intro h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.log__intro p {
  margin: 16px 0 0;
  color: var(--fg-muted);
}

.release {
  border-top: 1px solid var(--edge);
  padding: 36px 0;
}

.release:last-child {
  border-bottom: 1px solid var(--edge);
}

.release__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}

.release__version {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
}

.release__date {
  font-size: 0.88rem;
  color: var(--fg-subtle);
}

.release__group {
  margin-top: 20px;
}

.release__group h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}

.release__group h3::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
}

.release__group--added h3::before {
  background: var(--positive);
}
.release__group--changed h3::before {
  background: var(--accent);
}
.release__group--fixed h3::before {
  background: var(--warning);
}
.release__group--removed h3::before {
  background: var(--danger);
}

.release__group ul {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.release__group li {
  font-size: 0.94rem;
  color: var(--fg);
  line-height: 1.55;
}

.release__group li strong {
  color: var(--fg-strong);
  font-weight: 600;
}

.log__loading {
  color: var(--fg-subtle);
  font-size: 0.92rem;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__grid > * {
    min-width: 0;
  }
  .hero h1 {
    max-width: 20ch;
  }
  .features,
  .downloads,
  .privacy ul {
    grid-template-columns: minmax(0, 1fr);
  }
  .section__head--split,
  .how {
    grid-template-columns: minmax(0, 1fr);
  }
  .how__after {
    position: static;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header__inner {
    gap: 14px;
  }
  .site-nav {
    gap: 14px;
    flex-shrink: 0;
  }
  .site-nav .nav-hide {
    display: none;
  }
  .site-footer__links {
    grid-template-columns: repeat(2, auto);
  }
  .idcard__row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .idcard__row .scope {
    display: none;
  }
}
