/* ============================================================
   Perspective — Landing page
   Styled with the Inkwell design system tokens.
   Two surfaces: matte PAPER (the page) on a warm CANVAS.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Newsreader:ital,wght@0,400;0,500;1,400;1,500;1,600&display=swap');

:root {
  /* Page palette — monochrome, neutral */
  --paper:               #FFFFFF;
  --background-canvas:   #F5F5F4;
  --paper-shadow:        rgba(30, 24, 18, 0.08);

  /* Ink — user */
  --ink-primary:         #111111;

  /* Ink — AI (reserved; coral only for AI authorship) */
  --ink-ai-primary:      #CC785C;
  --ink-ai-subtle:       #8A8580;

  /* Labels */
  --label-primary:       #111111;
  --label-secondary:     rgba(17, 17, 17, 0.55);
  --label-tertiary:      rgba(17, 17, 17, 0.38);
  --separator:           rgba(17, 17, 17, 0.10);

  /* Spacing (8pt base) */
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Shape */
  --radius-page: 2px;

  /* Type families */
  --font-system:  -apple-system, 'SF Pro Text', 'SF Pro Display', BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
  --font-display: -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
  --font-serif:   'New York', 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --font-hand:    'Kalam', 'Caveat', 'Bradley Hand', cursive;

  /* Motion */
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --ink-duration: 1400ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:             #1A1A1F;
    --background-canvas: #0B0B0D;
    --paper-shadow:      rgba(0, 0, 0, 0.45);
    --ink-primary:       #F5F5F4;
    --ink-ai-primary:    #E8795E;
    --ink-ai-subtle:     #9A968F;
    --label-primary:     #F5F5F4;
    --label-secondary:   rgba(245, 245, 244, 0.60);
    --label-tertiary:    rgba(245, 245, 244, 0.38);
    --separator:         rgba(245, 245, 244, 0.12);
  }
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--background-canvas);
  color: var(--ink-primary);
  font-family: var(--font-system);
  font-size: 17px;
  line-height: 1.45;
}

/* ---------- Canvas surface ---------- */

.canvas {
  min-height: 100vh;
  padding: var(--space-8) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- The page ---------- */
/* Paper is opaque, matte. No texture, no gradient. */

.page {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: var(--paper);
  border-radius: var(--radius-page);
  box-shadow: 0 2px 8px var(--paper-shadow), 0 20px 60px rgba(30, 24, 18, 0.04);
  padding: var(--space-12) var(--space-12) var(--space-8);
  min-height: min(720px, 80vh);
  display: flex;
  flex-direction: column;
  animation: paper-settle 600ms var(--ease-out) both;
}

@keyframes paper-settle {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

.mark {
  width: 24px;
  height: 24px;
  color: var(--ink-primary);
}

.meta {
  font-family: var(--font-system);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label-tertiary);
}

/* ---------- Lede ---------- */

.lede {
  position: relative;
  margin-bottom: var(--space-12);
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: var(--ink-primary);
  margin: 0 0 var(--space-5);
  animation: ink-in 700ms var(--ease-out) 150ms both;
}

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.35;
  color: var(--label-primary);
  max-width: 22ch;
  margin: 0;
  animation: ink-in 700ms var(--ease-out) 320ms both;
}

@keyframes ink-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- AI margin annotation ---------- */
/* Coral ink = AI authorship. Never on chrome. */

.margin-note {
  position: absolute;
  top: 0;
  right: -8px;
  width: 180px;
  color: var(--ink-ai-primary);
  pointer-events: none;
  animation: ai-appear 900ms var(--ease-out) 900ms both;
}

.connector {
  display: block;
  width: 84px;
  height: 40px;
  margin-left: -20px;
  margin-bottom: var(--space-2);
  color: var(--ink-ai-subtle);
  opacity: 0.75;
}

.ai-hand {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink-ai-primary);
  margin: 0;
  letter-spacing: 0.005em;
  transform: rotate(-2deg);
  transform-origin: left top;
}

@keyframes ai-appear {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Body ---------- */

.body {
  max-width: 54ch;
  margin: 0;
  color: var(--label-primary);
  font-size: 17px;
  line-height: 1.55;
  animation: ink-in 700ms var(--ease-out) 520ms both;
}

.body p {
  margin: 0 0 var(--space-4);
}

.body p:last-child {
  color: var(--label-secondary);
  margin-bottom: 0;
}

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

.page-footer {
  margin-top: auto;
  padding-top: var(--space-8);
  border-top: 0.5px solid var(--separator);
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: var(--space-4);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--label-tertiary);
}

.footer-meta {
  text-transform: uppercase;
  font-family: var(--font-system);
}

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

@media (max-width: 720px) {
  .canvas {
    padding: var(--space-4);
  }

  .page {
    padding: var(--space-8) var(--space-6) var(--space-6);
    min-height: min(640px, 90vh);
  }

  .page-header {
    margin-bottom: var(--space-8);
  }

  .lede {
    margin-bottom: var(--space-8);
  }

  .margin-note {
    position: static;
    width: auto;
    margin-top: var(--space-5);
    text-align: left;
  }

  .connector { display: none; }

  .ai-hand {
    transform: none;
    font-size: 22px;
  }

  .tagline {
    max-width: none;
  }

  .page-footer {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* ---------- Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
