/* ============================================================
   SCRUPLE — Website Styles
   Swiss International Typographic Style v2
   Black / White / Gray + Red (#FF0000) accent only
   ============================================================ */

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-1: #0a0a0a;
  --gray-2: #141414;
  --gray-3: #1e1e1e;
  --gray-4: #2a2a2a;
  --gray-5: #555555;
  --gray-6: #999999;
  --gray-7: #bbbbbb;
  --gray-8: #dddddd;
  --gray-9: #eeeeee;
  --red: #ff0000;

  --font: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --mono: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;

  --topbar-h: 42px;
  --inbox-w: 280px;
  --panel-w: 380px;
}

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

html {
  height: 100%;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-5); }

/* ── Logo Diamond ────────────────────────────────────────── */

.logo-diamond {
  width: 10px;
  height: 18px;
  background: linear-gradient(160deg, #ff0000 0%, #990000 100%);
  transform: rotate(-15deg);
  display: inline-block;
  flex-shrink: 0;
  animation: diamond-pulse 3s ease-in-out infinite;
}

.logo-diamond.small {
  width: 8px;
  height: 14px;
}

.logo-diamond.large {
  width: 22px;
  height: 38px;
}

@keyframes diamond-pulse {
  0%, 100% { transform: rotate(-15deg) scale(1); opacity: 1; }
  50% { transform: rotate(-15deg) scale(0.8); opacity: 0.6; }
}

/* ════════════════════════════════════════════════════════════
   HERO / LANDING
   ════════════════════════════════════════════════════════════ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 60px 40px;
  scroll-snap-align: start;
}

.hero-content {
  max-width: 560px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero-logo {
  margin-bottom: 8px;
}

.hero-title {
  font-size: 28px;
  font-weight: 200;
  letter-spacing: 8px;
  color: var(--white);
  line-height: 1;
}

.hero-subtitle {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--gray-6);
  margin-top: -16px;
}

.hero-description {
  font-size: 16px;
  color: var(--gray-8);
  line-height: 1.8;
  max-width: 500px;
}

/* CTA Buttons */

.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.cta-btn {
  display: inline-block;
  padding: 14px 36px;
  border: 1px solid var(--gray-5);
  color: var(--gray-8);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.cta-btn:hover {
  border-color: var(--white);
  color: var(--white);
}

.cta-primary:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Frameworks listing */

.hero-frameworks {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.hero-fw {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gray-6);
}

.hero-fw-num {
  font-family: var(--mono);
  color: var(--gray-5);
  margin-right: 4px;
}

/* Research */

.hero-research {
  margin-top: 16px;
  max-width: 440px;
  text-align: left;
}

.research-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-6);
  margin-bottom: 8px;
}

.research-text {
  font-size: 13px;
  color: var(--gray-7);
  line-height: 1.7;
  margin-bottom: 12px;
}

.research-quote {
  font-size: 11px;
  color: var(--gray-6);
  font-style: italic;
  line-height: 1.6;
  border-left: 2px solid var(--gray-4);
  padding-left: 16px;
}

/* Hero cynical messages */

.hero-cynical {
  min-height: 20px;
  margin-top: 8px;
}

.hero-cynical-text {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--red);
  transition: opacity 0.4s ease;
  opacity: 1;
}

/* Scroll indicator */

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  animation: scroll-pulse 2s ease-in-out infinite;
}

.scroll-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-6);
}

.scroll-arrow {
  font-size: 16px;
  color: var(--gray-6);
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.4; transform: translateY(4px); }
}

/* ════════════════════════════════════════════════════════════
   INSTALLATION
   ════════════════════════════════════════════════════════════ */

.install-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  scroll-snap-align: start;
  border-top: 1px solid var(--gray-4);
}

.install-content {
  max-width: 560px;
  width: 100%;
}

.install-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.install-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--white);
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.install-step {
  display: flex;
  gap: 20px;
}

.step-num {
  font-size: 14px;
  font-family: var(--mono);
  color: var(--red);
  flex-shrink: 0;
  width: 28px;
  padding-top: 1px;
}

.step-body {
  flex: 1;
}

.step-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--white);
  margin-bottom: 8px;
}

.step-text {
  font-size: 14px;
  color: var(--gray-8);
  line-height: 1.8;
}

.step-link {
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-5);
  transition: border-color 0.15s;
}

.step-link:hover {
  border-color: var(--red);
  color: var(--red);
}

.step-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-9);
  background: var(--gray-3);
  padding: 1px 6px;
}

.install-note {
  margin-top: 48px;
  padding: 16px 20px;
  border: 1px solid var(--gray-4);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.install-note-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-6);
  flex-shrink: 0;
}

.install-note-text {
  font-size: 13px;
  color: var(--gray-7);
  line-height: 1.7;
}

/* ════════════════════════════════════════════════════════════
   SIMULATOR
   ════════════════════════════════════════════════════════════ */

.simulator {
  height: 100vh;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

/* ── Simulator Top Bar ──────────────────────────────────── */

.sim-topbar {
  height: var(--topbar-h);
  background: var(--black);
  border-bottom: 1px solid var(--gray-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.sim-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--white);
}

.sim-subtitle {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--gray-6);
}

.sim-topbar-center {
  flex: 1;
  text-align: center;
}

.sim-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-5);
}

.sim-topbar-right {
  text-align: right;
}

.sim-credit {
  font-size: 9px;
  color: var(--gray-5);
  font-style: italic;
  letter-spacing: 0.3px;
}

/* ── 3-Panel Layout ─────────────────────────────────────── */

.sim-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── LEFT: Inbox Panel ──────────────────────────────────── */

.inbox-panel {
  width: var(--inbox-w);
  min-width: var(--inbox-w);
  background: var(--black);
  border-right: 1px solid var(--gray-4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-4);
}

.inbox-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-8);
}

.inbox-count {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--gray-6);
}

.email-list {
  flex: 1;
  overflow-y: auto;
}

/* Email items */

.email-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--gray-3);
  position: relative;
}

.email-item:hover { background: var(--gray-2); }

.email-item.active {
  background: var(--gray-2);
  border-left: 2px solid var(--red);
  padding-left: 14px;
}

.email-item.unread .email-item-sender { font-weight: 700; color: var(--white); }
.email-item.unread .email-item-subject { color: var(--white); }

.email-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--white);
}

.email-item.answered::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 5px;
  height: 5px;
  background: var(--red);
}

.email-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.email-item-sender {
  font-size: 11px;
  color: var(--gray-8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-item-date {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--gray-6);
  white-space: nowrap;
  margin-left: 8px;
}

.email-item-subject {
  font-size: 11px;
  color: var(--gray-7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.email-item-preview {
  font-size: 10px;
  color: var(--gray-5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-item-tag {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border: 1px solid var(--gray-5);
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-7);
}

/* ── Ethical Profile ────────────────────────────────────── */

.ethical-profile {
  padding: 14px 16px;
  border-top: 1px solid var(--gray-4);
}

.profile-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--gray-6);
  letter-spacing: 2px;
  margin-bottom: 10px;
  font-family: var(--mono);
}

.profile-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-bar-num {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--gray-6);
  width: 18px;
  flex-shrink: 0;
}

.profile-bar-name {
  font-size: 9px;
  color: var(--gray-6);
  font-family: var(--mono);
  letter-spacing: 0.5px;
  width: 70px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-bar-bg {
  flex: 1;
  height: 2px;
  background: var(--gray-3);
  overflow: hidden;
}

.profile-bar-fill {
  height: 100%;
  background: var(--white);
  transition: width 0.5s ease;
}

.profile-bar-fill.dominant {
  background: var(--red);
}

.profile-bar-count {
  font-size: 9px;
  color: var(--gray-6);
  font-family: var(--mono);
  width: 14px;
  text-align: right;
}

.profile-note {
  font-size: 10px;
  color: var(--gray-6);
  margin-top: 10px;
  font-family: var(--mono);
  line-height: 1.5;
}

/* ── CENTER: Email Reader ───────────────────────────────── */

.email-reader {
  flex: 1;
  overflow-y: auto;
  background: var(--black);
  min-width: 0;
}

.email-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
}

.placeholder-text {
  color: var(--gray-6);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.placeholder-sub {
  color: var(--gray-5);
  font-size: 10px;
  font-family: var(--mono);
  font-style: italic;
  max-width: 300px;
  text-align: center;
  line-height: 1.5;
}

.email-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 32px;
}

.email-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-3);
}

.email-subject-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.email-subject {
  font-size: 18px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.3;
  flex: 1;
}

.email-timer {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(255, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.email-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.email-sender-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  flex-shrink: 0;
  background: var(--gray-5);
}

.email-sender {
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
}

.email-to {
  font-size: 10px;
  color: var(--gray-6);
}

.email-date {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--gray-6);
  white-space: nowrap;
}

.email-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-8);
}

.email-body p { margin-bottom: 12px; }

.email-body .dilemma-highlight {
  background: rgba(255, 0, 0, 0.02);
  border-left: 2px solid var(--red);
  padding: 14px 18px;
  margin: 16px 0;
  font-style: italic;
  color: var(--gray-9);
  font-size: 13px;
  line-height: 1.7;
}

/* ── Draft Reply ────────────────────────────────────────── */

.draft-reply {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-4);
}

.draft-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.draft-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-6);
}

.draft-fw-name {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--red);
  letter-spacing: 1px;
  margin-left: auto;
}

.draft-body {
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray-9);
  padding: 16px 0;
  border-top: 1px solid var(--gray-3);
  border-bottom: 1px solid var(--gray-3);
  margin-bottom: 14px;
  min-height: 40px;
  white-space: pre-wrap;
  font-family: var(--font);
}

.draft-meta {
  font-size: 10px;
  color: var(--gray-6);
  font-family: var(--mono);
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid var(--gray-3);
  opacity: 0;
  transition: opacity 0.5s;
}

.draft-meta.visible { opacity: 1; }

/* ── RIGHT: Agent Panel ─────────────────────────────────── */

.agent-panel {
  width: var(--panel-w);
  min-width: var(--panel-w);
  background: var(--black);
  border-left: 1px solid var(--gray-4);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Status bar */

.status-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-4);
  min-height: 38px;
}

.status-text {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--red);
  line-height: 1.5;
  transition: opacity 0.4s ease;
}

/* Diagnosis */

.email-diagnosis {
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-4);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.diagnosis-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gray-6);
  flex-shrink: 0;
}

.diagnosis-text {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--gray-8);
  line-height: 1.5;
}

/* Canvas visualization */

.viz-container {
  padding: 12px 16px 4px;
  border-bottom: 1px solid var(--gray-4);
}

#vizCanvas {
  width: 100%;
  height: auto;
  display: block;
}

.cynical-line {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--gray-6);
  text-align: center;
  padding: 6px 0 8px;
  min-height: 24px;
  letter-spacing: 0.3px;
  transition: color 0.3s;
}

.cynical-line.red { color: var(--red); }

/* Framework cards */

.framework-cards {
  display: flex;
  flex-direction: column;
}

.fw-card {
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--gray-3);
}

.fw-card:hover { background: var(--gray-2); }
.fw-card.active { background: var(--gray-2); padding-bottom: 14px; }

.fw-card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.fw-card-num {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--gray-6);
  flex-shrink: 0;
  width: 18px;
  transition: color 0.15s;
}

.fw-card.active .fw-card-num { color: var(--red); }

.fw-card-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gray-8);
  transition: color 0.15s;
}

.fw-card.active .fw-card-name { color: var(--white); }

.fw-card-sub {
  font-size: 10px;
  color: var(--gray-5);
  font-style: italic;
  margin-left: auto;
}

.fw-card-decision {
  font-size: 11px;
  font-family: var(--mono);
  margin-top: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--gray-3);
  line-height: 1.4;
  color: var(--white);
  display: none;
}

.fw-card.has-data .fw-card-decision { display: block; }

.fw-card-brief {
  font-size: 11px;
  color: var(--gray-7);
  margin-top: 6px;
  line-height: 1.5;
  display: none;
}

.fw-card.active .fw-card-brief { display: block; }

/* Metrics */

.fw-card-metrics {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.fw-card.active .fw-card-metrics { display: flex; }

.mc-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-label {
  font-size: 9px;
  color: var(--gray-6);
  font-family: var(--mono);
  text-transform: uppercase;
  width: 100px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.mc-bar-bg {
  flex: 1;
  height: 2px;
  background: var(--gray-3);
  overflow: hidden;
}

.mc-bar-fill {
  height: 100%;
  background: var(--white);
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}

.fw-card.active .mc-bar-fill { background: var(--red); }

.mc-val {
  font-size: 9px;
  color: var(--gray-6);
  font-family: var(--mono);
  width: 22px;
  text-align: right;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  :root {
    --inbox-w: 240px;
    --panel-w: 340px;
  }
}

@media (max-width: 1000px) {
  :root {
    --inbox-w: 220px;
    --panel-w: 300px;
  }

  .sim-topbar-center { display: none; }
  .sim-credit { display: none; }

  .hero { padding: 60px 24px; }
  .hero-title { font-size: 24px; letter-spacing: 10px; }
  .hero-description { font-size: 15px; }
  .install-section { padding: 60px 24px; }
}

@media (max-width: 800px) {
  .hero { padding: 48px 20px; }
  .hero-content { gap: 20px; }
  .hero-title { font-size: 22px; letter-spacing: 8px; }
  .hero-subtitle { font-size: 10px; letter-spacing: 3px; }
  .hero-description { font-size: 14px; max-width: 100%; }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .cta-btn { width: 100%; max-width: 280px; text-align: center; }

  .hero-frameworks {
    flex-direction: column;
    align-items: center;
  }

  .hero-research { max-width: 100%; }

  .install-section { padding: 48px 20px; }
  .install-content { max-width: 100%; }
  .step-text { font-size: 13px; }
  .install-note { flex-direction: column; gap: 8px; }

  /* Simulator: stack panels vertically */
  .simulator { height: auto; min-height: 100vh; }

  .sim-layout {
    flex-direction: column;
    height: auto;
  }

  .inbox-panel {
    width: 100%;
    min-width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--gray-4);
  }

  .email-reader {
    min-height: 300px;
  }

  .email-content { padding: 20px 16px; }

  .agent-panel {
    width: 100%;
    min-width: 100%;
    border-left: none;
    border-top: 1px solid var(--gray-4);
  }
}

@media (max-width: 480px) {
  .hero { padding: 40px 16px; }
  .hero-title { font-size: 18px; letter-spacing: 6px; }
  .hero-subtitle { font-size: 9px; letter-spacing: 2px; margin-top: -12px; }
  .hero-description { font-size: 13px; }
  .hero-fw { font-size: 9px; }
  .research-text { font-size: 12px; }

  .install-section { padding: 40px 16px; }
  .install-title { font-size: 12px; }
  .step-num { font-size: 12px; }
  .step-title { font-size: 11px; }
  .step-text { font-size: 12px; }
  .install-steps { gap: 24px; }
  .install-step { gap: 14px; }

  .sim-topbar { padding: 0 12px; }
  .sim-title { font-size: 9px; letter-spacing: 2px; }
  .sim-subtitle { display: none; }

  .inbox-panel { max-height: 180px; }
  .email-item { padding: 8px 12px; }

  .email-content { padding: 16px 12px; }
  .email-subject { font-size: 15px; }

  .fw-card { padding: 10px 14px; }
  .mc-label { width: 80px; font-size: 8px; }
}
