/*
 * Shared application styles for Rogue Cortex marketing site.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #eeeeee;
  color: #222222;
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
}

/* ── Preview Bar ── */

.preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #f5a623;
  color: #5a3600;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 0;
}

.preview-bar ~ header {
  top: 22px;
}

/* ── Header ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #eeeeee;
  border-bottom: 1px solid #dcdcdc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: inherit;
  text-decoration: none;
}
.brand img {
  filter: brightness(0);
}

.menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu a {
  color: #222222;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
}

.menu a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Main content offset for fixed header ── */
main {
  flex: 1;
  margin-top: 57px;
}

/* ── Footer ── */
footer {
  padding: 32px 0 24px;
  border-top: 1px solid #d5d5d5;
  background: #e6e6e6;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 48px;
  width: min(1200px, 92vw);
  margin: 0 auto 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666666;
  margin-bottom: 4px;
}

footer a {
  color: #222222;
  text-decoration: none;
  font-size: 0.95rem;
}

footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copy {
  text-align: center;
  font-size: 0.85rem;
  color: #888888;
  border-top: 1px solid #d5d5d5;
  padding-top: 20px;
}

/* ── Contact ── */
.contact-wrap {
  width: min(760px, 92vw);
  margin: 0 auto;
  padding: 80px 0 72px;
}

.contact-header {
  margin-bottom: 48px;
}

.contact-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.contact-header p {
  font-size: 1rem;
  line-height: 1.7;
  color: #555555;
  max-width: 560px;
  margin: 0;
}

.contact-flash {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-flash-success {
  background: #e6f4ea;
  border: 1px solid #b6dec3;
  color: #1d5b32;
}

.contact-flash-error {
  background: #fdecec;
  border: 1px solid #f0bdbd;
  color: #8a1f1f;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 560px) {
  .contact-row {
    grid-template-columns: 1fr;
  }
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333333;
}

.contact-required {
  color: #b00;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.97rem;
  color: #222222;
  background: #f8f8f8;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: #aaaaaa;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: #222222;
  background: #ffffff;
}

.contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-note {
  font-size: 0.85rem;
  color: #888888;
  margin: 0;
}

.contact-submit {
  padding: 12px 28px;
  background: #222222;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.contact-submit:hover {
  background: #444444;
}

/* ── Preview Gate ── */
.preview-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fafafa;
  color: #1a1a2e;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.preview-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex: 1;
  padding: 48px 24px;
}

.preview-countdown {
  text-align: center;
}

.preview-countdown-clock {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 2vw, 24px);
}

.preview-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.4em;
  font-size: clamp(2rem, 10vw, 8rem);
}

.preview-countdown-value,
.preview-countdown-sep {
  font-size: clamp(2rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #1a1a2e;
}

.preview-countdown-sep {
  color: #cccccc;
}

.preview-countdown-label {
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888888;
}

.preview-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  font-size: 0.8125rem;
  color: #888888;
  border-top: 1px solid #ececec;
  background: #ffffff;
}

.preview-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
}

.preview-footer a {
  color: #555555;
  text-decoration: none;
}

.preview-footer a:hover {
  color: #222222;
  text-decoration: underline;
}

.preview-footer-sep {
  color: #c8c8c8;
}

.preview-gate-box {
  background: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  padding: 32px 40px;
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: end;
}

.preview-gate-col {
  min-width: 0;
}


.preview-gate-error {
  width: 100%;
  max-width: 920px;
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  border-radius: 6px;
  color: #c0392b;
  font-size: 0.875rem;
  padding: 10px 14px;
  margin-bottom: -24px;
}

.preview-gate-notice {
  width: 100%;
  max-width: 920px;
  background: #efffef;
  border: 1px solid #b2d8b2;
  border-radius: 6px;
  color: #2a7a2a;
  font-size: 0.875rem;
  padding: 10px 14px;
  margin-bottom: -24px;
}

.preview-gate-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  gap: 12px;
  color: #aaaaaa;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.preview-gate-divider::before,
.preview-gate-divider::after {
  content: "";
  flex: 1;
  width: 1px;
  background: #e4e4e4;
}

.preview-gate-secondary-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #222222;
}

.preview-gate-secondary-subtitle {
  font-size: 0.875rem;
  color: #666666;
  margin: 0 0 16px;
  line-height: 1.5;
}

.preview-gate-submit-secondary {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 12px 20px;
  background: #ffffff;
  color: #222222;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.preview-gate-submit-secondary:hover {
  background: #f4f4f4;
  border-color: #999999;
}

.preview-gate-form {
  display: flex;
  gap: 10px;
}

.preview-gate-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: #f8f8f8;
  color: #222222;
  outline: none;
  transition: border-color 0.15s;
}

.preview-gate-input:focus {
  border-color: #222222;
  background: #ffffff;
}

.preview-gate-submit {
  flex-shrink: 0;
  padding: 12px 24px;
  background: #222222;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.preview-gate-submit:hover {
  background: #444444;
}

@media (max-width: 720px) {
  .preview-countdown-clock { gap: 6px; }
  .preview-countdown-label { font-size: 0.6rem; letter-spacing: 0.08em; }
  .preview-gate-box {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 24px;
  }
  .preview-gate-divider {
    flex-direction: row;
  }
  .preview-gate-divider::before,
  .preview-gate-divider::after {
    width: auto;
    height: 1px;
  }
}

/* ── Cookie consent banner ── */

.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1000;
  background: #222222;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
  min-width: 240px;
}

.cookie-banner-text a {
  color: #f5a623;
  text-decoration: underline;
}

.cookie-banner-text a:hover { color: #ffffff; }

.cookie-banner-accept {
  flex-shrink: 0;
  padding: 8px 16px;
  background: #ffffff;
  color: #222222;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cookie-banner-accept:hover {
  background: #f5a623;
  color: #222222;
}

/* ── Motion: scroll reveals (see app/javascript/motion.js) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ── Animated illustration panels (see app/javascript/scenes/) ── */
.scene-panel {
  background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #f1f3f7 75%) !important;
  padding: clamp(12px, 2vw, 28px);
}
.rc-scene {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
}
.rc-scene text { font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif; }
.rc-scene .mono { font-family: "JetBrains Mono", Menlo, Consolas, monospace; }

/* ── Motion: dark hero banners ──
   Classes for the hand-drawn hero SVGs. Wrap a positioned group in another
   <g> carrying the class, because a CSS transform replaces an SVG transform
   attribute on the same element. */
.hero-drift { animation: hero-drift 26s ease-in-out infinite alternate; }
@keyframes hero-drift { from { transform: translate(-18px, 6px); } to { transform: translate(18px, -6px); } }

.hero-float { animation: hero-float 6s ease-in-out infinite; }
.hero-float.d1 { animation-delay: -1s; } .hero-float.d2 { animation-delay: -2s; } .hero-float.d3 { animation-delay: -3s; }
.hero-float.d4 { animation-delay: -4s; } .hero-float.d5 { animation-delay: -5s; }
@keyframes hero-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.hero-spin { transform-box: fill-box; transform-origin: center; animation: hero-spin 9s linear infinite; }
@keyframes hero-spin { to { transform: rotate(360deg); } }

.hero-glow { animation: hero-glow 3.2s ease-in-out infinite; }
.hero-glow.d1 { animation-delay: -1s; } .hero-glow.d2 { animation-delay: -2s; }
@keyframes hero-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-flow { stroke-dasharray: 5 4; animation: hero-flow 1.4s linear infinite; }
@keyframes hero-flow { to { stroke-dashoffset: -18; } }

.hero-node { transform-box: fill-box; transform-origin: center; animation: hero-node 3.2s ease-in-out infinite; }
.hero-node:nth-child(2n) { animation-delay: -1.1s; }
.hero-node:nth-child(3n) { animation-delay: -2.2s; }
@keyframes hero-node { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

.hero-hub { transform-box: fill-box; transform-origin: center; animation: hero-hub 4s ease-in-out infinite; }
@keyframes hero-hub { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.5); opacity: 0.25; } }

.hero-ripple { transform-box: fill-box; transform-origin: center; animation: hero-ripple 7s ease-out infinite; }
.hero-ripple.d1 { animation-delay: -1.4s; } .hero-ripple.d2 { animation-delay: -2.8s; }
.hero-ripple.d3 { animation-delay: -4.2s; } .hero-ripple.d4 { animation-delay: -5.6s; }
@keyframes hero-ripple { 0% { transform: scale(0.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-drift, .hero-float, .hero-spin, .hero-glow, .hero-flow, .hero-node, .hero-hub, .hero-ripple { animation: none; }
  .hero-pulses { display: none; }
}

/* Paused while off screen (see pauseOffscreen in app/javascript/motion.js) */
.motion-paused, .motion-paused * { animation-play-state: paused !important; }
