/* App Inquirer placeholder page (src/pages/placeholder-view.ts; appinquirer.com until launch), from the mock in
   ~/AI/40 - App/AppInquirer/Assets/placeholder-mock/. Every class starts with ph-, and the page loads only fonts.css,
   tokens.css and this file. Colours and type come from tokens.css. Light and dark follow the system; a data-theme on
   <html> (the site's own switch) is honoured too. */

body.ph {
  margin: 0;
  background: var(--ai-paper);
  color: var(--ai-ink);
  font-family: var(--ai-font-text);
  font-size: 18px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
/* :where() keeps these resets at zero specificity, so every ph- class below wins over them. */
:where(.ph) *, :where(.ph) *::before, :where(.ph) *::after { box-sizing: border-box; }
:where(.ph) :where(h1, h2, p, ul) { margin: 0; padding: 0; }
:where(.ph) ul { list-style: none; }
:where(.ph) img { display: block; max-width: 100%; }
:where(.ph) a { color: inherit; }
.ph :focus-visible { outline: 3px solid var(--ai-ink); outline-offset: 3px; border-radius: var(--ai-radius); }

.ph-wrap { max-width: 1312px; margin: 0 auto; padding-left: 48px; padding-right: 48px; }

/* ---------- Masthead ---------- */
.ph-masthead { padding-top: 40px; }
.ph-masthead__title { line-height: 0; display: flex; justify-content: center; padding: 24px 0 32px; } /* clear space over the Q's counter */
.ph-masthead__title img { height: 104px; width: auto; }
.ph .ph-logo-night { display: none; }

.ph-dateline {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px;
  border-top: 1px solid var(--ai-ink);
  border-bottom: 5px solid var(--ai-ink);
  padding: 7px 0 8px;
  font: 600 13px/1.3 var(--ai-font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ph-dateline__soon { color: var(--ai-red); font-weight: 800; letter-spacing: .08em; }

/* The theme toggle (Jeff #69): one quiet control on the right, sitting just above the dateline's rule inside the
   space under the logo, so nothing moves. "Dark mode" with a moon on a light page, "Light mode" with a sun on a dark
   one; hidden until /js/site.js wires it, so it is never a dead button. */
.ph-mode-row { display: flex; justify-content: flex-end; align-items: center; height: 32px; margin-top: -32px; }
.ph-mode {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 0 8px 12px; margin: -8px 0 -8px -12px;
  background: none; border: 0; cursor: pointer; color: var(--ai-ink-3);
  font: 700 11px/1 var(--ai-font-display); letter-spacing: .08em; text-transform: uppercase;
}
.ph-mode[hidden] { display: none; }
.ph-mode:hover { color: var(--ai-ink); }
.ph-mode:focus-visible { outline: 2px solid var(--ai-ink); outline-offset: 2px; }
.ph-mode__icon { width: 14px; height: 14px; flex: none; }
.ph-mode__moon { fill: currentColor; }
.ph-mode__sun { display: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
:root[data-theme="night"] .ph-mode__moon { display: none; }
:root[data-theme="night"] .ph-mode__sun { display: block; }
@media (max-width: 720px) { .ph-mode-row { height: 22px; margin-top: -22px; } }

/* ---------- Lead: the headline, with the readers' box beside it ---------- */
.ph-lead {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 32px 48px;
  align-items: start;
  padding: 40px 0 56px;
}
.ph-lead__story { padding-top: 14px; }
.ph-headline {
  font: 800 76px/.98 var(--ai-font-display);
  font-stretch: 78%;
  letter-spacing: -.01em;
  text-wrap: balance;
  margin-bottom: 24px;
}
.ph-deck {
  font: italic 400 23px/1.4 var(--ai-font-text);
  color: var(--ai-ink-2);
  max-width: 40ch;
  text-wrap: pretty;
}

/* ---------- The boxes ---------- */
.ph-box { position: relative; border-top: 5px solid var(--ai-ink); padding: 20px 0 8px; scroll-margin-top: 24px; }
.ph-lead .ph-box::before { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; border-left: 1px solid var(--ai-rule); }
.ph-box--makers { margin-bottom: 64px; padding-bottom: 32px; }
.ph-kicker { font-size: 12px; color: var(--ai-ink-3); margin-bottom: 8px; }
.ph-box__title { font: 800 40px/1.05 var(--ai-font-display); font-stretch: 80%; letter-spacing: -.005em; margin-bottom: 12px; text-wrap: balance; }
.ph-box__text { font: 400 19px/1.45 var(--ai-font-text); color: var(--ai-ink-2); max-width: 44ch; margin-bottom: 24px; text-wrap: pretty; }

/* The makers' box: what they get on the left; on the right, the AI agent's prompt, then the manual start */
.ph-makers { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 48px; }
.ph-makers__send { position: relative; padding-top: 4px; }
.ph-makers__send::before { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; border-left: 1px solid var(--ai-rule); }

/* Agent submissions (Jeff #71): a small box title, a line, the prompt in a quiet box, then Copy and How it works */
.ph-agent__title { font: 800 24px/1.15 var(--ai-font-display); font-stretch: 80%; letter-spacing: -.003em; margin: 0 0 8px; text-wrap: balance; }
.ph-agent__text { font: 400 17px/1.45 var(--ai-font-text); color: var(--ai-ink-2); max-width: 56ch; margin-bottom: 16px; text-wrap: pretty; }
.ph-prompt {
  font: 500 15px/1.45 var(--ai-font-display); color: var(--ai-ink);
  background: var(--ai-wash); border: 1px solid var(--ai-ink); border-radius: var(--ai-radius);
  padding: 14px 16px; text-wrap: pretty; overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text;
}
.ph-prompt-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.ph-copy[hidden] { display: none; }
.ph-link { display: inline-flex; align-items: center; min-height: 44px; font: 700 15px/1.3 var(--ai-font-display); text-decoration: underline; text-underline-offset: 4px; }
.ph-link:hover { text-decoration-thickness: 2px; }
.ph-copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The manual start: under a thin rule, a small label, one email field and Get started */
.ph-start { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--ai-rule); }
.ph-start__label { font-size: 12px; color: var(--ai-ink-3); margin-bottom: 14px; }

/* Step 2 (/submit): the whole maker form in one reading column */
.ph-submit { max-width: 760px; padding: 40px 0 72px; }
.ph-page__title { font: 800 56px/1.0 var(--ai-font-display); font-stretch: 78%; letter-spacing: -.01em; margin: 0 0 28px; text-wrap: balance; }

/* What makers get: two ruled items */
.ph-perks { border-top: 1px solid var(--ai-rule); }
.ph-perk { padding: 14px 0 16px; border-bottom: 1px solid var(--ai-rule); }
.ph-perk__head { font: 700 17px/1.25 var(--ai-font-display); margin-bottom: 4px; }
.ph-perk__text { font: 400 17px/1.45 var(--ai-font-text); color: var(--ai-ink-2); text-wrap: pretty; }

/* ---------- Forms ---------- */
.ph-form { display: block; }
.ph-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.ph-field { display: flex; flex-direction: column; min-width: 0; }
.ph-label { display: block; font: 700 15px/1.3 var(--ai-font-display); margin-bottom: 6px; }
.ph-hint { font: 400 15px/1.4 var(--ai-font-text); color: var(--ai-ink-3); margin: -2px 0 8px; }
.ph-input {
  width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; margin: 0;
  font: 400 18px/1.4 var(--ai-font-text); color: var(--ai-ink); background: var(--ai-paper);
  border: 2px solid var(--ai-ink); border-radius: var(--ai-radius);
}
.ph-input::placeholder { color: var(--ai-ink-3); }
.ph-input[aria-invalid="true"] { border-color: var(--ai-red); }
.ph-field--wide { grid-column: 1 / -1; }
.ph-optional { font-weight: 400; color: var(--ai-ink-3); }
.ph-error { font: 600 14px/1.4 var(--ai-font-display); color: var(--ai-red); margin-top: 6px; }
/* A message for the whole box (the daily cap, forms off): above the fields, in red with a red rule */
.ph-alert { font: 600 15px/1.4 var(--ai-font-display); color: var(--ai-red); border-left: 3px solid var(--ai-red); padding: 2px 0 2px 12px; margin-bottom: 18px; max-width: 52ch; }
.ph-row { display: flex; gap: 8px; }
.ph-row .ph-input { flex: 1; }

.ph-check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 18px; cursor: pointer; font: 700 15px/1.3 var(--ai-font-display); }
/* A square box in the inputs' 2px ink; checked, it fills with ink and shows a paper-coloured tick. */
.ph-check input {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin: 0; flex: none; cursor: pointer;
  border: 2px solid var(--ai-ink); border-radius: var(--ai-radius); background: var(--ai-paper) center / 16px 16px no-repeat;
}
.ph-check input:checked {
  background-color: var(--ai-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='square'/%3E%3C/svg%3E");
}

.ph-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; margin: 0;
  background: var(--ai-ink); color: var(--ai-paper);
  border: 2px solid var(--ai-ink); border-radius: var(--ai-radius);
  font: 800 14px/1 var(--ai-font-display); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.ph-button:hover { background: var(--ai-paper); color: var(--ai-ink); }
.ph-form > .ph-button { margin-top: 20px; }

.ph-privacy { font: 500 14px/1.45 var(--ai-font-display); color: var(--ai-ink-3); margin-top: 14px; max-width: 52ch; text-wrap: pretty; }

/* The honeypot: off screen, out of the tab order */
.ph-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Thank-you: the box keeps its kicker; the form gives way to a note */
.ph-done { font: 400 21px/1.45 var(--ai-font-text); max-width: 44ch; text-wrap: pretty; }
.ph-done + .ph-done { margin-top: 12px; }
.ph-again { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font: 700 15px/1.3 var(--ai-font-display); text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.ph-footer { padding-bottom: 56px; }
.ph-footer__inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 24px;
  border-top: 5px solid var(--ai-ink);
  padding-top: 8px;
  font: 600 14px/1.3 var(--ai-font-display);
}
.ph-footer__inner p { padding: 12px 0; }
.ph-footer__links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.ph-footer__inner p.ph-footer__links { padding: 0; }
.ph-footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.ph-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1180px) {
  .ph-headline { font-size: 60px; }
}
@media (max-width: 960px) {
  .ph-wrap { padding-left: 32px; padding-right: 32px; }
  .ph-lead { grid-template-columns: 1fr; gap: 40px; }
  .ph-lead__story { padding-top: 0; }
  .ph-lead .ph-box::before, .ph-makers__send::before { display: none; }
  .ph-makers { grid-template-columns: 1fr; gap: 8px; }
  .ph-makers__send { padding-top: 8px; } /* the perks' last rule is the divider */
}
@media (max-width: 720px) {
  body.ph { font-size: 17px; }
  .ph-wrap { padding-left: 16px; padding-right: 16px; }
  .ph-masthead { padding-top: 16px; }
  .ph-masthead__title { padding: 20px 0 22px; }
  .ph-masthead__title img { height: auto; width: min(100%, 310px); }
  .ph-dateline { font-size: 12px; padding: 8px 0 9px; }
  .ph-lead { padding: 28px 0 40px; gap: 36px; }
  .ph-headline { font-size: 44px; line-height: 1.0; margin-bottom: 14px; }
  .ph-deck { font-size: 20px; }
  .ph-box--makers { margin-bottom: 48px; padding-bottom: 16px; }
  .ph-makers { gap: 24px; }
  .ph-box__title { font-size: 34px; }
  .ph-box__text { font-size: 18px; }
  .ph-fields { grid-template-columns: 1fr; gap: 18px; }
  .ph-row { flex-direction: column; }
  .ph-button { width: 100%; }
  .ph-done { font-size: 19px; }
  .ph-prompt-row .ph-button { width: auto; }
  .ph-submit { padding: 28px 0 56px; }
  .ph-page__title { font-size: 40px; margin-bottom: 22px; }
  .ph-footer { padding-bottom: 40px; }
  .ph-footer__inner { flex-direction: column; align-items: flex-start; gap: 0; }
  .ph-footer__inner p { padding: 12px 0 0; }
}

/* ---------- The privacy policy (appinquirer.com/privacy, Jeff #68): one reading column under the dateline ---------- */
.ph-masthead__home { display: inline-block; line-height: 0; }
.ph-policy { max-width: 760px; padding: 40px 0 72px; }
.ph-policy__title { font: 800 56px/1.0 var(--ai-font-display); font-stretch: 78%; letter-spacing: -.01em; margin: 0 0 10px; }
.ph-policy .ph-policy__meta { font: 500 13px/1.3 var(--ai-font-display); color: var(--ai-ink-3); margin: 0 0 28px; }
.ph-policy h2 { font: 800 21px/1.2 var(--ai-font-display); margin: 36px 0 10px; padding-top: 14px; border-top: 1px solid var(--ai-rule); }
.ph-policy p, .ph-policy li { font: 400 18px/1.55 var(--ai-font-text); }
.ph-policy p { margin: 0 0 14px; }
.ph-policy ul { list-style: disc; margin: 0 0 14px; padding-left: 22px; }
.ph-policy li { margin: 0 0 6px; }
.ph-policy a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* The agents' page (/agents) reads like the policy, with code set plainly */
.ph-agents .ph-kicker { font: 800 12px/1.5 var(--ai-font-display); margin: 0 0 8px; }
.ph-agents .ph-page__title { margin-bottom: 8px; }
.ph-agents .ph-prompt { margin-top: 4px; }
.ph-agents code { font: 500 .86em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.ph-code { font: 500 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--ai-wash); border-left: 3px solid var(--ai-rule); padding: 12px 16px; margin: 0 0 16px; overflow-x: auto; white-space: pre; }
.ph-agents .ph-code code { font-size: inherit; overflow-wrap: normal; }
.ph-agents ul { list-style: disc; }
.ph-agents li::marker { color: var(--ai-ink-3); }
.ph-answers li { margin-bottom: 10px; }
.ph-answers strong { font: 700 16px/1.3 var(--ai-font-display); margin-right: 4px; }
.ph-answers code { color: var(--ai-ink-3); font-size: .78em; }
@media (max-width: 720px) {
  .ph-policy { padding: 28px 0 56px; }
  .ph-policy__title { font-size: 40px; }
  .ph-policy p, .ph-policy li { font-size: 17px; }
}

/* ---------- Night: the system setting, or the site's data-theme ---------- */
:root[data-theme="night"] { color-scheme: dark; }
:root[data-theme="night"] .ph .ph-logo-day { display: none; }
:root[data-theme="night"] .ph .ph-logo-night { display: block; }
:root[data-theme="night"] .ph-check input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) .ph .ph-logo-day { display: none; }
  :root:not([data-theme="light"]) .ph .ph-logo-night { display: block; }
  :root:not([data-theme="light"]) .ph-check input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='square'/%3E%3C/svg%3E"); }
}
