/* CEDAR ERP Simulation — Container & Layout */

/* Override page-single constraints for this page */
.page-single:has(#cedar-erp-container) {
  max-width: 100%;
  padding: 0;
}
.page-header:has(+ .page-content #cedar-erp-container),
.page-single:has(#cedar-erp-container) > .page-header {
  display: none;
}

#cedar-erp-container {
  /* Break out of .page-single max-width */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
  min-height: calc(100vh - 100px);
  background: var(--color-bg, #fff);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  padding: 0 4rem 0 0;
}

/* ===== Premise banner — ABOVE the container ===== */
.cedar-premise-banner {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  text-align: center;
  padding: 48px 24px 24px;
}

.cedar-premise-main {
  font-family: var(--font-sans);
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  text-transform: uppercase;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--color-text, #0f172a);
}

/* Cycling word */
.cedar-cycle-wrapper {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: bottom;
  text-decoration: underline;
  text-decoration-thickness: 4px;
  text-underline-offset: 6px;
  text-decoration-color: var(--color-accent, #3b82f6);
}

.cedar-cycle-word {
  display: inline-block;
  will-change: transform, opacity;
}

/* Demo label — right below the CRT */
.cedar-demo-label {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text, #0f172a);
  opacity: 0.4;
  text-align: center;
  margin-top: 24px !important;
  padding-top: 8px;
  width: 100%;
}

@media (min-width: 992px) {
  .cedar-premise-main {
    font-size: var(--text-6xl);
  }
}

/* Stacked on narrow */
@media (max-width: 1199px) {
  #cedar-erp-container {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0 20px 40px;
    gap: 24px;
    min-height: auto;
  }
  .cedar-premise-banner {
    padding: 24px 16px 8px;
  }
}

#cedar-erp-container.cedar-exiting,
.cedar-premise-banner:has(+ #cedar-erp-container.cedar-exiting) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#cedar-erp-container.cedar-gone,
.cedar-premise-banner:has(+ #cedar-erp-container.cedar-gone) {
  display: none;
}

/* ===== Narrative panel ===== */
.cedar-narr-panel {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1199px) {
  .cedar-narr-panel {
    padding: 0;
    text-align: center;
    order: -1;
  }
}

.cedar-narr-text {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--color-text, #0f172a);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  opacity: 0;
  transform: translateY(calc(-50% + 12px));
  transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
  position: absolute;
  text-align: center;
  width: max-content;
  max-width: 90%;
}

@media (max-width: 1199px) {
  .cedar-narr-text {
    position: relative;
  }
}

.cedar-narr-text.cedar-narr-visible {
  opacity: 1;
  transform: translateY(0);
}

.cedar-narr-text.cedar-narr-fading {
  opacity: 0;
  transform: translateY(-8px);
}

.cedar-narr-subtext {
  display: block;
  font-size: clamp(15px, 1.3vw, 20px);
  font-weight: 400;
  color: var(--color-text-muted, rgba(15,23,42,0.45));
  margin-top: 12px;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

/* Punchline */
.cedar-punchline {
  opacity: 0;
  transform: translateY(calc(-50% + 12px));
  transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1);
  position: absolute;
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: 90%;
}

@media (max-width: 1199px) {
  .cedar-punchline {
    position: relative;
    padding: 0;
    text-align: center;
  }
}

.cedar-punchline.cedar-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cedar-punchline-inner {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: clamp(32px, 3.2vw, 52px);
  font-weight: 900;
  color: var(--color-text, #0f172a);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cedar-punchline-inner em {
  font-style: normal;
  color: #3b82f6;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.cedar-punchline-sub {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 400;
  color: var(--color-text-muted, rgba(15,23,42,0.5));
  margin-top: 16px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.cedar-see-how {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: white;
  cursor: pointer;
  padding: 12px 32px !important;
  border: none;
  border-radius: 6px;
  background: var(--color-text, #0f172a);
  transition: all 0.2s ease;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.cedar-see-how:hover {
  background: var(--color-accent, #3b82f6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===== CRT Monitor Frame ===== */
.cedar-crt-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.cedar-crt-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.cedar-crt {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(
    170deg,
    #d4cfc4 0%,
    #c8c2b4 15%,
    #beb8a8 40%,
    #b0a998 70%,
    #a39c8c 100%
  );
  border-radius: 18px 18px 12px 12px;
  padding: 32px 38px 52px 38px !important;
  box-shadow:
    0 8px 60px rgba(0,0,0,0.12),
    0 2px 20px rgba(0,0,0,0.08),
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -3px 0 rgba(0,0,0,0.1),
    inset 2px 0 0 rgba(255,255,255,0.25),
    inset -2px 0 0 rgba(0,0,0,0.05);
  /* Scale to fit — the wrapper handles layout size */
  transform-origin: center center;
  transform: scale(var(--cedar-scale, 1));
}

.cedar-crt-bezel {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 50%, #111 100%);
  border-radius: 6px;
  padding: 8px !important;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.8),
    inset 0 0 2px rgba(0,0,0,0.5);
}

.cedar-crt-brand {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(80, 76, 68, 0.5);
  user-select: none;
}

.cedar-crt-led {
  position: absolute;
  bottom: 20px;
  right: 48px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ecc40;
  box-shadow: 0 0 4px #2ecc40, 0 0 8px rgba(46, 204, 64, 0.3);
  animation: cedar-led-pulse 3s ease-in-out infinite;
}

@keyframes cedar-led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.cedar-crt-power {
  position: absolute;
  bottom: 16px;
  right: 80px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #9a9488 0%, #7a7468 100%);
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ===== Screen ===== */
.cedar-screen {
  width: 1024px;
  height: 768px;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  flex-shrink: 0;
}

.cedar-screen.cedar-crt-off {
  background: #000 !important;
}
.cedar-screen.cedar-crt-off > * {
  visibility: hidden !important;
}
.cedar-screen.cedar-crt-off::after,
.cedar-screen.cedar-crt-off::before {
  display: none;
}

.cedar-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  border-radius: 3px;
}

.cedar-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  border-radius: 3px;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.15),
    inset 0 0 20px rgba(0,0,0,0.1);
}

/* ===== Auto-pilot cursor ===== */
.cedar-autopilot-cursor {
  position: absolute;
  width: 12px;
  height: 19px;
  z-index: 9999;
  pointer-events: none;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}

/* ===== Mobile — hide entire CEDAR section (desktop-only experience) ===== */
@media (max-width: 767px) {
  #cedar-erp-container,
  .cedar-premise-banner {
    display: none;
  }
}
