/*
Theme Name: Rightly Beta
Theme URI: https://rightlyapp.com/
Author: NorthMac Services
Description: Private beta landing-page theme for Rightly.
Version: 1.0.0
Text Domain: rightly-beta
*/

@font-face {
  font-family: 'Fraunces';
  src: url('./assets/fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('./assets/fonts/fraunces-latin-wght-italic.woff2') format('woff2-variations');
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('./assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: hsl(40, 32%, 96%);
  --paper-2: hsl(38, 26%, 93%);
  --paper-3: hsl(36, 22%, 88%);
  --ink: hsl(28, 14%, 12%);
  --ink-2: hsl(28, 10%, 28%);
  --rule: hsl(36, 22%, 84%);
  --rule-2: hsl(36, 22%, 90%);
  --accent: hsl(220, 48%, 26%);
  --accent-2: hsl(218, 38%, 40%);
  --gold: hsl(36, 56%, 42%);
  --midnight: hsl(220, 28%, 9%);
  --midnight-2: hsl(220, 24%, 12%);
  --midnight-ink: hsl(38, 22%, 92%);
  --midnight-ink-2: hsl(34, 14%, 78%);
  --midnight-ink-3: hsl(218, 8%, 60%);
  --midnight-rule: hsl(220, 16%, 22%);
  --midnight-gold: hsl(36, 78%, 66%);
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --text-display: clamp(38px, 2.6vw + 28px, 64px);
  --text-h2: clamp(30px, 1.4vw + 22px, 42px);
  --text-lead: clamp(17px, 0.35vw + 15px, 20px);
  --text-body: 17px;
  --text-caption: 15px;
  --text-kicker: 12.5px;
  --shadow-soft: 0 1px 2px hsla(28, 30%, 10%, 0.04), 0 4px 14px hsla(28, 30%, 10%, 0.04);
  --shadow-pop: 0 1px 2px hsla(28, 30%, 10%, 0.08), 0 14px 36px hsla(28, 30%, 10%, 0.08);
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --section-pad: clamp(72px, 9vw, 144px);
  --measure: 660px;
  --stage: 1240px;
  --page-pad: clamp(20px, 5vw, 64px);
  --radius-frame: 10px;
  --radius-ui: 8px;
  --dur-hover: 120ms;
  --dur-reveal: 200ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; }

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

:focus-visible {
  outline: 1.5px solid currentColor;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: var(--s4);
  z-index: 10;
  transform: translateY(-140%);
  background: var(--accent);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: var(--radius-ui);
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--rule-2);
  background: var(--paper);
}

.brand {
  display: inline-block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  font-weight: 560;
  line-height: 1;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
}

.nav-cta { font-size: 15px; font-weight: 500; }

.section { padding: var(--section-pad) 0; }

.hero { padding-top: clamp(56px, 7vw, 112px); }

.section--band {
  background: var(--paper-2);
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}

.section--midnight {
  background: var(--midnight);
  color: var(--midnight-ink);
}

.wrap {
  width: min(var(--stage), calc(100% - 2 * var(--page-pad)));
  margin: 0 auto;
}

.prose {
  max-width: var(--measure);
}

.centered { margin: 0 auto; text-align: center; }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 520;
  letter-spacing: -0.01em;
  color: inherit;
}

h1 {
  max-width: var(--measure);
  margin-bottom: var(--s4);
  font-size: var(--text-display);
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-weight: 550;
}

h2 {
  margin-bottom: var(--s4);
  font-size: var(--text-h2);
  line-height: 1.12;
}

h3 {
  margin-bottom: var(--s3);
  font-size: 20px;
  line-height: 1.25;
}

.lead {
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: var(--text-lead);
  line-height: 1.55;
}

.section--midnight .lead,
.section--midnight p { color: var(--midnight-ink-2); }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: var(--s4);
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-ui);
  background: var(--accent);
  color: var(--paper);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}

.button:hover { background: var(--accent-2); color: var(--paper); }
.button:focus-visible { outline-color: var(--accent); }

.button--light { background: var(--midnight-ink); color: var(--midnight); cursor: pointer; }
.button--light:hover { background: hsl(40, 30%, 97%); color: var(--midnight); }
.button--light:focus-visible { outline-color: var(--midnight-ink); }

.desktop-note {
  margin-top: var(--s4);
  margin-bottom: var(--s7);
  color: var(--ink-2);
  font-size: var(--text-caption);
}

.evidence-frame {
  margin: var(--s7) 0 0;
}

.evidence-frame picture {
  display: block;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  border-radius: var(--radius-frame);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.evidence-frame img {
  width: 100%;
  height: 108%;
  object-fit: cover;
  object-position: center top;
}

.evidence-frame--stage {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.evidence-frame--stage picture { aspect-ratio: 1180 / 740; }
.evidence-frame--stage img { object-position: 58% top; }
.evidence-frame--original img { object-position: 56% top; }
.evidence-frame--hero img { height: 114%; object-position: 50% top; }

/* Reuses the real hero capture, cropped to the research companion so the
   passage-to-cited-research moment is shown, not described. */
.evidence-frame--research {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.evidence-frame--research picture { aspect-ratio: 1 / 1; }
.evidence-frame--research img {
  height: 110%;
  object-position: 100% top;
}

figcaption {
  padding: 12px 4px 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.capabilities-close {
  max-width: var(--measure);
  margin: var(--s5) 0 0;
  color: var(--ink);
}

.beta-form {
  max-width: 780px;
  margin: var(--s7) auto var(--s8);
  padding: var(--s6);
  border: 1px solid var(--midnight-rule);
  border-radius: 12px;
  background: var(--midnight-2);
}

.form-preview-note {
  margin-bottom: var(--s6);
  color: var(--midnight-ink-2);
}

.form-preview-note strong { color: var(--midnight-ink); }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: var(--s5);
  color: var(--midnight-ink);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--midnight-rule);
  border-radius: var(--radius-ui);
  background: var(--midnight);
  color: var(--midnight-ink);
  font: inherit;
  padding: 12px 14px;
}

textarea { resize: vertical; }

.optional { color: var(--midnight-ink-3); font-weight: 400; }

.error {
  min-height: 18px;
  color: hsl(36, 78%, 76%);
  font-size: 14px;
  font-weight: 400;
}

[aria-invalid="true"] { border-color: hsl(36, 78%, 66%); }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: var(--midnight-gold);
}
.check-error { display: block; margin-top: -18px; margin-bottom: var(--s5); }

.confirmation {
  max-width: var(--measure);
  margin: var(--s7) auto var(--s8);
  padding: var(--s6);
  border: 1px solid var(--midnight-rule);
  border-radius: 12px;
  background: var(--midnight-2);
  text-align: center;
}

.confirmation h2 { color: var(--midnight-ink); }

.faq {
  max-width: var(--measure);
  margin: var(--s8) auto 0;
}

.faq h2 { margin-bottom: var(--s5); }

.faq article {
  padding: var(--s5) 0;
  border-top: 1px solid var(--midnight-rule);
}

.faq p { margin-bottom: 0; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--midnight-rule);
  color: var(--midnight-ink-3);
  font-family: var(--font-mono);
  font-size: var(--text-kicker);
  letter-spacing: 0.04em;
}

.footer p { margin-bottom: 0; color: var(--midnight-ink-3); }

.reveal { opacity: 1; transform: translateY(0); }

.reveal.reveal--pending { opacity: 0; transform: translateY(8px); }

.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
}

@media (max-width: 1023px) {
  .wrap { width: calc(100% - 64px); }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { align-items: center; flex-direction: row; padding-top: var(--s4); padding-bottom: var(--s4); }
  .nav-cta { margin-left: auto; text-align: right; }
  .wrap { width: calc(100% - 40px); }
  .hero { padding-top: var(--s8); }
  .section { padding: 72px 0; }
  .centered { text-align: left; }
  .button { width: 100%; }
  .desktop-note { margin-bottom: var(--s5); }
  .evidence-frame {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .evidence-frame picture { aspect-ratio: 4 / 5; order: 1; }
  .evidence-frame--hero img { height: 114%; object-position: 23% top; }
  .evidence-frame--stage img { object-position: 22% top; }
  .evidence-frame--original img { object-position: 24% top; }
  figcaption { order: 2; padding: 10px 4px 0; }
  .beta-form { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-left: 0; border-right: 0; border-radius: 0; padding: var(--s5) 20px; }
  .footer { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal,
  .reveal.reveal--pending,
  .reveal.reveal--visible { opacity: 1; transform: none; transition: none; }
}
