/* phebert.dev — personal letterhead.
   Warm paper, umber ink rules, ledger typography — a cousin of the
   sendhawk.com letterhead, shifted warm. Fraunces display, Source Serif 4
   body, Spline Sans Mono for registry labels. */

:root {
  --paper: #f3efe7;
  --paper-2: #e9e2d4;
  --ink: #2b241c;
  --ink-2: #6f6455;
  --rule: rgba(43, 36, 28, 0.16);
  --rule-strong: rgba(43, 36, 28, 0.58);
  --accent: #9a4b1f;
  --accent-2: #7c3a15;
  --serif: 'Fraunces', Georgia, serif;
  --body: 'Source Serif 4', Georgia, serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', monospace;
  --w: 1060px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(120% 80% at 70% -10%, rgba(154, 75, 31, 0.07), transparent 60%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain over everything, fixed so it doesn't scroll-shimmer. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

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

/* ---------- Masthead: double-ruled letterhead top ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 0 16px;
  border-bottom: 1px solid var(--rule-strong);
  position: relative;
}

.masthead::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover { color: inherit; }
.brand img { width: 34px; height: 34px; display: block; }

.masthead-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(64px, 11vw, 128px) 0 clamp(48px, 7vw, 88px);
}

.hero-watermark {
  position: absolute;
  right: -30px;
  top: clamp(24px, 6vw, 72px);
  width: clamp(220px, 32vw, 400px);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 22px;
}

.hero h1 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(3rem, 7.6vw, 5.6rem);
  font-weight: 540;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
}

.lede {
  font-size: clamp(1.12rem, 1.7vw, 1.3rem);
  line-height: 1.55;
  max-width: 54ch;
  color: var(--ink);
  margin: 0 0 36px;
}

.lede a { font-weight: 600; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 13px 22px;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--paper); }

/* ---------- Section scaffolding ---------- */

.section { margin-top: clamp(56px, 9vw, 104px); }

.section-rule {
  border-top: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.section-rule h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.section-rule .tab {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Plain prose inside a ruled section (sign-in explainer). */
.section-copy {
  max-width: 60ch;
  margin: 24px 0 0;
}
.section-copy p { margin: 0 0 1em; }
.section-copy p:last-child { margin-bottom: 0; }

/* ---------- App ledger ---------- */

.entry {
  display: grid;
  grid-template-columns: 96px 1fr 220px;
  gap: 36px;
  padding: 40px 0;
  margin-top: 18px;
  border-top: 1px solid var(--rule);
}

.entry-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 10px;
}

.entry h3 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 560;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

.entry h3 .app-icon {
  width: 30px;
  height: 30px;
  vertical-align: -3px;
  margin-right: 12px;
}

.entry-tag {
  font-style: italic;
  color: var(--ink-2);
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.entry p.desc { margin: 0; max-width: 52ch; }

.entry-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  padding-top: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.status .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2e7d4f;
  box-shadow: 0 0 0 3px rgba(46, 125, 79, 0.18);
}

/* Private / invite-only status — umber, for apps not open to the public. */
.status--private .dot {
  background: #9a4b1f;
  box-shadow: 0 0 0 3px rgba(154, 75, 31, 0.18);
}

.entry-side .links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

/* Reflow the last line so a single word never orphans. */
.lede, .entry-tag, .entry p.desc, .section-copy p {
  text-wrap: pretty;
}

/* ---------- Imprint (contact information) ---------- */

.imprint dl { margin: 18px 0 0; }

.imprint .row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.imprint dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 4px;
}

.imprint dd { margin: 0; }

/* ---------- Footer ---------- */

/* Note: the footer is itself a .container, so set only vertical padding
   here — the horizontal 28px must come from .container, or the content
   goes flush to the screen edge on mobile. */
.footer {
  margin-top: clamp(72px, 11vw, 128px);
  padding-bottom: 48px;
}

.footer-inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 26px;
  border-top: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

/* Second line of the letterhead double-rule, aligned to the content. */
.footer-inner::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 1px solid var(--rule);
}

.footer-inner nav { display: flex; gap: 22px; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* ---------- Prose pages (terms / privacy) ---------- */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 80px) 28px 0;
}

.prose h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
}

.prose .effective {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 40px;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.4em 0 0.6em;
}

.prose p, .prose li { line-height: 1.7; }
.prose ul { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }

/* "In short" summary callout. */
.prose blockquote {
  margin: 0 0 1.6em;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
}
.prose blockquote p { margin: 0; }

/* ---------- 404 ---------- */

.lost {
  text-align: center;
  padding: clamp(80px, 14vw, 160px) 28px;
}

.lost .big {
  font-family: var(--serif);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 540;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 12px;
  color: var(--accent);
}

.lost h1 { font-family: var(--serif); font-weight: 560; margin: 0 0 14px; }
.lost p { color: var(--ink-2); }

/* ---------- Reveal motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    animation: rise 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
  }
  .d1 { animation-delay: 0.07s; }
  .d2 { animation-delay: 0.16s; }
  .d3 { animation-delay: 0.25s; }
  .d4 { animation-delay: 0.34s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .entry { grid-template-columns: 1fr; gap: 14px; padding: 30px 0; }
  .entry-no { padding-top: 0; }
  .entry-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
  .entry-side .links { flex-direction: row; gap: 18px; }
  .imprint .row { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
  .hero-watermark { display: none; }
  /* The footer's 72px top-margin floor is disproportionate on phones —
     scale it down so it doesn't dwarf the inter-section gaps. */
  .footer { margin-top: clamp(40px, 12vw, 72px); }
}
