/* Tool landing pages — self-contained (avoids page-landing scale conflicts in main.css) */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #5c5c5c;
  --color-text-muted: #8a8a8a;
  --color-border: #e8e8e8;
  --color-border-strong: #d4d4d4;
  --color-accent: #3b828f;
  --color-accent-hover: #458f9c;
  --color-accent-soft: #e8f2f4;
  --color-canvas-base: #0a0e16;
  --color-canvas-surface: #121620; /* overridden per app in tool-themes.css */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-max: 1200px;
  --app-store-badge-h: 80px;
  --screenshot-aspect: 1280 / 836;
  --screenshot-base-width: 520px;
  --hero-screenshot-max-width: 600px;
  --lightbox-scale: 2;
  --hero-headline-font: 2.076em;
  /* ~2× headline cap height; extra px compensates transparent padding in PNG */
  --hero-icon-size: 128px;
  --hero-icon-trim-left: 10px;
}

html[data-theme="dark"] {
  --color-bg: #0f1115;
  --color-text: #f0f0f0;
  --color-text-secondary: #b4b4b4;
  --color-text-muted: #8f8f8f;
  --color-border: #2a2e36;
  --color-border-strong: #3d4450;
  --color-accent: #4a9eab;
  --color-accent-hover: #5cb0bc;
  --color-accent-soft: #1a3036;
}

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

html {
  color-scheme: light;
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

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

body.page-tool-landing {
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

body.page-tool-landing .page-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

/* Scrollable center */
.page-main {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: calc(var(--space-7) + var(--space-3)) var(--space-5) var(--space-6);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-bg);
}

.landing-canvas {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
  font-size: 17px;
}

.landing-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-7);
  width: 100%;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
}

.hero-lockup {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.82em;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.41em;
}

.hero-app-icon {
  width: var(--hero-icon-size);
  height: var(--hero-icon-size);
  max-width: none;
  margin: 0 0 0 calc(-1 * var(--hero-icon-trim-left));
  padding: 0;
  border-radius: 22%;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}

.hero-headline {
  margin: 0;
  font-size: var(--hero-headline-font);
  line-height: 1.12;
  min-width: 0;
}

.hero-headline h1 {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-title-line {
  display: block;
}

.hero-lead {
  margin: 0 0 var(--space-5);
  padding: 0;
  font-size: 1.5em;
  line-height: 1.55;
  color: var(--color-text-secondary);
  max-width: 34em;
  width: 100%;
}

body.page-tabs .hero-lead {
  font-size: 1.38em;
  line-height: 1.48;
  margin-bottom: var(--space-4);
}

body.page-tabs .hero-lead-line:nth-child(1) {
  margin-bottom: var(--space-4);
}

.hero-lead-line {
  display: block;
}

.hero-lead-line + .hero-lead-line {
  margin-top: 0.15em;
}

@media (min-width: 768px) {
  body.page-tabs .hero-lead-line:nth-child(1) {
    display: block;
  }

  body.page-tabs .hero-lead-line:nth-child(2),
  body.page-tabs .hero-lead-line:nth-child(3) {
    display: inline;
  }

  body.page-tabs .hero-lead-line:nth-child(3) {
    margin-top: 0;
  }

  body.page-tabs .hero-lead-line:nth-child(3)::before {
    content: " ";
  }

  body:not(.page-tabs) .hero-lead-line:nth-child(1),
  body:not(.page-tabs) .hero-lead-line:nth-child(2) {
    display: inline;
  }

  body:not(.page-tabs) .hero-lead-line:nth-child(2)::before {
    content: " ";
  }

  body:not(.page-tabs) .hero-lead-line:nth-child(2) {
    margin-top: 0;
  }

  body:not(.page-tabs) .hero-lead-line:nth-child(3) {
    display: block;
    margin-top: 0.15em;
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: 0;
}

.app-store-badge {
  display: block;
  line-height: 0;
  margin: 0;
  padding: calc(var(--app-store-badge-h) * 0.25) calc(var(--app-store-badge-h) * 0.25) 0 0;
}

.app-store-badge img {
  display: block;
  height: var(--app-store-badge-h);
  width: auto;
}

.hero-pricing-hint {
  margin: var(--space-2) 0 0;
  padding: 0;
  font-size: 0.82em;
  line-height: 1.4;
  color: var(--color-text-muted);
  max-width: 34em;
}

.hero-visual {
  display: none;
  justify-content: center;
  min-width: 0;
}

.hero-screenshots {
  position: relative;
  width: 100%;
  max-width: min(100%, 600px);
  aspect-ratio: var(--screenshot-aspect);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-canvas-base);
}

.hero-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.2s ease;
}

picture.hero-screenshot {
  display: block;
  line-height: 0;
}

picture.hero-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

video.hero-screenshot {
  display: block;
  object-fit: cover;
  object-position: center top;
}

.hero-screenshot.is-active {
  opacity: 1;
}

.hero-screenshots.is-video-active,
.hero-screenshots.is-media-expandable {
  cursor: pointer;
}

.hero-screenshots:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.hero-screenshots.is-video-active::after {
  content: "Tap video";
}

@media (min-width: 980px) {
  .hero-screenshots.is-media-expandable::after {
    content: "Click to enlarge";
  }
}

.hero-screenshots.is-video-active::after,
.hero-screenshots.is-media-expandable::after {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 2;
  padding: 0.35em 0.65em;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  pointer-events: none;
}

@media (min-width: 980px) {
  .hero-screenshots.is-media-expandable::after {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.92;
  }
}

/* Feature strip — left edge aligns with hero copy (icon, lead, badge) */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}

.feature-item + .feature-item {
  border-top: none;
  border-left: none;
}

.feature-item:nth-child(even) {
  border-left: 1px solid var(--color-border);
}

.feature-item:nth-child(n + 3) {
  border-top: 1px solid var(--color-border);
}

.feature-item {
  display: flex;
  gap: var(--space-3);
  padding: 1.1em 1.35em;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  outline: none;
}

.feature-icon {
  width: 1.35em;
  height: 1.35em;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

.feature-item strong {
  display: block;
  font-size: 0.9em;
  color: var(--color-text);
  transition: color 0.15s ease;
}

.feature-item p {
  margin: 0;
  font-size: 0.85em;
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

.feature-item:hover,
.feature-item.is-active,
.feature-item:focus-visible {
  background: var(--color-accent-soft);
}

.feature-item:hover .feature-icon,
.feature-item:hover strong,
.feature-item.is-active .feature-icon,
.feature-item.is-active strong,
.feature-item:focus-visible .feature-icon,
.feature-item:focus-visible strong {
  color: var(--color-accent);
}

.feature-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* Screenshot lightbox (feature strip click) */
body.page-tool-landing.lightbox-open {
  overflow: hidden;
}

body.page-tool-landing.lightbox-open .page-main {
  overflow: hidden;
}

.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  box-sizing: border-box;
}

.screenshot-lightbox.is-open {
  display: flex;
}

.screenshot-lightbox:not(.is-open) .screenshot-lightbox-close,
.screenshot-lightbox:not(.is-open) .screenshot-lightbox-backdrop {
  display: none;
}

.screenshot-lightbox-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(26, 26, 26, 0.55);
  cursor: pointer;
}

.screenshot-lightbox-close {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.screenshot-lightbox-close:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.screenshot-lightbox-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.screenshot-lightbox-panel {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 92vw;
  max-height: calc(100dvh - var(--space-7) * 2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 24px 48px rgba(26, 26, 26, 0.2);
  background: var(--color-canvas-base);
  line-height: 0;
}

.screenshot-lightbox-image {
  display: block;
  width: min(
    calc(var(--screenshot-base-width) * var(--lightbox-scale)),
    92vw,
    calc((100dvh - var(--space-7) * 2) * 520 / 340)
  );
  height: auto;
  max-width: 92vw;
  max-height: calc(100dvh - var(--space-7) * 2);
  object-fit: contain;
}

.screenshot-lightbox-image[hidden],
.screenshot-lightbox-video[hidden] {
  display: none !important;
}

.screenshot-lightbox-video {
  display: block;
  width: min(
    calc(var(--screenshot-base-width) * var(--lightbox-scale)),
    92vw,
    calc((100dvh - var(--space-7) * 2) * 520 / 340)
  );
  height: auto;
  max-width: 92vw;
  max-height: calc(100dvh - var(--space-7) * 2);
  object-fit: contain;
  background: var(--color-canvas-base);
}

@media (max-width: 767px) {
  /* Flatten hero: headline → screenshot → 2×2 features */
  body.page-tool-landing .hero {
    display: contents;
  }

  body.page-tool-landing .hero-copy {
    order: 1;
    align-items: center;
    text-align: center;
  }

  body.page-tool-landing .hero-lockup {
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
    margin-bottom: 1em;
  }

  body.page-tool-landing .hero-app-icon {
    margin-left: 0;
  }

  body.page-tool-landing .hero-lead {
    margin-inline: auto;
  }

  body.page-tool-landing .hero-visual {
    display: block;
    order: 2;
  }

  body.page-tool-landing .feature-strip {
    order: 3;
  }

  body.page-tool-landing .hero-screenshots {
    width: 100%;
    max-width: none;
    aspect-ratio: var(--screenshot-aspect);
    height: auto;
  }
}

@media (max-width: 767px) {
  body.page-tool-landing {
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.page-tool-landing .page-shell {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  body.page-tool-landing .page-main {
    flex: 0 1 auto;
    min-height: 0;
    overflow: visible;
    padding: var(--space-4);
    padding-bottom: var(--space-4);
  }

  body.page-tool-landing .site-footer {
    margin-top: 0;
    flex-shrink: 0;
  }

  body.page-tool-landing .landing-stack {
    gap: var(--space-4);
  }

  body.page-tool-landing .hero-visual {
    width: calc(100% + var(--space-4) * 2);
    margin-top: -10px;
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
  }

  body.page-tool-landing .feature-strip {
    border-radius: var(--radius-sm);
  }

  body.page-tool-landing .hero-screenshots {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  body.page-tool-landing .hero-lockup {
    margin-bottom: var(--space-4);
  }

  body.page-tool-landing .hero-headline {
    font-size: 1.65em;
  }

  body.page-tool-landing.page-tabs .hero-copy {
    width: 100%;
  }

  body.page-tool-landing.page-tabs .hero-lockup {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    gap: 0.65em;
  }

  body.page-tool-landing.page-tabs .hero-app-icon {
    width: 72px;
    height: 72px;
  }

  body.page-tool-landing.page-tabs .hero-headline {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    font-size: clamp(1.2rem, 7vw, 1.75em);
    text-align: left;
  }

  body.page-tool-landing.page-tabs .hero-headline h1 {
    display: block;
    width: 100%;
    margin: 0;
  }

  body.page-tool-landing.page-tabs .hero-title-line {
    display: block;
    white-space: nowrap;
    text-align: left;
    overflow: hidden;
    max-width: 100%;
  }

  body.page-tool-landing .hero-lead,
  body.page-tool-landing .hero-actions {
    display: none;
  }

  body.page-tool-landing:not(.page-tabs) .hero-app-icon {
    width: 96px;
    height: 96px;
  }

  body.page-tool-landing .feature-item {
    padding: var(--space-3);
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-2);
  }

  body.page-tool-landing .feature-item p {
    display: block;
    font-size: 0.72em;
    line-height: 1.35;
    margin: 0;
  }

  body.page-tabs .tabs-mac-only-notice {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: var(--space-4) 0 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    line-height: 1.45;
    text-align: center;
    color: var(--color-text-secondary);
    background: var(--color-bg);
  }

}

.tabs-mac-only-notice {
  display: none;
}

@media (min-width: 768px) and (max-width: 979px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .hero-lockup {
    max-width: 100%;
  }

  .hero-title-line {
    white-space: normal;
  }

  .hero-visual {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .hero-screenshots {
    width: 100%;
    max-width: min(100%, var(--hero-screenshot-max-width));
    height: auto;
    aspect-ratio: var(--screenshot-aspect);
  }
}

@media (min-width: 980px) {
  .feature-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-item:nth-child(n + 3) {
    border-top: none;
  }

  .feature-item:nth-child(even) {
    border-left: none;
  }

  .feature-item:not(:first-child) {
    border-left: 1px solid var(--color-border);
  }

  .feature-item {
    padding: 1em 1.1em;
    flex-direction: row;
    align-items: flex-start;
  }

  .feature-item p {
    font-size: 0.8em;
  }

  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.18fr);
    align-items: stretch;
  }

  .hero-title-line {
    white-space: nowrap;
  }

  .hero-lead {
    max-width: none;
  }

  .hero-pricing-hint {
    max-width: none;
  }

  .hero-copy {
    align-self: start;
  }

  .hero-visual {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    align-self: stretch;
    min-height: 0;
    min-width: 0;
  }

  .hero-screenshots {
    height: 100%;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: var(--screenshot-aspect);
  }
}
