/* ===== Backspace Sub-page Shared Styles ===== */
@font-face {
  font-family: "Backspace Comma";
  src: url("/assets/fonts/backspace-square-comma.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+002C;
}

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

:root {
  --bg: #000000;
  --footer-bg: #161618;
  --border: rgba(255, 255, 255, 0.1);
  --fg: #f5f5f7;
  --muted: #86868b;
  --body: #a1a1aa;
  --accent: #2997ff;
  --accent-hover: #59adff;
  --input-bg: rgba(255, 255, 255, 0.045);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sf Pro Display", sans-serif;
  --font-footer: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Backspace Comma', var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

/* Navigation */
.page-nav {
  width: 100%;
  max-width: none;
  min-height: 50px;
  margin: 0;
  padding: 0 max(20px, calc((100vw - 1040px) / 2));
  display: flex;
  align-items: center;
  gap: 30px;
  position: sticky;
  top: 0;
  left: auto;
  transform: none;
  z-index: 1000;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: none;
}

.nav-back {
  display: none;
}

.page-nav--back {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  min-height: 0;
  margin: 2rem auto 0;
  padding: 0 1rem;
  justify-content: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.page-nav--back .nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(15, 15, 17, 0.62);
  color: #a9a9af;
  font-family: 'Backspace Comma', "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.page-nav--back .nav-back:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(28, 28, 31, 0.78);
  color: #fff;
}

.page-nav--back + main {
  padding-top: 1.5rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
  flex: 0 0 auto;
  padding-right: 0;
  border-right: 0;
}

.nav-brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: url("../assets/brand/backspace.png") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

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

.page-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-left: auto;
}

.page-nav-link {
  color: #b8b8bd;
  font-size: 13px;
  font-weight: 450;
  line-height: 1;
  text-decoration: none;
  transition: color 180ms ease;
}

.page-nav-link:hover,
.page-nav-link.is-active {
  color: #fff;
}

.page-nav-download {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: #0071e3;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 38, 92, 0.24), 0 8px 24px rgba(0, 113, 227, 0.18);
  transition: background-color 0.2s ease;
}

.page-nav-download:hover {
  background: #007cd6;
}

.page-nav-download::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 28%, rgba(255, 255, 255, 0.03) 58%, rgba(255, 255, 255, 0.32));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@media (max-width: 767px) {
  .page-nav {
    top: 0;
    min-height: 50px;
    padding-inline: 16px;
    gap: 14px;
  }

  .page-nav-links {
    display: none;
  }

  .page-nav-download {
    margin-left: auto;
  }

  .page-nav--back {
    width: 100%;
    margin-top: 1.5rem;
    padding-inline: 1rem;
  }

}

/* Main layout */
main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.15rem 1rem 8rem;
  opacity: 0;
  transition: opacity 0.7s ease;
}

main.visible {
  opacity: 1;
}

.page-card {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* Typography */
h1 {
  margin: 0 0 0.8rem;
  color: #ffffff;
  font-size: clamp(2.05rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-align: center;
  font-family: 'Backspace Comma', var(--font-display);
}

h2,
h3,
h4 {
  font-family: 'Backspace Comma', var(--font-display);
}

.page-subtitle {
  max-width: 38rem;
  margin: 0 auto 3.25rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
}

h2 {
  margin: 3rem 0 1rem;
  color: #ffffff;
  font-size: clamp(1.28rem, 2.4vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  margin: 0 0 1rem;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.72;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: #ffffff;
  font-weight: 600;
}

em {
  color: rgba(245, 245, 247, 0.9);
  font-style: italic;
}

ul,
ol {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  margin: 1rem 0 1rem;
  padding-left: 1.35rem;
  color: var(--body);
  font-size: 1rem;
  line-height: 1.7;
}

li::marker {
  color: rgba(255, 255, 255, 0.28);
}

.sep {
  height: 1px;
  margin: 2.25rem 0;
  background: var(--border);
}

/* Changelog */
.version-block {
  position: relative;
  padding-left: 2.1rem;
  border-left: 1px solid var(--border);
}

.version-block::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 4px var(--bg);
}

.version-block:first-of-type::before {
  background: #ffffff;
}

.version-block h2 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.version-date {
  margin: 0 0 1.05rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}

.version-divider {
  height: 2.3rem;
  margin: 0;
  border: 0;
}

/* FAQ accordion */
details {
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

details:first-of-type {
  border-top: 1px solid var(--border);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 1.05rem 0;
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

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

details[open] summary::after {
  background: var(--accent);
  transform: scale(1.16);
}

.faq-answer {
  padding: 0 0 1.25rem;
  color: var(--body);
  font-size: 0.95rem;
  line-height: 1.72;
}

.faq-section-title {
  margin: 2.75rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.faq-section-title:first-of-type {
  margin-top: 0;
}

.page-subtitle + .faq-section-title {
  margin-top: 0;
}

.faq-answer a {
  color: var(--accent-hover) !important;
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Support form */
form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

input,
textarea,
select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: 0.78rem;
  outline: none;
  background: var(--input-bg);
  color: var(--fg);
  font-family: 'Backspace Comma', var(--font);
  font-size: 0.98rem;
  line-height: 1.45;
  padding: 0.74rem 0.95rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

select {
  color: var(--fg);
}

select:invalid {
  color: var(--muted);
}

select option {
  background: #1a1a1c;
  color: var(--fg);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(41, 151, 255, 0.7);
  background: rgba(255, 255, 255, 0.065);
}

.form-submit {
  width: 100%;
  min-height: 2.9rem;
  margin-top: 0.25rem;
  border: 1px solid rgba(41, 151, 255, 0.85);
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.86);
  color: #ffffff;
  cursor: pointer;
  font-family: 'Backspace Comma', var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.form-submit:hover {
  border-color: rgba(89, 173, 255, 0.95);
  background: rgba(0, 124, 214, 0.96);
}

.form-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

/* Footer */
.page-footer {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  background: var(--footer-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.05rem max(1.5rem, calc((100vw - 55rem) / 2));
  font-family: 'Backspace Comma', var(--font-footer);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.78rem;
  line-height: 1.4;
  font-family: inherit;
}

.footer-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  order: 2;
}

.footer-copy-row a,
.footer-divider {
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.78rem;
  line-height: 1.4;
  text-decoration: none;
  font-family: inherit;
}

.footer-copy-row a:hover {
  color: var(--fg);
}

.footer-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.95rem 1.25rem;
  order: 1;
}

.footer-links-row a {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.78rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease;
  font-family: inherit;
}

.footer-links-row a:hover {
  color: var(--fg);
}

@media (max-width: 767px) {
  .page-nav {
    max-width: 100%;
    padding: 1.5rem 1rem 0;
  }

  .page-nav.page-nav--back {
    width: calc(100% - 2rem);
    margin-top: 1.5rem;
    padding: 0;
  }

  .nav-brand {
    font-size: 0.86rem;
  }

  main {
    padding: 2rem 1rem 6.5rem;
  }

  .page-subtitle {
    margin-bottom: 2.5rem;
  }

  h2 {
    margin-top: 2.5rem;
  }

  .version-block {
    padding-left: 1.65rem;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.25rem 1rem;
  }
}
