/* Fam Mail — postal theme. One accent (postal red), mono as the meter voice,
   postal artifacts (postcard, postmark, postal trim) instead of decoration. */

:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --red: #e11d48;
}

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

html { background: var(--bg); scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.65;
}

a { color: var(--red); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #fb7185; }

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0;
  margin-bottom: 3rem;
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: ui-monospace, monospace;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.brand:hover { color: var(--red); }
nav { display: flex; gap: 1.1rem; align-items: center; font-family: ui-monospace, monospace; font-size: 0.85rem; }
nav a { color: var(--muted); }
nav a:hover { color: var(--red); }
.nav-ico { width: 1.2rem; height: 1.2rem; fill: var(--muted); display: block; }
nav a:hover .nav-ico { fill: var(--red); }
.nav-home { font-size: 1.05rem; }

/* ---------- typography ---------- */
h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: 0.95rem; }
.lede { font-size: 1.15rem; line-height: 1.6; color: var(--muted); margin-bottom: 1.8rem; max-width: 42rem; }
.section-lede { color: var(--muted); margin-bottom: 2rem; max-width: 44rem; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.8rem;
  align-items: center;
  padding: 1.5rem 0 4rem;
}
.hero .lede { margin-bottom: 2rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 0.45rem;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #fb7185; color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); }
.factline { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); margin-top: 1rem; }

/* ---------- the postcard (signature device) ---------- */
.postcard-scene { perspective: 1400px; }
.postcard {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #0f172a;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.postcard.flipped { transform: rotateY(180deg); }
.postcard .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 0.5rem;
  overflow: hidden;
}
.postcard .front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.postcard .back {
  transform: rotateY(180deg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 1.2rem;
}
.postcard .divider {
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  border-left: 1px dashed #94a3b8;
}
.postcard .msg {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  line-height: 1.55;
  padding-right: 1rem;
  color: #1e293b;
}
.postcard .address {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #334155;
  padding-top: 2.6rem;
}
.postcard .stamp {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px dashed #94a3b8;
  padding: 2px;
  background: #fff;
}
.postcard .stamp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.postmark {
  position: absolute;
  top: -0.5rem;
  right: 2.6rem;
  width: 4.6rem;
  height: 4.6rem;
  border: 2px solid rgba(51, 65, 85, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: rgba(51, 65, 85, 0.7);
  transform: rotate(-12deg);
  line-height: 1.4;
}
.postcard-hint {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.8rem;
}

/* ---------- sections ---------- */
section.block { padding: 3.2rem 0; }
.section-lede { color: var(--muted); margin-bottom: 2rem; max-width: 44rem; }

.steps { display: grid; gap: 1.3rem; margin-bottom: 2.4rem; }
.step { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; }
.step .num { font-family: ui-monospace, monospace; color: var(--red); font-size: 1rem; padding-top: 0.1rem; }
.step h3 { font-weight: 600; margin-bottom: 0.2rem; }
.step p { color: var(--muted); font-size: 0.92rem; }

.lines { display: grid; gap: 1rem; }
.lines h3 { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.15rem; }
.lines p { color: var(--muted); font-size: 0.9rem; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }

.browser-frame {
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.browser-bar .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--border); }
.browser-bar .url {
  margin-left: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.4rem;
  padding: 0.2rem 0.7rem;
}
.browser-frame img { width: 100%; height: auto; display: block; }

.codeblock {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1.1rem 1.3rem;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  color: #cbd5e1;
  overflow-x: auto;
  margin-bottom: 2rem;
  white-space: pre;
}

.github-band {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 2.4rem 2.2rem;
  background: var(--bg-soft);
}
.github-band h2 { margin-bottom: 0.5rem; }
.github-band p { color: var(--muted); margin-bottom: 1.6rem; max-width: 40rem; }

footer {
  margin-top: 4rem;
  padding: 2rem 0 2.6rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
footer .fine { margin-top: 0.7rem; font-size: 0.68rem; color: #64748b; max-width: 46rem; margin-left: auto; margin-right: auto; line-height: 1.6; }

@media (max-width: 56rem) {
  .hero { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
}

/* ---------- section head icons ---------- */
.sec-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.sec-ico {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--red);
  fill: none;
  flex: none;
}
.line-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.9rem;
  align-items: start;
}
.line-ico {
  width: 1.15rem;
  height: 1.15rem;
  stroke: var(--red);
  fill: none;
  flex: none;
  margin-top: 0.15rem;
}
.line-row h3 { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.15rem; }
.line-row p { color: var(--muted); font-size: 0.9rem; }
