/*
 * Rewind Desktop visual system
 * Canonical guidance lives in docs/WEBSITE_DESIGN_SYSTEM.md.
 * This file intentionally loads after styles-new.css and remaps legacy pages.
 */

:root {
  --ds-paper: #f5f1e8;
  --ds-paper-raised: #fffdf8;
  --ds-paper-muted: #e9e2d7;
  --ds-ink: #191713;
  --ds-ink-soft: #514b43;
  --ds-muted: #746d63;
  --ds-line: rgba(35, 31, 25, .18);
  --ds-line-strong: rgba(35, 31, 25, .38);
  --ds-signal: #e54740;
  --ds-dark: #090909;
  --ds-dark-raised: #141414;
  --ds-yellow: #f3d34f;
  --ds-violet: #695cff;
  --ds-aqua: #67cfc3;
  --ds-max: 1180px;
  --ds-gutter: clamp(18px, 3.5vw, 56px);
  --ds-display: clamp(3.1rem, 7vw, 6.8rem);
  --ds-section: clamp(72px, 9vw, 132px);

  --primary: var(--ds-signal);
  --primary-dark: #c63833;
  --primary-light: #f16860;
  --primary-subtle: #f8ded8;
  --bg: var(--ds-paper);
  --bg-subtle: #eee8de;
  --bg-muted: #e5ddd1;
  --bg-card: var(--ds-paper-raised);
  --text: var(--ds-ink);
  --text-secondary: var(--ds-ink-soft);
  --text-muted: var(--ds-muted);
  --text-light: #958d82;
  --border: var(--ds-line);
  --border-light: rgba(35, 31, 25, .1);
  --gradient: linear-gradient(135deg, var(--ds-signal), #ff7b59);
  --gradient-subtle: linear-gradient(135deg, #f8e8dc, #eee8de);
  --shadow-sm: 0 1px 0 rgba(25, 23, 19, .08);
  --shadow: 0 12px 32px rgba(52, 42, 27, .08);
  --shadow-md: 0 20px 45px rgba(52, 42, 27, .12);
  --shadow-lg: 0 30px 70px rgba(52, 42, 27, .16);
  --shadow-xl: 0 40px 100px rgba(25, 23, 19, .22);
  --container-max: var(--ds-max);
  --section-padding: var(--ds-section) var(--ds-gutter);
}

html {
  background: var(--ds-paper);
}

body {
  background:
    radial-gradient(circle at 86% 4%, rgba(105, 92, 255, .045), transparent 28rem),
    var(--ds-paper);
  color: var(--ds-ink);
  letter-spacing: -.008em;
}

::selection {
  background: var(--ds-signal);
  color: white;
}

.system-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

.system-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

/* Navigation */

body .site-nav {
  position: relative;
  z-index: 60;
  width: 100%;
  max-width: none;
  min-height: 72px;
  padding: 0 var(--ds-gutter);
  border-bottom: 1px solid var(--ds-line);
  background: rgba(245, 241, 232, .92);
  backdrop-filter: blur(18px);
}

body .site-nav .nav-logo {
  gap: 10px;
  color: var(--ds-ink);
  font-size: .86rem;
  font-weight: 700;
}

.nav-wordmark {
  letter-spacing: -.02em;
}

.nav-edition {
  padding-left: 10px;
  border-left: 1px solid var(--ds-line-strong);
  color: var(--ds-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .55rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body .site-nav .nav-links {
  gap: clamp(13px, 2vw, 26px);
}

body .site-nav .nav-links a {
  color: var(--ds-muted);
  font-size: .72rem;
  font-weight: 650;
}

body .site-nav .nav-links a:hover {
  color: var(--ds-ink);
}

.nav-sign-in {
  padding-left: 18px;
  border-left: 1px solid var(--ds-line);
}

/* Buttons */

body .btn {
  min-height: 44px;
  border-radius: 0;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: -.005em;
}

body .btn-primary {
  border: 1px solid var(--ds-ink);
  background: var(--ds-ink);
  color: var(--ds-paper) !important;
  box-shadow: none;
}

body .btn-primary:hover {
  border-color: var(--ds-signal);
  background: var(--ds-signal);
  color: white !important;
  box-shadow: none;
  transform: translateY(-2px);
}

body .btn-secondary {
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ds-ink);
}

body .btn-secondary:hover {
  border-color: var(--ds-ink);
  background: var(--ds-paper-raised);
}

/* Marketing homepage */

body > .hero,
body main > .hero {
  max-width: 980px;
  padding: clamp(66px, 8vw, 112px) var(--ds-gutter) 36px;
}

body .hero-badge {
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body .hero h1 {
  font-size: clamp(3.2rem, 7vw, 6.25rem);
  font-weight: 620;
  letter-spacing: -.068em;
  line-height: .93;
}

body .hero-subtitle {
  max-width: 690px;
  margin-right: auto;
  margin-left: auto;
  color: var(--ds-ink-soft);
  font-size: clamp(1.03rem, 1.6vw, 1.25rem);
}

body .hero-demo-container {
  width: min(1120px, calc(100vw - 2 * var(--ds-gutter)));
  max-width: none;
  padding: 0;
}

body .hero-demo-container .mini-rewind-demo {
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  box-shadow: 0 34px 80px rgba(25, 23, 19, .2);
  animation: none;
}

body .social-proof {
  border-top: 1px solid var(--ds-line);
  border-bottom: 1px solid var(--ds-line);
  background: transparent;
}

body .value-props {
  gap: 0;
  max-width: var(--ds-max);
  border: 1px solid var(--ds-line);
}

body .value-prop {
  padding: clamp(28px, 4vw, 54px);
  border-right: 1px solid var(--ds-line);
  border-radius: 0;
  background: var(--ds-paper-raised);
  box-shadow: none;
}

body .value-prop:last-child {
  border-right: 0;
}

body .use-cases,
body .features,
body .how-it-works {
  background: transparent;
}

body .use-case {
  gap: clamp(32px, 6vw, 88px);
  padding-top: 54px;
  padding-bottom: 54px;
  border-top: 1px solid var(--ds-line);
}

body .use-case-badge,
body .section-badge {
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body .feature-grid {
  gap: 0;
  border: 1px solid var(--ds-line);
}

body .feature-card {
  border-width: 0 1px 1px 0;
  border-color: var(--ds-line);
  border-radius: 0;
  background: var(--ds-paper-raised);
  box-shadow: none;
}

/* Login */

body .login-page,
body .dashboard-page,
body .download-page-body,
body .success-page,
body .callback-page {
  background:
    linear-gradient(90deg, transparent 0 49.95%, rgba(35, 31, 25, .05) 50%, transparent 50.05%),
    var(--ds-paper);
}

body .login-container {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
  align-items: stretch;
  width: min(var(--ds-max), calc(100% - 2 * var(--ds-gutter)));
  max-width: none;
  margin: 0 auto;
  padding: clamp(54px, 7vw, 92px) 0;
}

body .login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--ds-line-strong);
  background: var(--ds-paper-raised);
  text-align: left;
}

body .login-logo {
  justify-content: flex-start;
  margin: 28px 0 36px;
}

body .login-card h1 {
  max-width: 520px;
  margin-bottom: 16px;
  color: var(--ds-ink);
  font-size: clamp(2.5rem, 4.4vw, 4.7rem);
  font-weight: 620;
  letter-spacing: -.06em;
  line-height: .95;
}

body .login-subtitle {
  max-width: 450px;
  margin-bottom: 34px;
  color: var(--ds-muted);
}

body .google-btn {
  justify-content: flex-start;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--ds-ink);
  border-radius: 0;
  background: var(--ds-ink);
  color: var(--ds-paper);
}

body .google-btn:hover {
  border-color: var(--ds-signal);
  background: var(--ds-signal);
  color: white;
  box-shadow: none;
}

body .login-note {
  color: var(--ds-muted);
}

.login-art {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-height: 620px;
  padding: clamp(28px, 4vw, 52px);
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px),
    var(--ds-dark);
  background-size: 44px 44px;
  color: #f4f1ea;
}

.login-art::after {
  position: absolute;
  top: 20%;
  right: -22%;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ds-aqua) 0 7%, var(--ds-violet) 34%, rgba(229, 71, 64, .58) 52%, transparent 70%);
  content: "";
}

.login-art-topline,
.login-art-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: rgba(244, 241, 234, .55);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-art-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 560px;
}

.login-art-copy > span {
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .65rem;
  text-transform: uppercase;
}

.login-art-copy h2 {
  margin: 18px 0 22px;
  color: #f4f1ea;
  font-size: clamp(3rem, 5.5vw, 5.6rem);
  font-weight: 620;
  letter-spacing: -.065em;
  line-height: .9;
}

.login-art-copy h2 em {
  color: var(--ds-signal);
  font-style: normal;
}

.login-art-copy p {
  max-width: 400px;
  color: rgba(244, 241, 234, .65);
}

.login-art-timeline {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

.login-art-timeline span {
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #202126;
}

.login-art-timeline span:nth-child(2) { background: var(--ds-violet); }
.login-art-timeline span:nth-child(4) { background: var(--ds-aqua); }
.login-art-timeline span:nth-child(5) { background: var(--ds-yellow); }
.login-art-timeline span.active {
  border-color: var(--ds-signal);
  background: var(--ds-signal);
  box-shadow: 0 0 0 2px var(--ds-dark), 0 0 0 3px var(--ds-signal);
}

/* Dashboard */

body .dashboard-container {
  max-width: 980px;
  padding: clamp(54px, 7vw, 92px) var(--ds-gutter);
}

body .dashboard-header {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--ds-line-strong);
}

body .dashboard-header h1 {
  margin: 18px 0 8px;
  color: var(--ds-ink);
  font-size: clamp(3.3rem, 7vw, 6.4rem);
  font-weight: 620;
  letter-spacing: -.07em;
  line-height: .9;
}

body .dashboard-card,
body .dashboard-subscribe-cta {
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: var(--ds-paper-raised);
  box-shadow: none;
}

body .dashboard-avatar {
  border-radius: 0;
  background: linear-gradient(135deg, var(--ds-violet), var(--ds-signal));
}

body .dashboard-status-row {
  border-color: var(--ds-line);
}

body .status-badge {
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
}

body .dashboard-actions {
  display: grid;
  grid-template-columns: 1fr;
}

body .dashboard-signout {
  border-radius: 0;
  border-color: var(--ds-line-strong);
  background: transparent;
}

/* Download */

body .download-container {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
  width: min(var(--ds-max), calc(100% - 2 * var(--ds-gutter)));
  max-width: none;
  padding: clamp(66px, 8vw, 112px) 0;
  text-align: left;
}

.download-hero-copy {
  position: sticky;
  top: 104px;
}

body .download-icon {
  width: 70px;
  height: 70px;
  margin: 34px 0 42px;
  border: 1px solid var(--ds-ink);
  border-radius: 0;
  background: var(--ds-ink);
  box-shadow: 12px 12px 0 var(--ds-signal);
}

body .download-icon svg {
  width: 30px;
  height: 30px;
}

body .download-container h1 {
  max-width: 660px;
  margin-bottom: 22px;
  color: var(--ds-ink);
  font-size: clamp(3.2rem, 6.4vw, 6.2rem);
  font-weight: 620;
  letter-spacing: -.07em;
  line-height: .9;
}

body .download-container > p,
body .download-hero-copy > p {
  max-width: 580px;
  color: var(--ds-ink-soft);
}

body .download-btn-wrapper {
  margin: 34px 0 13px;
}

body .version-text {
  margin-bottom: 0;
  color: var(--ds-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .66rem;
}

body .info-cards {
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid var(--ds-line-strong);
}

body .info-card {
  border: 0;
  border-bottom: 1px solid var(--ds-line);
  border-radius: 0;
  background: var(--ds-paper-raised);
  padding: clamp(26px, 4vw, 42px);
}

body .info-card:last-child {
  border-bottom: 0;
}

body .info-card h3 svg {
  color: var(--ds-signal);
}

body .info-card ol li::before {
  border: 1px solid var(--ds-ink);
  border-radius: 0;
  background: transparent;
  color: var(--ds-ink);
}

body .account-cta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 22px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: var(--ds-paper-muted);
  padding: 28px;
  text-align: left;
}

body .account-cta h3,
body .account-cta p {
  margin: 0;
}

/* Pricing */

body .pricing {
  padding: clamp(70px, 8vw, 110px) var(--ds-gutter);
  background: transparent;
}

body .pricing > h2 {
  max-width: 920px;
  margin: 24px auto 18px;
  font-size: clamp(3.4rem, 7vw, 6.7rem);
  font-weight: 620;
  letter-spacing: -.07em;
  line-height: .9;
}

body .pricing-card-wrapper {
  max-width: 620px;
  margin-top: 48px;
}

body .pricing-card {
  padding: clamp(34px, 6vw, 60px);
  border: 0;
  border-radius: 0;
  background: var(--ds-dark);
  color: #f4f1ea;
  box-shadow: 18px 18px 0 var(--ds-signal);
}

body .pricing-card :is(.pricing-name, .currency, .price, .period, li) {
  color: inherit;
}

body .pricing-card .pricing-name {
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
}

body .pricing-features li {
  border-color: rgba(255, 255, 255, .13);
}

body .pricing-features li svg {
  color: var(--ds-aqua);
}

body .pricing-card .btn-primary {
  border-color: #f4f1ea;
  background: #f4f1ea;
  color: var(--ds-dark) !important;
}

body .faq-section {
  width: min(var(--ds-max), calc(100% - 2 * var(--ds-gutter)));
  max-width: none;
  padding: 0 0 var(--ds-section);
}

body .faq-section h2 {
  margin-bottom: 38px;
  text-align: left;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  letter-spacing: -.055em;
}

body .faq-list {
  gap: 0;
  border-top: 1px solid var(--ds-line-strong);
}

body .faq-item {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
  gap: 42px;
  padding: 28px 0;
  border: 0;
  border-bottom: 1px solid var(--ds-line);
  border-radius: 0;
  background: transparent;
}

/* Blog */

body .blog-hero {
  max-width: none;
  margin: 0;
  padding: clamp(72px, 9vw, 126px) var(--ds-gutter);
  border: 0;
  border-bottom: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: var(--ds-dark);
  text-align: left;
}

body .blog-hero h1 {
  margin: 24px 0 18px;
  color: #f4f1ea;
  font-size: clamp(4rem, 9vw, 8.5rem);
  font-weight: 620;
  letter-spacing: -.075em;
  line-height: .86;
}

body .blog-hero p {
  max-width: 660px;
  color: rgba(244, 241, 234, .62);
}

body .blog-grid-section {
  max-width: var(--ds-max);
  padding: clamp(54px, 7vw, 90px) var(--ds-gutter);
}

body .blog-grid {
  gap: 0;
  border-top: 1px solid var(--ds-line-strong);
  border-left: 1px solid var(--ds-line-strong);
}

body .blog-card {
  border-width: 0 1px 1px 0;
  border-color: var(--ds-line-strong);
  border-radius: 0;
  background: var(--ds-paper-raised);
}

body .blog-card:hover {
  border-color: var(--ds-line-strong);
  box-shadow: inset 0 -4px var(--ds-signal);
  transform: none;
}

body .blog-card-date,
body .blog-card-read-more,
body .blog-back-link {
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body .blog-article {
  max-width: 820px;
  padding: clamp(50px, 7vw, 90px) var(--ds-gutter);
}

body .blog-article-header h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 620;
  letter-spacing: -.065em;
  line-height: .94;
}

body .blog-blockquote,
body .blog-callout,
body .blog-cta {
  border: 1px solid var(--ds-line-strong);
  border-left: 4px solid var(--ds-signal);
  border-radius: 0;
  background: var(--ds-paper-muted);
}

body .blog-pre {
  border-radius: 0;
  background: var(--ds-dark);
}

/* Success and callback states */

body .success-container,
body .callback-container {
  max-width: 760px;
  padding: clamp(64px, 8vw, 112px) var(--ds-gutter);
}

body .success-icon,
body .callback-icon {
  border-radius: 0;
  background: var(--ds-ink);
  box-shadow: 10px 10px 0 var(--ds-aqua);
}

body .success-container h1,
body .callback-container h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 620;
  letter-spacing: -.065em;
  line-height: .94;
}

body .open-app-section,
body .steps {
  border: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: var(--ds-paper-raised);
}

body .open-app-btn {
  border: 1px solid var(--ds-ink);
  border-radius: 0;
  background: var(--ds-ink);
  color: var(--ds-paper);
  box-shadow: none;
}

body .open-app-btn:hover {
  border-color: var(--ds-signal);
  background: var(--ds-signal);
  box-shadow: none;
}

/* Footer */

body .site-footer {
  padding: clamp(58px, 7vw, 92px) var(--ds-gutter) 28px;
  border-top: 0;
  background: var(--ds-dark);
  color: #f4f1ea;
}

body .site-footer .footer-content {
  max-width: var(--ds-max);
  border-bottom: 1px solid rgba(255, 255, 255, .13);
}

body .site-footer :is(.footer-logo, .footer-col h4) {
  color: #f4f1ea;
}

body .site-footer :is(.footer-brand p, .footer-col a, .footer-bottom p) {
  color: rgba(244, 241, 234, .58);
}

body .site-footer .footer-col a:hover {
  color: #f4f1ea;
}

.footer-signal {
  display: inline-block;
  margin-top: 22px;
  color: var(--ds-signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body .site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  max-width: var(--ds-max);
  padding-top: 24px;
  border-top: 0;
}

@media (max-width: 820px) {
  body .site-nav {
    flex-direction: row;
    gap: 14px;
  }

  body .site-nav .nav-links li:nth-child(-n+4) {
    display: none;
  }

  body .site-nav .nav-links {
    gap: 12px;
  }

  body .login-container,
  body .download-container {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 500px;
  }

  .download-hero-copy {
    position: static;
  }

  body .account-cta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  :root {
    --ds-gutter: 18px;
  }

  body .site-nav {
    min-height: 62px;
    padding: 0 14px;
  }

  body .site-nav .nav-logo img {
    width: 27px;
    height: 27px;
  }

  .nav-edition,
  body .site-nav .nav-sign-in {
    display: none;
  }

  body .site-nav .nav-links {
    gap: 0;
  }

  body .site-nav .btn-small {
    min-height: 38px;
    padding: 8px 11px;
  }

  body .hero-demo-container {
    width: calc(100vw - 24px);
  }

  body .value-props {
    border-bottom: 0;
  }

  body .value-prop {
    border-right: 0;
    border-bottom: 1px solid var(--ds-line);
  }

  body .login-container {
    width: calc(100% - 24px);
    padding: 28px 0 54px;
  }

  body .login-card {
    padding: 28px 22px 32px;
  }

  body .login-card h1 {
    font-size: 2.85rem;
  }

  .login-art {
    min-height: 410px;
    padding: 24px;
  }

  .login-art-copy h2 {
    font-size: 3.1rem;
  }

  body .dashboard-container {
    padding: 44px 18px 64px;
  }

  body .dashboard-card,
  body .dashboard-subscribe-cta {
    padding: 22px;
  }

  body .download-container {
    width: calc(100% - 36px);
    padding: 54px 0 72px;
  }

  body .download-container h1 {
    font-size: 3.5rem;
  }

  body .account-cta {
    padding: 22px;
  }

  body .pricing {
    padding-top: 62px;
  }

  body .pricing > h2 {
    font-size: 3.6rem;
  }

  body .pricing-card {
    padding: 30px 24px;
    box-shadow: 9px 9px 0 var(--ds-signal);
  }

  body .faq-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 0;
  }

  body .blog-hero h1 {
    font-size: 4.4rem;
  }

  body .blog-grid {
    border-right: 1px solid var(--ds-line-strong);
  }

  body .site-footer .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .btn,
  body .blog-card,
  body .google-btn {
    transition: none;
  }
}
