:root {
  --bg-color: #f2f2ed;
  --fg-color: #000000;
  --border-color: #000000;
  --grey-color: #e5e7eb;
  --accent-green: #22c55e;
  --font-serif: 'EB Garamond', serif;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Inter', sans-serif;
  --font-pixel: 'Pixelify Sans', cursive;
  --border-thin: 1px solid var(--border-color);
  --border-thick: 2px solid var(--border-color);
}

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

body {
  background-color: var(--bg-color);
  color: var(--fg-color);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#halftone-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 1;
  pointer-events: auto;
}

.noise-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 2;
  pointer-events: none;
  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)' opacity='0.03'/%3E%3C/svg%3E");
}

.app-wrapper {
  position: relative;
  z-index: 10;
  background: rgba(242, 242, 237, 0.95);
  backdrop-filter: blur(10px);
  border: var(--border-thin);
  width: 100%;
  max-width: 1400px;
  min-height: calc(100vh - 4rem);
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1);
}

.header {
  border-bottom: var(--border-thin);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
}

.header-logo {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
}

.logo-sub {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: #888;
  margin-left: 0.4rem;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: white;
  border: var(--border-thin);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.status-dot {
  width: 8px; height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.lang-btn {
  border: var(--border-thin);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active, .lang-btn:hover {
  background: var(--fg-color);
  color: var(--bg-color);
}

.content {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 1.5rem;
}

.description-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.description-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.6;
  color: #111;
}

.description-text em {
  font-style: italic;
}

.terminals-wrapper {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.arrow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border-color);
}

.bidirectional-arrow {
  width: 100px;
  height: 60px;
}

.arrow-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.arrow-ltr {
  animation: drawArrow 2s ease-in-out infinite;
}

.arrow-rtl {
  animation: drawArrow 2s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes drawArrow {
  0% { stroke-dashoffset: 100; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { stroke-dashoffset: -100; opacity: 0; }
}

.install-section {
  display: flex;
  justify-content: center;
  padding: 0 2rem;
  margin-top: 3.5rem;
}

.install-section .code-block {
  max-width: 600px;
  width: 100%;
}

.code-block {
  border: var(--border-thin);
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.code-block:hover { box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.15); }

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 1.25rem;
  color: #111;
  flex: 1;
}

.btn-copy {
  border: none;
  border-left: var(--border-thin);
  background: var(--grey-color);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover { background: #d1d5db; }

.graphic-terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
  background: white;
  border: var(--border-thick);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.graphic-terminal:hover {
  box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.15);
}

.terminal-input {
  border-top: var(--border-thin);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fafafa;
}

.input-prompt {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #888;
  user-select: none;
}

.terminal-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #222;
  outline: none;
}

.terminal-input input::placeholder {
  color: #aaa;
}

.terminal-header {
  border-bottom: var(--border-thin);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  background: var(--grey-color);
  align-items: center;
}

.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: var(--border-thin);
  background: white;
}

.terminal-title {
  margin-left: auto; margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #444;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: white;
  color: #222;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; border-left: var(--border-thin); }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border-color); }

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .terminals-wrapper { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .arrow-connector { padding: 1rem 0; transform: rotate(90deg); }
  .app-wrapper { border-left: none; border-right: none; }
  .content { padding: 1rem; }
  .graphic-terminal { height: 350px; min-height: 350px; max-height: 350px; }
}

/* Terminal Message Styles - CLI Style */
.cli-message {
  margin-bottom: 0.5rem;
  animation: slideUpFade 0.2s forwards;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.cli-message-sent {
  color: #059669;
}

.cli-message-received {
  color: #2563eb;
}

.cli-message-system {
  color: #888;
}

.cli-timestamp {
  color: #888;
  font-size: 0.7rem;
}

.cli-prompt-inline {
  color: #888;
  margin-right: 0.5rem;
}

.cli-arrow {
  color: #888;
  margin: 0 0.25rem;
}
