/*
 * VirtuEdit site design system (homepage redesign, 2026-10)
 * Light base + brand red + CleanShot-style panels. Shared by home-v2, converter, download, guides, about.
 */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg: #FFFFFF;
  --bg-soft: #F7F7F8;
  --panel-grad: linear-gradient(160deg, #FFF4F2 0%, #FDE8E6 45%, #F5F6FA 100%);
  --panel-grad-cool: linear-gradient(160deg, #F5F6FA 0%, #EEF0F6 55%, #FFF4F2 100%);
  --card: #FFFFFF;
  --card-dark: #15161B;
  --card-dark-2: #1E2027;
  --line: rgba(15, 15, 15, 0.08);
  --line-strong: rgba(15, 15, 15, 0.14);

  /* Text */
  --text: #0F0F0F;
  --text-2: #4A4A4A;
  --text-3: #8A8A8F;
  --text-on-dark: #F2F3F5;
  --text-on-dark-2: #A3A6AF;

  /* Brand */
  --red: #C12A1F;
  --red-hover: #A01F17;
  --red-soft: #FDECEA;
  --red-glow: rgba(193, 42, 31, 0.22);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.375rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-tiny: 0.75rem;

  /* Shape */
  --radius-card: 24px;
  --radius-window: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-window: 0 30px 60px -20px rgba(20, 20, 30, 0.35), 0 12px 24px -12px rgba(20, 20, 30, 0.2);
  --shadow-btn: 0 6px 18px -6px var(--red-glow);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-gap: clamp(96px, 10vw, 160px);
  --header-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 600ms;
}

/* Phones: a tighter type scale and less air between sections, so pages read shorter.
   Body text stays 16px for readability; headings and leads come down a step. */
@media (max-width: 600px) {
  :root {
    --fs-h1: 2.125rem;
    --fs-h2: 1.5rem;
    --fs-h3: 1.0625rem;
    --fs-lead: 1rem;
    --section-gap: 72px;
  }
  .lead { line-height: 1.5; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
.accent { color: var(--red); }
.lead { font-size: var(--fs-lead); color: var(--text-2); line-height: 1.55; }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: calc(var(--section-gap) / 2) 0; }
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head .lead { margin: 14px auto 0; max-width: 34em; text-wrap: balance; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-tiny); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.section-head .eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary { background: var(--red); color: #fff; box-shadow: var(--shadow-btn); }
.btn--primary:hover { background: var(--red-hover); }
.btn--secondary { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--text-3); }
.btn--ghost { background: transparent; color: var(--text); padding: 0 8px; }
.btn--ghost:hover { color: var(--red); }
.btn--dark { background: var(--card-dark); color: var(--text-on-dark); }
.btn--dark:hover { background: #000; }
.btn--sm { height: 38px; padding: 0 16px; font-size: var(--fs-small); }
.btn .material-icons { font-size: 1.15em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn.is-soon { background: var(--bg-soft); color: var(--text-3); box-shadow: none; border-color: var(--line); pointer-events: none; transition: none; }
.btn-meta { margin-top: 12px; font-size: var(--fs-tiny); color: var(--text-2); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-tiny); font-weight: 600; letter-spacing: 0.01em;
  background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--line);
}
.badge--available { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge--soon { background: var(--bg-soft); color: var(--text-3); }
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 28px; box-shadow: var(--shadow-card);
}
.card--dark { background: var(--card-dark); border-color: rgba(255, 255, 255, 0.06); color: var(--text-on-dark); box-shadow: none; }
.card--dark .lead, .card--dark p { color: var(--text-on-dark-2); }
.card--panel { background: var(--panel-grad); border: none; box-shadow: none; }
.card .material-icons.card-icon { font-size: 28px; color: var(--red); margin-bottom: 16px; }

/* Bento grid: children set --span (1-6) */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento > * { grid-column: span var(--span, 2); min-width: 0; }
@media (max-width: 900px) { .bento > * { grid-column: span 6; } }

/* ---------- App window frame (screenshots / clips) ---------- */
.panel {
  background: var(--panel-grad); border-radius: var(--radius-card);
  padding: clamp(20px, 4vw, 48px); position: relative; overflow: hidden;
}
.panel--cool { background: var(--panel-grad-cool); }
.window {
  border-radius: var(--radius-window); overflow: hidden;
  background: var(--card-dark); box-shadow: var(--shadow-window);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.window__bar {
  height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: var(--card-dark-2);
}
.window__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3A3C44; }
.window__bar i:nth-child(1) { background: #FF5F57; }
.window__bar i:nth-child(2) { background: #FEBC2E; }
.window__bar i:nth-child(3) { background: #28C840; }
.window img, .window video { width: 100%; height: auto; }

/* Phone frame (CSS only) */
.phone {
  width: 260px; aspect-ratio: 9 / 19.5; border-radius: 40px; padding: 10px;
  background: #0B0B0E; box-shadow: var(--shadow-window); position: relative;
}
.phone::before {
  content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 24px; border-radius: 14px; background: #0B0B0E; z-index: 2;
}
.phone__screen { width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: #1A1B20; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 900; height: var(--header-h);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.site-logo {
  display: block; width: 132px; height: 34px; flex: none;
  background: url('https://cdn.jsdelivr.net/gh/tnrud99/viewer-assets@main/logo/blackred_full.png') left center / contain no-repeat;
}
.site-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.site-nav a, .site-nav button {
  height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-small); font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.site-nav a:hover, .site-nav button:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__actions .btn--primary { height: 36px; padding: 0 16px; background: var(--text); box-shadow: none; }
.site-header__actions .btn--primary:hover { background: #33343A; }
.nav-dropdown { position: relative; }
.nav-dropdown__menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-window);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility var(--dur-fast);
}
.nav-dropdown.is-open .nav-dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.nav-dropdown__menu a {
  display: flex; align-items: center; gap: 12px; height: auto; padding: 10px 12px; border-radius: 10px;
}
.nav-dropdown__menu a strong { display: block; font-size: var(--fs-small); color: var(--text); }
.nav-dropdown__menu a span { display: block; font-size: var(--fs-tiny); color: var(--text-3); }
.nav-dropdown__menu .badge { margin-left: auto; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; }

@media (max-width: 900px) {
  .site-nav, .site-header__actions .btn--secondary { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; margin-right: -8px; }
  .site-header__actions { margin-left: auto; }
  .site-header__inner { gap: 12px; }
  .site-header.is-menu-open .site-nav {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; inset: var(--header-h) 0 auto 0; padding: 12px var(--gutter) 24px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-header.is-menu-open .site-nav a, .site-header.is-menu-open .site-nav button { height: 48px; font-size: 1rem; }
  .nav-dropdown__menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; display: none; }
  .nav-dropdown.is-open .nav-dropdown__menu { display: block; }
}

@media (max-width: 400px) {
  .site-logo { width: 104px; }
  .site-header__actions .btn { padding: 0 12px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 40px; margin-top: calc(var(--section-gap) / 2); font-size: var(--fs-small); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.site-footer h4 { font-size: var(--fs-small); font-weight: 600; margin-bottom: 14px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 10px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.site-footer__bottom { margin-top: 48px; display: flex; justify-content: space-between; gap: 16px; color: var(--text-3); flex-wrap: wrap; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } .site-footer { padding-bottom: 96px; } }

/* ---------- React Central floating button ---------- */
.rc-float {
  position: fixed; right: 24px; bottom: 24px; z-index: 950;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 10px; border-radius: var(--radius-pill);
  background: rgba(21, 22, 27, 0.92); color: #fff;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
  transform: translateY(16px); opacity: 0;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur), background var(--dur-fast);
}
.rc-float.is-visible { transform: none; opacity: 1; }
.rc-float.is-lifted { transform: translateY(calc(-1 * var(--rc-lift, 0px))); }
.rc-float:hover { background: #000; }
.rc-float__icon {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--red);
}
.rc-float__icon .material-icons { font-size: 20px; }
.rc-float__text strong { display: block; font-size: var(--fs-small); line-height: 1.2; }
.rc-float__text small { display: block; font-size: var(--fs-tiny); color: var(--text-on-dark-2); line-height: 1.2; }
/* Phones: just the round icon, and out of the way while reading (site.js adds .is-tucked on scroll down). */
@media (max-width: 600px) {
  .rc-float { right: 16px; bottom: 16px; padding: 6px; }
  .rc-float__icon { width: 40px; height: 40px; }
  .rc-float__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rc-float.is-tucked { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
}

/* ---------- SHA-256 box for direct downloads (filled by site.js from products.js) ---------- */
.hash {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.hash code {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem;
  line-height: 1.45; color: var(--text); word-break: break-all; user-select: all;
}
.hash__copy {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--card);
  font: inherit; font-size: var(--fs-tiny); font-weight: 600; color: var(--text); cursor: pointer;
}
.hash__copy:hover { border-color: var(--text-3); }
.hash__copy .material-icons { font-size: 16px; }

/* ---------- Store badges ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.get-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ms-badge { display: block; border-radius: 5px; }
.ms-badge img { display: block; height: 44px; width: auto; }
.store-badge.is-soon, .ms-badge.is-soon { opacity: .5; pointer-events: none; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px;
  border-radius: 12px; background: #000; color: #fff;
}
.store-badge small { display: block; font-size: 10px; line-height: 1; opacity: 0.8; }
.store-badge b { display: block; font-size: 16px; line-height: 1.2; font-weight: 600; }
.store-badge svg { width: 22px; height: 22px; fill: currentColor; }
/* Same box as the Microsoft Store badge (161x44, #202020, 5px corners). */
.store-badge--mac {
  box-sizing: border-box; width: 161px; height: 44px; padding: 0 8px 0 10px;
  border: 1px solid rgba(0, 0, 0, .1); border-radius: 5px; background: #202020; background-clip: padding-box; text-align: left;
}
.store-badge--mac .material-icons { font-size: 22px; }
.store-badge--mac small { font-size: 10px; }
.store-badge--mac b { font-size: 15px; }

/* Chip picker on the Mac download button. The menu lives on <body> so section overflow can't clip it. */
.store-badge .build-pick__chevron { font-size: 20px; margin-left: auto; opacity: .75; transition: transform .2s ease; }
.store-badge[aria-expanded="true"] .build-pick__chevron { transform: rotate(180deg); }
.build-pick__menu {
  position: fixed; z-index: 1000; width: 248px; padding: 8px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14); text-align: left;
}
.build-pick__menu[hidden] { display: none; }
.build-pick__menu p { margin: 0; padding: 6px 10px 8px; font-size: 12px; line-height: 1.3; color: var(--text-3); }
.build-pick__menu a, .build-pick__menu button {
  display: grid; width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px;
  padding: 9px 10px; border-radius: 9px;
}
.build-pick__menu a:hover, .build-pick__menu a:focus-visible, .build-pick__menu button:hover, .build-pick__menu button:focus-visible { background: var(--bg-soft); }
.build-pick__menu b { font-size: 14px; line-height: 1.3; font-weight: 600; }
.build-pick__menu small { grid-row: 2; font-size: 12px; line-height: 1.3; color: var(--text-2); }
.build-pick__menu .material-icons { grid-row: 1 / 3; grid-column: 2; font-size: 20px; color: var(--text-3); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 0; display: flex; justify-content: space-between; gap: 16px;
  font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--text-3); transition: transform var(--dur) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--text-2); }
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .faq details { interpolate-size: allow-keywords; }
    .faq details::details-content { height: 0; overflow: clip; transition: height var(--dur) var(--ease-out), content-visibility var(--dur) allow-discrete; }
    .faq details[open]::details-content { height: auto; }
  }
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
[data-reveal].is-revealed { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Wireframe placeholders (temporary) ---------- */
.wf {
  display: grid; place-items: center; text-align: center;
  min-height: var(--wf-h, 280px); padding: 24px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-card);
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(15, 15, 15, 0.025) 14px 28px);
  color: var(--text-3); font-size: var(--fs-small);
}
.wf strong { display: block; color: var(--text-2); font-size: var(--fs-body); margin-bottom: 4px; }

/* ---------- Utilities ---------- */
.desktop-only { display: initial; }
.mobile-only { display: none; }
@media (max-width: 767px) { .desktop-only { display: none !important; } .mobile-only { display: initial; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
.site-footer__address { font-style: normal; font-size: var(--fs-tiny); line-height: 1.6; color: var(--text-2); }

/* Phones: readable info lines and finger-sized footer links (kept last so they win over the base rules). */
@media (max-width: 600px) {
  /* Info lines under buttons are full sentences: 13px reads better than 12px on a phone. */
  .btn-meta, .site-footer__address { font-size: 0.8125rem; line-height: 1.5; }
  /* Footer links: taller tap areas (about 37px) instead of 17px lines 10px apart. */
  .site-footer li + li { margin-top: 0; }
  .site-footer li a { display: inline-block; padding: 10px 0; }
  .site-footer h4 { margin-bottom: 4px; }
}
