/* LoremBuilder website stylesheet.
 * Single-page marketing site. Vanilla CSS, no build step.
 * Design: dark, app-native. Mobile-first with two breakpoints.
 */

/* Inconsolata: same typeface used for the § mark in the app icon. */
@font-face {
  font-family: "Inconsolata";
  src: local("Inconsolata"),
       url("../font/inconsolata-webfont.woff") format("woff"),
       url("../font/inconsolata-webfont.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0B1020;
  --bg-soft: #121832;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #E8ECF3;
  --text-muted: #A8B1C2;
  --text-dim: #7B8598;
  --accent: #4DA3FF;
  --accent-hover: #7CC0FF;
  --danger: #FF6B6B;
  --ok: #7CE38B;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.50), 0 4px 10px rgba(0, 0, 0, 0.35);
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --wrap-max: 1100px;
  --duration: 180ms;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Offsets fragment-anchor scrolling so target sections don't land
     underneath the sticky .site-header (60px tall + 1px border). */
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% 10%, rgba(77, 163, 255, 0.14), transparent 70%),
    radial-gradient(1100px 620px at 10% 90%, rgba(91, 54, 196, 0.18), transparent 70%),
    radial-gradient(1400px 700px at 50% -10%, #162046 0%, transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.6 var(--font-system);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--duration) ease; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

kbd {
  font-weight: 600;
  color: var(--text);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4em;
  font-weight: 680;
}

h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }

/* Wordmark styling: echoes the Inconsolata § in the app icon. */
.brand-name,
#hero-title {
  font-family: "Inconsolata", var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0B1020;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; color: #0B1020; }

/* -------- Header / nav -------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  background: rgba(11, 16, 32, 0.72);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px;
  height: 28px;
}
.site-nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }

@media (max-width: 560px) {
  .site-nav { display: none; }
  .header-inner { justify-content: center; }
}

/* -------- Hero -------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}
.hero-mark {
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
}
.tagline {
  font-size: clamp(20px, 2.4vw, 24px);
  color: var(--text);
  margin: 0 auto 8px;
  max-width: 720px;
  font-weight: 500;
}
.subline {
  color: var(--text-dim);
  margin: 0 auto 28px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.cta-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration) ease, transform var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease;
  line-height: 1.1;
  text-align: center;
}
.btn-primary {
  background: var(--accent);
  color: #0B1020;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0B1020; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-ghost-accent {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost-accent:hover {
  background: var(--accent);
  color: #0B1020;
  border-color: var(--accent);
}

/* Custom "Download on the Mac App Store" button.
 * Uses the text-only badge SVG as a CSS mask so the fill colour follows
 * the button's text colour, enabling a clean hover inversion.
 */
.btn-mas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: transparent;
  transition: background var(--duration) ease, color var(--duration) ease;
  line-height: 0;
}
.btn-mas:hover {
  background: var(--accent);
  color: #0B1020;
}
.btn-mas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.mas-text-icon {
  display: block;
  width: 195px;
  height: 50px;
  fill: currentColor;
}

@media (max-width: 560px) {
  .btn-mas { padding: 12px 22px; }
  .mas-text-icon { width: 156px; height: 40px; }
}

/* -------- Feature sections -------- */
.feature {
  padding: 64px 0;
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.feature-reverse .feature-row {
  grid-template-columns: 1.2fr 1fr;
}
.feature-reverse .feature-copy { order: 2; }
.feature-reverse .feature-figure { order: 1; }

.feature-copy p {
  color: var(--text-muted);
  margin: 0;
  font-size: 17px;
}

.feature-figure {
  margin: 0;
}
.feature-figure img {
  width: 100%;
  aspect-ratio: 1440 / 900;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-soft);
  cursor: zoom-in;
  transition: transform var(--duration) ease, box-shadow var(--duration) ease;
}
.feature-figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.45);
}
.feature-figure.stack {
  display: grid;
  gap: 20px;
}

@media (max-width: 900px) {
  .feature-row,
  .feature-reverse .feature-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-reverse .feature-copy { order: 0; }
  .feature-reverse .feature-figure { order: 0; }
}

@media (max-width: 560px) {
  .feature { padding: 40px 0; }
  .hero { padding: 48px 0 32px; }
  .hero-mark { width: 120px; height: 120px; }
}

/* -------- Privacy card -------- */
.privacy-card {
  margin: 24px 0;
  padding: 48px 0;
}
.privacy-card .wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.privacy-card h2 { margin-top: 0; }
.privacy-card p {
  color: var(--text-muted);
  margin: 0 0 14px;
  max-width: 68ch;
}
.privacy-card p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .privacy-card .wrap { padding: 28px 22px; }
}

/* -------- Download section -------- */
.download {
  padding: 72px 0;
  text-align: center;
}
.dl-inner h2 { margin-bottom: 8px; }
.dl-meta {
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.02em;
  margin: 0 0 28px;
}

/* -------- Contact form -------- */
.contact {
  padding: 56px 0 80px;
}
.contact p {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 28px;
}
#contact-form {
  display: grid;
  gap: 18px;
  max-width: 560px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.field label .optional {
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}
.field input,
.field textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  transition: border-color var(--duration) ease, background var(--duration) ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-hover);
}
.field textarea { resize: vertical; min-height: 140px; }

.field.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 14px;
}
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* -------- Footer -------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-dim);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: center;
}
.site-footer .copy { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* -------- Email copy button -------- */
.email-copy {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration) ease;
}
.email-copy:hover { color: var(--accent-hover); }
.email-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.email-copy.is-copied { color: var(--ok); }

/* Inline, visible email address assembled from obfuscated parts by site.js.
 * Pre-JS: innerHTML is a non-address placeholder ("email support"). Post-JS:
 * innerHTML is the real address with CSS-hidden "noise" spans woven in so
 * a raw text scrape yields garbage, while human selection/copy returns the
 * clean string (display:none nodes are excluded from Selection ranges).
 */
.email-addr {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration) ease;
}
.email-addr:hover { color: var(--accent-hover); }
.email-addr .spam { display: none; }

/* -------- Lightbox -------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(11, 16, 32, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-img {
  max-width: min(92vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.65);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration) ease, transform var(--duration) ease;
}
.lightbox-close:hover { background: rgba(0, 0, 0, 0.6); }
.lightbox-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

body.lightbox-open { overflow: hidden; }

/* -------- Utilities -------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
