/*
 * claude-email — Postal Brutalism
 * Warm aged paper, oxidized ink, stamp red. Editorial serif with monospace accents.
 * One idea executed with precision: the site is a piece of mail.
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,700;0,9..144,900;1,9..144,400;1,9..144,700&family=JetBrains+Mono:wght@400;500;600;700&family=Vazirmatn:wght@400;500;700&display=swap');

:root {
  --paper:     #f3ead5;
  --paper-2:   #ead9b5;
  --paper-3:   #e0cc9e;
  --ink:       #141210;
  --ink-2:     #3a332c;
  --ink-muted: #6b5f50;
  --stamp:     #c32e38;
  --stamp-ink: #8a1f26;
  --postmark:  #2f4a42;
  --rule:      #b5a074;
  --perf:      #cab684;

  --font-display: 'Fraunces', 'Iowan Old Style', 'Apple Garamond', Georgia, serif;
  --font-body:    'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --font-persian: 'Vazirmatn', 'Fraunces', serif;

  --max: 1180px;
  --gutter: 40px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 14, "wght" 420;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;

  background-image:
    radial-gradient(circle at 20% 0%, rgba(195,46,56,0.04), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(47,74,66,0.05), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed, fixed, fixed;
}

[dir="rtl"] body { font-family: var(--font-persian); }

::selection { background: var(--stamp); color: var(--paper); }

a { color: var(--stamp-ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: color .18s, background .18s; }
a:hover { color: var(--paper); background: var(--stamp); text-decoration-color: transparent; }

/* ─── Layout ─────────────────────────────────────────────── */

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

/* Perforated strips — like envelope/stamp edges */
.perf {
  height: 18px;
  background:
    radial-gradient(circle at 9px 18px, var(--paper) 7px, transparent 7.5px) 0 0 / 18px 18px repeat-x;
  border-bottom: 1px dashed var(--perf);
}
.perf--top { border-bottom: none; border-top: 1px dashed var(--perf); transform: rotate(180deg); }

/* ─── Envelope Header ────────────────────────────────────── */

.site-header {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  background:
    repeating-linear-gradient(-45deg,
      transparent 0 12px,
      rgba(47,74,66,0.08) 12px 14px,
      transparent 14px 26px,
      rgba(195,46,56,0.08) 26px 28px);
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper);
  padding: 10px 18px;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.site-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.site-title code { font: inherit; background: none; padding: 0; color: var(--stamp-ink); }
.site-title::before {
  content: "✉";
  margin-right: 10px;
  color: var(--stamp);
  font-size: 1.1em;
}
.lang-switch {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.lang-switch:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--stamp);
}

/* ─── Hero: the front of the envelope ────────────────────── */

.hero {
  padding: 110px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 40px var(--gutter);
  border: 2px double var(--ink);
  pointer-events: none;
  opacity: 0.6;
}
.hero .container { text-align: left; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--postmark);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  flex: 0 0 40px;
  height: 1px;
  background: var(--postmark);
}
.hero-eyebrow::after { flex: 1; }

.hero h1 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 900, "SOFT" 30;
  font-size: clamp(3.5rem, 10vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 500;
  color: var(--stamp);
  display: block;
  font-size: 0.55em;
  letter-spacing: -0.02em;
  margin-top: 8px;
}

.hero .tagline {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wght" 400;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  color: var(--ink-2);
  max-width: 680px;
  margin-bottom: 28px;
  font-style: italic;
}

.hero .description {
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--stamp);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn-primary::after { content: "↗"; font-size: 1.1em; }
.btn-primary:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--stamp);
  text-decoration: none;
}

/* Postmark — pure CSS stamp in the corner */
.postmark {
  position: absolute;
  top: 70px; right: 60px;
  width: 180px; height: 180px;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-14deg);
  opacity: 0.85;
  pointer-events: none;
  animation: stampIn 1.1s cubic-bezier(.2,.8,.2,1) .3s both;
}
.postmark::before,
.postmark::after {
  content: "";
  position: absolute;
  border: 1.5px dashed var(--stamp);
  border-radius: 50%;
  opacity: 0.55;
}
.postmark::before { inset: 10px; }
.postmark::after { inset: -14px; border-style: dotted; }
.postmark strong {
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: 0.03em;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wght" 700;
  display: block;
  padding: 4px 0;
  text-transform: none;
  color: var(--stamp);
}
.postmark span { display: block; line-height: 1.4; }

@keyframes stampIn {
  0%   { opacity: 0; transform: rotate(-40deg) scale(1.6); }
  70%  { opacity: 1; transform: rotate(-10deg) scale(0.95); }
  100% { opacity: 0.85; transform: rotate(-14deg) scale(1); }
}

/* ─── Section scaffolding ────────────────────────────────── */

section { position: relative; }

.section-head {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  align-items: baseline;
  padding: 60px 0 24px;
  border-top: 1px solid var(--rule);
}
.section-num {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 700;
  font-style: italic;
  font-size: 4rem;
  color: var(--stamp);
  line-height: 0.8;
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 800;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.section-title small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--postmark);
  margin-bottom: 14px;
}

/* ─── Features (numbered list, not cards) ────────────────── */

.features { padding-bottom: 60px; }
.features-list {
  list-style: none;
  margin-top: 40px;
  border-top: 1px solid var(--rule);
}
.features-list li {
  display: grid;
  grid-template-columns: 80px 1fr 2fr;
  gap: 32px;
  align-items: baseline;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  transition: background .2s;
}
.features-list li:hover {
  background: linear-gradient(90deg, transparent, rgba(195,46,56,0.07), transparent);
}
.features-list .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--stamp);
  font-weight: 600;
}
.features-list h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "wght" 700;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.features-list p {
  color: var(--ink-2);
  line-height: 1.65;
  font-size: 1rem;
}
.features-list code {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1px 8px;
  border-radius: 0;
  font-size: 0.85em;
  color: var(--ink);
}

/* ─── How It Works ───────────────────────────────────────── */

.how-it-works { padding-bottom: 80px; }
.how-it-works .content {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 48px;
  margin-top: 40px;
  padding-top: 20px;
}
.how-it-works .prose p {
  margin-bottom: 18px;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.how-it-works .prose strong {
  font-variation-settings: "wght" 700;
  color: var(--ink);
  background: linear-gradient(transparent 60%, rgba(195,46,56,0.25) 60%);
  padding: 0 2px;
}

.arch-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--paper);
  background: var(--ink);
  padding: 28px 30px;
  white-space: pre;
  overflow-x: auto;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--stamp);
  position: relative;
}
.arch-block::before {
  content: "TRANSMISSION";
  position: absolute;
  top: -11px; left: 20px;
  background: var(--paper);
  padding: 0 10px;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--stamp);
}

/* ─── Installation ───────────────────────────────────────── */

.installation { padding-bottom: 100px; }
.installation .content { margin-top: 40px; max-width: 820px; }
.installation p {
  color: var(--ink-2);
  margin: 18px 0;
  font-size: 1.02rem;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  background: var(--paper-2);
  border-left: 4px solid var(--stamp);
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 24px 20px 26px;
  margin: 18px 0;
  overflow-x: auto;
  color: var(--ink);
  position: relative;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }
pre::before {
  content: "$";
  position: absolute;
  top: 18px; right: 20px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--perf);
  opacity: 0.5;
}

p code, li code {
  font-family: var(--font-mono);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1px 7px;
  font-size: 0.88em;
  color: var(--stamp-ink);
  border-radius: 0;
}

/* ─── Footer ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 36px 0 56px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 16px,
      rgba(47,74,66,0.06) 16px 18px);
}
.site-footer a {
  color: var(--ink);
  text-decoration-color: var(--stamp);
}
.site-footer a:hover { color: var(--paper); background: var(--stamp); }

/* ─── Animations ─────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(16px); animation: reveal .9s cubic-bezier(.2,.8,.2,1) forwards; }
.reveal--1 { animation-delay: .05s; }
.reveal--2 { animation-delay: .15s; }
.reveal--3 { animation-delay: .25s; }
.reveal--4 { animation-delay: .35s; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── RTL ────────────────────────────────────────────────── */

[dir="rtl"] .header-inner { flex-direction: row-reverse; }
[dir="rtl"] .site-title::before { margin-right: 0; margin-left: 10px; }
[dir="rtl"] .hero .container,
[dir="rtl"] .hero-eyebrow,
[dir="rtl"] .hero h1,
[dir="rtl"] .hero .tagline,
[dir="rtl"] .hero .description,
[dir="rtl"] .hero-actions { text-align: right; direction: rtl; }
[dir="rtl"] .hero::before { inset: 40px var(--gutter); }
[dir="rtl"] .postmark { right: auto; left: 60px; transform: rotate(14deg); }
[dir="rtl"] @keyframes stampIn {
  0%   { opacity: 0; transform: rotate(40deg) scale(1.6); }
  70%  { opacity: 1; transform: rotate(10deg) scale(0.95); }
  100% { opacity: 0.85; transform: rotate(14deg) scale(1); }
}
[dir="rtl"] .section-head { grid-template-columns: 1fr 120px; }
[dir="rtl"] .section-num { order: 2; text-align: left; }
[dir="rtl"] .features-list li { grid-template-columns: 2fr 1fr 80px; text-align: right; }
[dir="rtl"] .features-list .num { order: 3; text-align: left; }
[dir="rtl"] .features-list h3 { order: 2; }
[dir="rtl"] .features-list p { order: 1; }
[dir="rtl"] .how-it-works .content { grid-template-columns: 3fr 2fr; }
[dir="rtl"] .how-it-works .prose { text-align: right; }
[dir="rtl"] pre, [dir="rtl"] code, [dir="rtl"] .arch-block {
  direction: ltr; text-align: left;
}
[dir="rtl"] pre { border-right: 4px solid var(--stamp); border-left: 1px solid var(--rule); }
[dir="rtl"] pre::before { right: auto; left: 20px; }
[dir="rtl"] .installation .content { text-align: right; }
[dir="rtl"] .btn-primary::after { content: "↖"; }

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 920px) {
  :root { --gutter: 24px; }
  .postmark { width: 130px; height: 130px; font-size: 0.6rem; top: 30px; right: 20px; }
  .postmark strong { font-size: 1.2rem; }
  .hero { padding: 70px 0 60px; }
  .hero::before { inset: 20px var(--gutter); }
  .section-head { grid-template-columns: 1fr; gap: 12px; padding-top: 48px; }
  .section-num { font-size: 3rem; }
  .features-list li { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .features-list .num { color: var(--stamp); font-size: 0.8rem; }
  .how-it-works .content { grid-template-columns: 1fr; gap: 28px; }
  [dir="rtl"] .features-list li { grid-template-columns: 1fr; }
  [dir="rtl"] .section-head { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.8rem, 14vw, 4.5rem); }
  .postmark { display: none; }
  .header-inner { padding: 8px 12px; }
  .site-title { font-size: 0.82rem; }
  .arch-block { font-size: 0.72rem; padding: 22px 18px; }
  pre { font-size: 0.78rem; padding: 16px 20px; }
}
