/* Landfall — Production Styles
   Intent: Institutional Confidence. Challenger Aggression.
   System: Architectural Physics (Layered Shadows) + Materiality (Grain).
*/

/* ---------- tokens ---------- */
:root {
  /* paper + ink */
  --bg: #FBFAF8; 
  --ink: #050505;
  --muted: rgba(10, 10, 10, 0.62);
  --muted-2: rgba(10, 10, 10, 0.48);

  /* tonal architecture */
  --surface-0: #FFFFFF;
  --surface-1: #F6F5F2;
  --surface-2: #EFEDEA;

  /* The Blue Stack: "Electric Heritage" */
  --naval: #0B1F3B;   /* Deep authoritative base */
  --signal: #16468E;  /* Rich cobalt signal */

  /* structure */
  --hairline: rgba(11, 31, 59, 0.10);
  --hairline-strong: rgba(11, 31, 59, 0.18);
  
  /* radii */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;

  /* layout - Tighter/Editorial Measure */
  --container: 980px;

  /* type scale */
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --lh: 1.55;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1; /* Establish stacking context above grain */
}

/* TEXTURE: The Paper Grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* FIXED: Below content, not above modals */
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-size: 200px 200px; /* FIXED: Tile for performance */
  mix-blend-mode: multiply; /* Optional: More paper-like */
}

/* Kill grain on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* SELECTION: Brand detail */
::selection {
  background: var(--signal);
  color: #fff;
}

/* ACCESSIBILITY: Consistent focus ring */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

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

a {
  color: var(--ink);  /* Neutral, not Naval */
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hairline-strong);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { 
  color: var(--signal);  /* Signal on hover */
  text-decoration-color: var(--signal);
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.prose {
  max-width: 66ch;
}

.prose p {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose strong {
  color: var(--naval);
  font-weight: 600; /* FIXED: 650 → 600 for consistency */
}

/* Stat line: inline emphasis with Signal accent */
.stat-line {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--naval);
  line-height: 1.35;
  margin: 0 0 1.25rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--signal);
}

/* ---------- skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--surface-0);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  z-index: 999;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 10;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

.brand__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700; /* FIXED: 650 → 700 */
  letter-spacing: -0.02em;
  color: var(--naval);
}

/* ---------- typography ---------- */
.h1 {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 7vw, 5rem);
  line-height: 0.92;
  margin: 0 0 1.5rem 0;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--naval);
  /* Note: Removed transform: translateX(-0.04em) to avoid blur on some displays */
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 1.25rem 0;
  font-weight: 600; /* FIXED: 650 → 600 */
  letter-spacing: -0.04em;
  color: var(--naval);
}

.subhead {
  font-size: 1.25rem;
  line-height: 1.48;
  color: var(--ink);
  opacity: 0.8;
  max-width: 50ch;
  margin: 0 0 1.5rem 0;
}

.trust-line {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
  border-left: 2px solid var(--hairline-strong);
  padding-left: 1rem;
  max-width: 54ch;
}

/* Editorial Eyebrow: Lowercase + wide tracking */
.kicker, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  margin-bottom: 1rem;
  text-transform: lowercase;
  font-weight: 600;
}
.kicker::before, .eyebrow::before {
  content: "";
  width: 18px;  /* Back to subtle */
  height: 1px;
  background: var(--signal);
}

/* ---------- global rhythm ---------- */
.section { padding: 4.5rem 0; }
@media (min-width: 768px) { .section { padding: 7.5rem 0; } }

/* ---------- architectural objects ---------- */

/* BEREAL SHOWCASE: Two-column layout */
.bereal-showcase {
  margin: 3rem 0 2.5rem 0;
  display: grid;
  grid-template-columns: 280px 1fr;  /* Smaller phone: 280px instead of 320px */
  gap: 3.5rem;  /* More breathing room */
  align-items: start;
}

.bereal-showcase__visual {
  position: relative;
}

.bereal-showcase__content {
  padding-top: 0.5rem;
}

.bereal-showcase__content p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Tight stacking for consecutive strong emphasis lines */
.bereal-showcase__content p:has(strong) {
  margin-bottom: 0.15rem;  /* Even tighter: ~2.4px */
}

.bereal-showcase__content p:has(strong) + p:not(:has(strong)) {
  margin-top: 1rem;  /* Space before non-emphasis content */
}

.bereal-showcase__content strong {
  color: var(--naval);  /* Back to Naval */
  font-weight: 700;
  font-size: 1.1875rem;
}

/* Phone frame within showcase */
.bereal-showcase .bereal-frame {
  position: relative;
  max-width: 100%;
  width: 100%;
}

.bereal-showcase .bereal-frame::before {
  content: "";
  position: absolute;
  inset: -12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.8), rgba(246,245,242,0.6));
  border-radius: 32px;
  z-index: -1;
  border: 1px solid rgba(11,31,59,0.08);
  box-shadow: 
    0 2px 0 rgba(11,31,59,0.04),
    0 12px 32px rgba(10,10,10,0.08);
}

.bereal-showcase .bereal-phone {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: contain;
  border-radius: 28px;
  border: 1px solid rgba(10,10,10,0.12);
  background: #000;
  box-shadow: 0 32px 72px rgba(10,10,10,0.10);
  display: block;
}

/* Stack on mobile */
@media (max-width: 768px) {
  .bereal-showcase {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2.5rem 0 2rem 0;
  }
  
  .bereal-showcase__visual {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Legacy bereal-moment removed - using showcase layout now */

/* ---------- components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.65rem;
  border-radius: var(--r);
  font-size: 1rem;
  font-weight: 600; /* FIXED: 650 → 600 */
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1),
              border-color 0.2s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease; /* FIXED: Not 'all' */
}

.btn--primary {
  background: var(--naval);  /* Back to Naval */
  color: #fff;
  border: 1px solid var(--naval);
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 10px 20px -5px rgba(11,31,59,0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  background: var(--signal);  /* Signal on hover */
  border-color: var(--signal);
  box-shadow: 
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 20px 30px -10px rgba(22,70,142,0.35);
}
}

.btn--primary:active {
  transform: translateY(0);
  background: var(--naval);
  border-color: var(--naval);
}

.cta-row {
  margin-top: 2rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.app-badges {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  align-items: center;
}

.app-badges a {
  display: block;
  line-height: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.app-badges a:hover {
  opacity: 0.82;
  transform: translateY(-1px);
  text-decoration: none;
}

.app-badge {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ---------- hero rhythm overrides ---------- */
.hero {
  position: relative;
  padding-top: 5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 80% -10%,
    rgba(11, 31, 59, 0.08),
    transparent 50%
  );
  z-index: -1;
}

.hero .kicker { margin-bottom: 1.15rem; }
.hero .h1 { margin-bottom: 0.85rem; }
.hero .subhead { margin-bottom: 2rem; }
.hero .trust-line { margin-bottom: 2.25rem; }
.hero .cta-row { margin-top: 0; }

/* ---------- slabs & surfaces ---------- */
.surface {
  background: rgba(246,245,242,0.55);
  border-top: 1px solid rgba(11, 31, 59, 0.06);
  border-bottom: 1px solid rgba(11, 31, 59, 0.06);
}

.section-slab { 
  background: var(--surface-1);
  border: 0;
}

.section-slab--alt { 
  background: #F1F4F9;
}

/* ---------- lists & notes ---------- */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
}

.feature-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding: 1.25rem;
  border-top: 1px solid var(--hairline);
}
.feature-list li:first-child { border-top: 0; }

.feature-list strong {
  font-weight: 700;
  color: var(--naval);
}

.feature-list span {
  color: var(--muted);
}

.small-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ---------- forms ---------- */
.form-placeholder {
  margin-top: 2rem;
  max-width: 100%;
  border-radius: var(--r-lg);
  border: 1px dashed rgba(11,31,59,0.22);
  background: rgba(255,255,255,0.62);
  min-height: 240px;
  opacity: 0.9;
}

/* ---------- ai search specifics ---------- */
.hero--ai {
  padding-bottom: 10rem;
}

.hero--ai::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, var(--hairline-strong), transparent);
}

.prompt-surface {
  margin: 2rem 0 3rem 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline-strong);
  background: #fff;
  overflow: hidden;
  box-shadow: 
    0 22px 56px rgba(10,10,10,0.08),
    0 2px 0 rgba(11,31,59,0.06);
}

.prompt-surface__top {
  padding: 0.9rem 1.1rem;
  background: #F1F4F9;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-surface__label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10,10,10,0.50);
  font-weight: 600;
}

.prompt-stream {
  padding: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
  min-height: 240px;
}

.prompt-line {
  display: flex;
  gap: 0.55rem;
  padding: 0.15rem 0;
}

.prompt-caret {
  color: var(--signal);
  font-weight: 700;
}

.prompt-text {
  white-space: pre-wrap;
}

.prompt-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  margin-left: 2px;
  background: var(--signal);
  transform: translateY(2px);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.prompt-surface__bottom {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--hairline);
  background: rgba(241,244,249,0.55);
}

.prompt-footer {
  font-size: 0.92rem;
  color: rgba(10,10,10,0.58);
}

.hero-punch {
  margin-top: 4rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--naval);
  border-top: 2px solid var(--signal);
  padding-top: 2rem;
  max-width: 30ch;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2.25rem 0;
  background: rgba(246,245,242,0.75);
  margin-top: 2.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.75rem;
  align-items: start;
  max-width: none;  /* Override prose constraint for footer */
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;  /* Allow text to wrap properly */
}

.footer-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600; /* FIXED: 650 → 600 */
  letter-spacing: -0.02em;
}

.footer-legal {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-link {
  font-size: 0.875rem;
  color: rgba(10,10,10,0.56);
  transition: color 0.2s ease; /* FIXED: Not 'all' */
}
.footer-link:hover {
  color: var(--signal);
  text-decoration: none;
}

/* ---------- responsive refinements ---------- */
@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 520px) {
  .app-badge {
    height: 40px;
  }
  
  .feature-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn--primary:hover {
    transform: none;
  }
  
  .prompt-cursor {
    animation: none !important;
  }
}
