/* Page sections and Obsidian mock-ups. Badge, chip, and progress styles come from plugin.css,
   a copy of the plugin's own styles.css, so the site always matches a release. */

:root {
  --interactive-accent: #8a5cf5;
  --color-green: #3f9a5c;
  --color-orange: #d9781f;
}

/* Obsidian's light theme, scoped to the product mock-ups. */
.obsidian-frame {
  --background-primary: #ffffff;
  --background-secondary: #f6f6f6;
  --background-modifier-hover: rgb(0 0 0 / 0.065);
  --background-modifier-active-hover: rgb(138 92 245 / 0.12);
  --background-modifier-border: #e3e3e3;
  --background-modifier-border-hover: #d2d2d2;
  --text-normal: #222222;
  --text-muted: #5c5c5c;
  --text-faint: #a3a3a3;
  --font-interface: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --font-ui-small: 13px;
  --font-ui-smaller: 12px;
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--background-primary);
  color: var(--text-normal);
  font-family: var(--font-interface);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 34px 80px rgb(6 2 14 / 0.55), 8px 9px 0 rgb(92 59 142 / 0.35);
}

.obsidian-frame:focus-within {
  box-shadow: 0 0 0 3px rgb(184 140 255 / 0.7), 0 34px 80px rgb(6 2 14 / 0.55), 8px 9px 0 rgb(92 59 142 / 0.35);
}

.of-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--background-modifier-border);
  background: var(--background-secondary);
  color: var(--text-muted);
  font-size: var(--font-ui-small);
}

.of-lights { display: inline-flex; gap: 8px; }
.of-lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.of-lights i:nth-child(2) { background: #febc2e; }
.of-lights i:nth-child(3) { background: #28c840; }

.of-tab {
  align-self: flex-end;
  padding: 7px 16px 9px;
  border: 1px solid var(--background-modifier-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--background-primary);
  color: var(--text-normal);
}

.of-hint { margin-left: auto; color: #7a52d6; font-weight: 600; }

.of-body { padding: 26px clamp(20px, 4vw, 40px) 14px; }

.of-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin: 0 0 12px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.of-heading .section-meter-badge { font-size: 0.52em; }

.of-editor { position: relative; }

.of-editor textarea {
  width: 100%;
  min-height: 10.4em;
  display: block;
  resize: none;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-normal);
  font: 1.02rem/1.75 var(--font-interface);
}

/* Covers the first line with a chip, like Live Preview, until the cursor moves onto it. */
.of-chip-line {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1.785rem;
  display: flex;
  align-items: center;
  background: var(--background-primary);
}
.of-chip-line[hidden] { display: none; }

.obsidian-frame button.section-meter-target-chip { border: 0; font: inherit; font-size: var(--font-ui-small); }
.section-meter-target-chip-icon svg,
.section-meter-target-caption svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

.of-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 4px 14px;
  border-top: 1px solid var(--background-modifier-border);
  background: var(--background-secondary);
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
}

.of-status .section-meter-status-bar-part { display: inline-flex; flex-wrap: nowrap; min-width: 0; align-items: center; gap: 0.4em; }
.of-status .section-meter-target-progress { inline-size: 2.75em; grid-column: auto; }

.of-status button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: #7a52d6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.of-status button:hover { color: #4f2fa3; }
.of-status button:focus-visible { outline: 2px solid #7a52d6; outline-offset: 2px; border-radius: 3px; }

/* Hero: the answer and the install button sit in the first screen, the product beside them. */
.p-hero {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(36px, 5vw, 76px);
  align-items: center;
  padding: clamp(32px, 6vh, 72px) 0 clamp(48px, 8vh, 88px);
}

.p-hero .hero-title { display: block; grid-column: auto; perspective: none; }
.p-hero .hero-shout { margin-bottom: 30px; font-size: clamp(2.8rem, 4.5vw, 4.9rem); }

.p-answer {
  max-width: 520px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(1.12rem, 1.45vw, 1.3rem);
  line-height: 1.5;
}
.p-answer strong { color: var(--text); }

.p-facts {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 32px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.p-facts li { display: flex; align-items: baseline; gap: 0.4em; }
.p-facts strong { color: var(--accent-soft); font-size: 1.15rem; }

/* Features keep their copy; the real screenshot now illustrates them. */
.p-features .feature-list { align-self: start; }
.p-features-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 90px); align-items: center; }
.p-features-shot { margin: 0; }
.p-features-shot img { width: 100%; height: auto; display: block; }

/* Targets: one live example the visitor can steer. */
.p-targets {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  padding: 120px 0 140px;
  border-top: 1px solid var(--line);
}
.p-targets h2 { margin-bottom: 22px; }
.p-targets-copy > p { max-width: 460px; margin: 0 0 30px; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.p-targets-copy code { padding: 0.08em 0.3em; border: 1px solid rgb(223 204 255 / 0.24); border-radius: 4px; background: rgb(184 140 255 / 0.1); color: var(--accent-soft); font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.p-controls { display: grid; gap: 18px; margin-bottom: 30px; }
.p-targets-copy > p.p-controls-hint { margin: -12px 0 22px; color: var(--accent-soft); font-size: 0.95rem; }

.p-segmented { margin: 0; padding: 0; border: 0; }
.p-segmented legend { margin-bottom: 8px; padding: 0; color: var(--faint); font-size: 0.78rem; font-weight: 700; }
.p-segmented div { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / 0.04); }
.p-segmented label { position: relative; }
.p-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.p-segmented label span { display: block; padding: 7px 14px; border-radius: 9px; color: var(--muted); font-size: 0.9rem; font-weight: 650; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.p-segmented input:checked + span { background: var(--surface-raised); color: var(--text); box-shadow: inset 0 0 0 1px rgb(223 204 255 / 0.3); }
.p-segmented input:focus-visible + span { outline: 2px solid var(--accent-soft); outline-offset: 2px; }


/* A close-up of one heading: the badge is the subject, the note around it fades away. */
.p-target-zoom { border-radius: 20px; }
.p-zoom-body {
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 70%, transparent 100%);
}
.p-target-zoom .of-heading { margin: 22px 0; font-size: clamp(1.9rem, 3vw, 2.6rem); }
.p-target-zoom .of-heading .section-meter-badge { font-size: 0.5em; }
.p-zoom-context { opacity: 0.32; pointer-events: none; }
.p-zoom-context p { margin: 0; color: var(--text-normal); font-size: 1.3rem; line-height: 1.7; }
p.p-zoom-context { margin: 0; color: var(--text-normal); font-size: 1.3rem; line-height: 1.7; }
.p-zoom-context .section-meter-target-chip { margin-bottom: 14px; font-size: 1rem; }

/* Everywhere you write: three small, real renderings of the plugin's UI. */
.p-everywhere { width: min(100% - 48px, 1280px); margin: 0 auto; padding: 0 0 140px; }
.p-everywhere-heading { max-width: 640px; margin-bottom: 48px; }
.p-everywhere-heading h2 { margin: 0 0 16px; font-size: clamp(2.7rem, 4.4vw, 4.7rem); font-weight: 650; letter-spacing: -0.065em; line-height: 0.96; }
.p-everywhere-heading p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.p-everywhere-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.p-place h3 { margin: 26px 0 8px; font-size: 1.15rem; letter-spacing: -0.02em; }
.p-place > p { margin: 0; color: var(--muted); line-height: 1.55; }
.p-place-visual { height: 300px; margin: 0; display: flex; flex-direction: column; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 24px 56px rgb(6 2 14 / 0.45); }
.p-place-text { flex: 1; padding: 24px 22px; color: var(--text-normal); font-size: 0.98rem; line-height: 1.65; }
.p-place-text p { margin: 0; }
.p-selectable .is-selected { background: rgb(138 92 245 / 0.24); }
.p-statusbar { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 8px 12px; border-top: 1px solid var(--background-modifier-border); background: var(--background-secondary); color: var(--text-muted); font-size: 11.5px; }
.p-statusbar .section-meter-status-bar-part { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; }
.p-statusbar .section-meter-status-bar-part[hidden] { display: none; }
.p-statusbar .section-meter-target-progress { inline-size: 2.75em; }
/* Reading view card: editing shows Markdown marks and a cursor; reading hides them. */
.p-mode { display: inline-grid; margin-bottom: 14px; }
.p-mode > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--background-modifier-hover); color: var(--text-muted); font-size: 12px; transition: opacity 250ms ease; }
.p-mode svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.p-mode-editing, .is-editing .p-mode-reading { opacity: 0; }
.is-editing .p-mode-editing { opacity: 1; }
.p-md-marker { display: inline-block; max-width: 0; overflow: hidden; color: var(--text-faint); vertical-align: bottom; white-space: pre; transition: max-width 300ms ease; }
.is-editing .p-md-marker { max-width: 2.2em; }
.p-caret { display: none; width: 1.5px; height: 1.1em; margin-left: 1px; background: var(--text-normal); vertical-align: text-bottom; animation: p-caret-blink 1s steps(1) infinite; }
.is-editing .p-caret { display: inline-block; }
@keyframes p-caret-blink { 50% { opacity: 0; } }
.p-place .of-heading { margin-bottom: 12px; font-size: 1.3rem; }
.p-place .of-heading .section-meter-badge { font-size: 0.56em; }

/* The phone gets the plugin's real mobile meter. Its transform makes the meter's
   fixed position relative to the phone instead of the page. */
.p-phone-stage { align-items: center; justify-content: flex-end; overflow: hidden; border-radius: 14px; background: rgb(255 255 255 / 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.p-phone { --background-primary-alt: #f1f1f1; --mobile-toolbar-height: 44px; width: 210px; height: 280px; margin-top: 20px; border-radius: 26px 26px 0 0; transform: translateZ(0); box-shadow: 0 0 0 6px #2a2333, 0 24px 56px rgb(6 2 14 / 0.5); }
/* Minimal phone chrome: iOS status bar and Obsidian's mobile header, which the note
   scrolls under. The plugin places a top meter below safe area + header height. */
.p-phone { --safe-area-inset-top: 24px; --header-height: 30px; overflow: hidden; }
.p-phone-status, .p-phone-header { position: absolute; right: 0; left: 0; z-index: 2; display: flex; align-items: center; background: var(--background-primary); color: var(--text-normal); }
.p-phone-status { top: 0; height: 24px; justify-content: space-between; padding: 0 16px 0 20px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.01em; }
.p-phone-island { position: absolute; top: 5px; left: 50%; width: 52px; height: 15px; margin-left: -26px; border-radius: 999px; background: #111; }
.p-phone-icons { display: inline-flex; align-items: center; gap: 4px; }
.p-phone-icons svg { height: 8px; width: auto; fill: currentColor; }
.p-phone-icons svg:last-child { height: 9px; }
.p-phone-header { top: 24px; height: 30px; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--background-modifier-border); color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.p-phone-header span { flex: 1; color: var(--text-normal); text-align: center; }
.p-phone-header svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.p-phone-scroll { padding: 68px 16px 0; font-size: 12.5px; line-height: 1.6; transition: transform 1.6s cubic-bezier(.45, .05, .25, 1); }
.p-phone-scroll .of-heading { margin: 0 0 8px; font-size: 1.15rem; }
.p-phone-scroll .of-heading:not(:first-child) { margin-top: 18px; }
.p-phone-scroll p { margin: 0 0 8px; }
.p-phone .section-meter-mobile-current-section { position: fixed; }
/* A fingertip shows where the meter is being dragged from. */
.p-touch { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgb(138 92 245 / 0.35); box-shadow: 0 0 0 6px rgb(138 92 245 / 0.15); opacity: 0; transform: scale(0.6); transition: opacity 200ms ease, transform 200ms ease; pointer-events: none; }
.is-touched .p-touch { opacity: 1; transform: scale(1); }
.p-phone .section-meter-mobile-current-section { inset-inline: 8px; font-size: 11px; }
.p-phone-toolbar { position: absolute; right: 0; bottom: 0; left: 0; height: 44px; display: flex; align-items: center; justify-content: space-around; border-top: 1px solid var(--background-modifier-border); background: var(--background-secondary); }
.p-phone-toolbar i { width: 16px; height: 16px; border-radius: 4px; background: #c9c9c9; }

.p-footer { flex-wrap: wrap; padding: 24px 0; }
.p-footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.p-footer-links a, .p-footer a { color: var(--muted); }
.p-footer-links a:hover, .p-footer a:hover { color: var(--accent-soft); }

@media (max-width: 960px) {
  .p-hero, .p-targets, .p-features-layout, .p-everywhere-grid { grid-template-columns: minmax(0, 1fr); }
  .p-hero { min-height: 0; padding-top: 36px; }
  .p-targets { padding: 88px 0 100px; }
  .p-facts { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .p-hero, .p-facts, .p-targets, .p-everywhere { width: min(100% - 32px, 1280px); }
  .p-footer { flex-direction: column; align-items: flex-start; }
  .p-hero .hero-shout { font-size: clamp(2.7rem, 12.5vw, 3.8rem); }
  .of-hint { display: none; }
  .p-zoom-context p, p.p-zoom-context { font-size: 1.05rem; }
  .p-target-zoom .of-heading { margin: 16px 0; }
  /* The heading badge already shows the counts; keep the status bar to the target. */
  #demo-status > span:first-child, #demo-status > .section-meter-status-bar-separator { display: none; }
}

/* Type the headline to its measured width, so it never overflows the column. */
@media (prefers-reduced-motion: no-preference) {
  .p-hero .hero-title.is-visible .type-word-write { animation-name: p-type-write, caret-blink; }
  @keyframes p-type-write { to { width: var(--write-width, 26ch); } }
}

@media (prefers-reduced-motion: reduce) {
  .p-segmented label span, .p-mode > span, .p-md-marker, .p-phone-scroll { transition: none; }
  .p-caret { animation: none; }
}
