/* ========================================================
   THE WRITER — Marketing Website Styles
   ======================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #1a1a1a;
  --bg-section: #242424;
  --bg-card: #2D2D2D;
  --text-primary: #E0E0E0;
  --text-secondary: #888888;
  --accent: #D4A853;
  --paper: #F5F0E8;
  --chrome: #C0C0C0;
  --key-bg: #1A1A1A;
  --key-ring: #A0A0A0;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Special Elite', cursive;
  --font-mono: 'Courier Prime', 'Courier New', Courier, monospace;
  --max-width: 1100px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
strong { font-weight: 700; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section--dark { background: var(--bg-dark); }
.section--alt  { background: var(--bg-section); }

.section__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
  margin-bottom: 56px;
  color: var(--text-primary);
}

/* --- Fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================================
   1. HERO
   ======================================================== */
#hero {
  padding: 140px 0 100px;
  text-align: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-style: italic;
}

/* CSS Typewriter Mockup */
.mockup {
  width: 100%;
  max-width: 560px;
  margin-bottom: 48px;
}

.mockup__screen {
  background: var(--bg-card);
  border-radius: 8px 8px 0 0;
  padding: 32px 24px;
  border: 1px solid #3a3a3a;
  border-bottom: none;
}

.mockup__paper {
  background: var(--paper);
  border-radius: 4px;
  padding: 32px 28px;
  min-height: 100px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.mockup__text {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #333;
  line-height: 1.8;
}

.mockup__cursor {
  animation: blink 1s step-end infinite;
  color: #333;
  font-weight: 700;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.mockup__keyboard {
  background: var(--bg-card);
  border-radius: 0 0 8px 8px;
  padding: 16px 24px 20px;
  border: 1px solid #3a3a3a;
  border-top: 1px solid #333;
}

.mockup__key-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.mockup__key {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--key-bg);
  border: 2px solid var(--key-ring);
  color: var(--chrome);
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.hero__ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}

.hero__linux {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #111;
}
.btn--primary:hover {
  background: #e0b564;
  box-shadow: 0 4px 16px rgba(212,168,83,0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--text-secondary);
}
.btn--secondary:hover {
  border-color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.btn--lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn--play {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 10px 24px;
  font-size: 0.9rem;
}
.btn--play:hover {
  background: rgba(212,168,83,0.1);
}
.btn--play.is-playing {
  background: rgba(212,168,83,0.15);
  border-color: var(--accent);
}

.btn__icon {
  flex-shrink: 0;
}

/* ========================================================
   2. INTERACTIVE DEMO
   ======================================================== */
.demo {
  max-width: 640px;
  margin: 0 auto;
}

.demo__frame {
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  border: 1px solid #3a3a3a;
}

.demo__paper-wrap {
  padding: 28px 24px;
}

.demo__paper {
  background: var(--paper);
  border-radius: 4px;
  padding: 28px 24px;
  min-height: 160px;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.75;
  color: #222;
  outline: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  cursor: text;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.demo__paper:empty::before {
  content: attr(data-placeholder);
  color: #999;
  font-style: italic;
  pointer-events: none;
}

.demo__keys {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 12px 24px 18px;
  border-top: 1px solid #3a3a3a;
  background: var(--bg-card);
}

.demo__key {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--key-bg);
  border: 2px solid var(--key-ring);
  color: var(--chrome);
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.06s ease;
  user-select: none;
}

.demo__key.is-pressed {
  transform: translateY(2px) scale(0.95);
  background: #2a2a2a;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(212,168,83,0.3);
}

.demo__hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* ========================================================
   3. FEATURES GRID
   ======================================================== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 32px 28px;
  border: 1px solid #3a3a3a;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212,168,83,0.08);
}

.feature-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.feature-card__list {
  list-style: none;
}

.feature-card__list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.feature-card__list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-size: 1.2em;
  font-weight: 700;
}

.feature-card__note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ========================================================
   4. MANIFESTO
   ======================================================== */
.manifesto {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.manifesto__text p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.manifesto__text p:last-child {
  margin-bottom: 0;
}

/* ========================================================
   5. SOUND PACKS SHOWCASE
   ======================================================== */
.sound-packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.sound-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 32px 28px;
  border: 1px solid #3a3a3a;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.sound-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212,168,83,0.08);
}

.sound-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.sound-card__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ========================================================
   6. APP PREVIEWS
   ======================================================== */
.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.preview-mockup__label {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.preview-mockup__screen {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 28px 20px;
  border: 1px solid #3a3a3a;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Template cards */
.template-cards {
  display: flex;
  gap: 12px;
}

.template-card {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 20px 16px;
  border: 1.5px solid #3a3a3a;
  width: 80px;
  text-align: center;
  transition: border-color 0.2s;
}

.template-card--active {
  border-color: var(--accent);
}

.template-card__icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.template-card__name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

/* Writing view preview */
.preview-mockup__screen--writing {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.preview-paper {
  background: var(--paper);
  padding: 20px 16px;
  width: 100%;
  text-align: left;
  flex: 1;
}

.preview-paper p {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 4px;
}

.preview-paper__scene {
  font-weight: 700;
  text-transform: uppercase;
}

.preview-paper__character {
  text-align: center;
  font-weight: 700;
  margin-top: 8px;
}

.preview-paper__dialogue {
  text-align: center;
  padding: 0 20px;
}

.preview-paper__action {
  /* default */
}

.preview-keys {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  background: var(--bg-card);
  border-top: 1px solid #3a3a3a;
}

.preview-key {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--key-bg);
  border: 1.5px solid var(--key-ring);
  color: var(--chrome);
  font-family: var(--font-mono);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings preview */
.preview-mockup__screen--settings {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #3a3a3a;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.settings-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.settings-slider {
  width: 80px;
  height: 4px;
  background: #444;
  border-radius: 2px;
  overflow: hidden;
}

.settings-slider__fill {
  width: 65%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* ========================================================
   7. DOWNLOAD
   ======================================================== */
.download {
  text-align: center;
}

.download__version {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.download__buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================================
   8. FOOTER
   ======================================================== */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid #2a2a2a;
  padding: 40px 0;
}

.footer__inner {
  text-align: center;
}

.footer__credit {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.footer__tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer__attribution {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 12px;
  line-height: 1.5;
}

.footer__attribution a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.footer__attribution a:hover {
  color: var(--accent);
}

.footer__link {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer__link:hover {
  color: var(--accent);
}

/* ========================================================
   RESPONSIVE
   ======================================================== */

/* Tablet */
@media (max-width: 900px) {
  .features,
  .sound-packs,
  .previews {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .section { padding: 72px 0; }
  #hero { padding: 100px 0 72px; }

  .mockup__key { width: 30px; height: 30px; font-size: 10px; }
}

/* Mobile */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .section { padding: 56px 0; }
  #hero { padding: 80px 0 56px; }

  .section__heading { margin-bottom: 36px; }

  .hero__ctas { flex-direction: column; align-items: center; }
  .btn--lg { width: 100%; max-width: 280px; justify-content: center; }

  .mockup { max-width: 100%; }
  .mockup__screen { padding: 20px 16px; }
  .mockup__paper { padding: 20px 16px; }
  .mockup__text { font-size: 13px; }
  .mockup__key { width: 26px; height: 26px; font-size: 9px; border-width: 1.5px; }

  .demo__paper { min-height: 120px; padding: 20px 16px; font-size: 14px; }
  .demo__key { width: 30px; height: 30px; font-size: 11px; }

  .feature-card { padding: 24px 20px; }

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

  .template-card { width: 70px; padding: 14px 10px; }
}

/* Tiny screens */
@media (max-width: 380px) {
  .hero__title { font-size: 2.5rem; }
  .mockup__key-row { gap: 3px; }
  .mockup__key { width: 24px; height: 24px; font-size: 8px; }
  .demo__keys { gap: 3px; }
  .demo__key { width: 26px; height: 26px; font-size: 10px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .mockup__cursor { animation: none; opacity: 1; }
  .demo__key { transition: none; }
}
