/* =============================================================================
 * Escribir — main.css
 * Marketing site for https://escribir.app
 * Palette sampled directly from the app's WelcomeHero artwork and icon:
 * a mid-century scene of a wooden mannequin riding a fountain pen — dusty
 * sky blue, seafoam, cream paper, wood browns, with coral / olive / gold
 * accents. Courier Prime as the display face — a nod to Fountain screenplays.
 * ========================================================================== */

:root {
  /* Sampled from the artwork */
  --ink:        #3b2f22;   /* dark warm brown — the illustration's outlines */
  --paper:      #f7eed8;   /* cream paper */
  --paper-alt:  #f0e3c4;   /* deeper cream — the wallpaper squares */
  --sky:        #79979f;   /* dusty slate blue background */
  --seafoam:    #9cbfa8;   /* seafoam green wash */
  --pen-teal:   #2c6663;   /* the pen's grip section */
  --coral:      #dd7a5a;   /* coral squares */
  --olive:      #a09a3e;   /* olive squares */
  --gold:       #cfa04a;   /* the pen's gold bands */
  --wood:       #8c6a50;   /* mannequin wood */

  --color-primary:        var(--pen-teal);
  --color-primary-dark:   #1f4d4a;
  --color-secondary:      var(--coral);
  --color-accent:         var(--gold);
  --color-bg:             var(--paper);
  --color-bg-alt:         var(--paper-alt);
  --color-surface:        #fdf8ea;
  --color-text:           var(--ink);
  --color-text-muted:     #6d6250;
  --color-border:         #ddcfab;

  --font-body:    system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Courier Prime', 'Courier New', monospace;

  --container-max: 900px;
  --container-pad: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* The WelcomeHero-Dark treatment: same scene, lights down */
    --color-bg:         #1d2a2c;
    --color-bg-alt:     #233335;
    --color-surface:    #2a3c3e;
    --color-text:       #ece1c6;
    --color-text-muted: #a9b0a0;
    --color-border:     #3a4d4e;
    --color-primary:    #7db8ab;
    --color-primary-dark: #5f9e91;
    --color-secondary:  #e08d6d;
    --color-accent:     #d8b268;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-main { flex: 1; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }
a { color: var(--color-primary); }
a:hover { color: var(--color-secondary); }

/* Header — slim, wordmark + nav */
.site-header {
  padding: 1.1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.header-nav a { text-decoration: none; }

/* Hero — the artwork carries it */
.hero {
  padding: 4rem 0 5rem;
  text-align: center;
}

.hero-wordmark {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.hero-wordmark .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--color-secondary);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-wordmark .cursor { animation: none; }
}

.hero-tagline {
  font-size: 1.35rem;
  color: var(--color-text-muted);
  max-width: 34em;
  margin: 1.25rem auto 0;
}

.hero-art {
  margin: 3rem auto 0;
  max-width: 860px;
}

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 3px solid var(--ink);
  box-shadow: 0.5rem 0.5rem 0 var(--seafoam);
}

@media (prefers-color-scheme: dark) {
  .hero-art img {
    border-color: #101b1c;
    box-shadow: 0.5rem 0.5rem 0 rgba(125, 184, 171, 0.35);
  }
}

.hero-soon {
  display: inline-block;
  margin-top: 3rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--color-accent);
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-secondary);
  transform: rotate(-2deg);
}

.hero-store {
  margin-top: 3rem;
}

.hero-store .store-badge {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-primary);
  color: var(--paper);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  border: 2px solid var(--color-primary-dark);
  box-shadow: 0.25rem 0.25rem 0 var(--color-accent);
}

.hero-store .store-badge:hover {
  background: var(--color-primary-dark);
  color: var(--paper);
}

.hero-platforms {
  margin-top: 1.75rem;
  color: var(--color-text-muted);
  font-size: 1rem;
  font-family: var(--font-display);
}

/* Screenshots — App Store shots in the same framed treatment as the hero */
.shots {
  padding: 1rem 0 3rem;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin: 0 0 2rem;
}

.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem 1.75rem;
}

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 3px solid var(--ink);
  box-shadow: 0.4rem 0.4rem 0 var(--seafoam);
}

.shot:nth-child(2n) img { box-shadow: 0.4rem 0.4rem 0 var(--coral); }

@media (prefers-color-scheme: dark) {
  .shot img {
    border-color: #101b1c;
    box-shadow: 0.4rem 0.4rem 0 rgba(125, 184, 171, 0.35);
  }
  .shot:nth-child(2n) img { box-shadow: 0.4rem 0.4rem 0 rgba(224, 141, 109, 0.35); }
}

.shot figcaption {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Features — rounded "wallpaper square" cards, echoing the artwork's motif */
.features {
  padding: 1rem 0 5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.feature-card {
  background: var(--color-surface);
  border: 2.5px solid var(--color-border);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
}

.feature-card:nth-child(3n+1) { border-color: var(--color-primary); }
.feature-card:nth-child(3n+2) { border-color: var(--color-secondary); }
.feature-card:nth-child(3n+3) { border-color: var(--olive); }

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.feature-card code,
.hero-tagline code {
  font-family: var(--font-display);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  font-size: 0.95em;
}

.feature-card kbd {
  font-family: var(--font-display);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
  font-size: 0.9em;
}

/* Inner pages (support, privacy) */
.page {
  padding: 4rem 0;
}

.page .container { max-width: 780px; }

.page h1 { font-size: 2.25rem; }
.page h2 { font-size: 1.5rem; margin-top: 2.5rem; }

.page table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
}

.page th, .page td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.page th { background: var(--color-bg-alt); font-family: var(--font-display); }

/* Footer */
.site-footer {
  border-top: 2px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.footer-brand { font-family: var(--font-display); font-weight: 700; margin: 0; }
.footer-nav { display: flex; gap: 1.25rem; }
.footer-legal { margin: 0; }
.footer-legal a { color: inherit; }
