/* ------------------------------------------------------------------ */
/*  Letterhead — engraved stationery landing                           */
/*  Design language: cream paper, engraved serif, mono annotations     */
/* ------------------------------------------------------------------ */

:root {
  --paper: #eeeee7;
  --ink: rgba(0, 0, 0, 0.85);
  --ink-soft: rgba(0, 0, 0, 0.38);
  --ink-faint: rgba(0, 0, 0, 0.22);
  --accent: #0c50ff;
  --pulse: #b9b9f0;
  --serif: "EB Garamond", "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SF Mono", monospace;
  --edge: clamp(1.25rem, 2.5vw, 2.25rem);
}

[data-theme="blue"] {
  --paper: #0c50ff;
  --ink: rgba(238, 238, 231, 0.96);
  --ink-soft: rgba(238, 238, 231, 0.55);
  --ink-faint: rgba(238, 238, 231, 0.32);
  --accent: #eeeee7;
  --pulse: #9db4ff;
}

[data-theme="dark"] {
  --paper: #181815;
  --ink: rgba(238, 238, 231, 0.9);
  --ink-soft: rgba(238, 238, 231, 0.48);
  --ink-faint: rgba(238, 238, 231, 0.26);
  --accent: #8ca6ff;
  --pulse: #6f6fae;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  overflow: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scribble layer -------------------------------------------------- */

#ink {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

body.show-ink #ink {
  opacity: 1;
  pointer-events: auto;
  cursor: crosshair;
}

/* ---- Entrance -------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(3px);
  transition: opacity 1s ease, transform 1s ease, filter 1s ease;
  transition-delay: calc(var(--i, 0) * 0.14s);
}

body.ready [data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---- Status widgets (top-left) --------------------------------------- */

.corner--tl {
  position: fixed;
  top: var(--edge);
  left: var(--edge);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 10;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.8em;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.status__square {
  width: 0.6em;
  height: 0.6em;
  background: var(--ink);
  flex: none;
}

.status__square--pulse {
  background: var(--pulse);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.status__action {
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  letter-spacing: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  margin-left: 0.6em;
  transition: color 0.25s ease;
}

.status__action--flush {
  margin-left: 0;
  color: var(--ink);
}

.status__action:hover {
  color: var(--accent);
}

/* ---- Letter (center column) ------------------------------------------ */

.letter {
  position: relative;
  z-index: 1;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* The column rides above true center, leaving quiet space below. */
  padding: 0 1.5rem 16svh;
}

/* Stamp */

.stamp {
  margin-bottom: clamp(2.75rem, 8svh, 4.5rem);
  color: var(--ink);
}

.stamp svg {
  display: block;
  overflow: visible;
}

.stamp__the {
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  fill: currentColor;
}

.stamp__arc-text {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  fill: currentColor;
}

.stamp__side {
  font-family: var(--serif);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  fill: currentColor;
}

/* Statement */

.statement {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 0.85vw, 1.75rem);
  line-height: 1.5;
  max-width: 20.5em;
  margin-bottom: clamp(2.5rem, 6.5svh, 3.75rem);
}

.statement__link {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  transition: color 0.25s ease;
}

.statement__link:hover {
  color: var(--accent);
  text-decoration-style: solid;
}

/* Products */

.products {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  margin-bottom: clamp(2rem, 4.5svh, 2.75rem);
}

.products__item {
  display: flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-decoration: none;
}

.products__item svg {
  flex: none;
  transition: transform 0.3s ease;
}

.products__item:hover svg {
  transform: rotate(-12deg) scale(1.1);
}

.products__item:hover {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

/* Index */

.index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3.25rem);
}

.index a {
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
}

.index a:hover {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

/* ---- Corner marks (bottom) -------------------------------------------- */

.marks {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 5;
  pointer-events: none;
  color: var(--ink);
}

.marks > * {
  position: absolute;
  bottom: var(--edge);
  opacity: 0.65;
}

.marks__globe {
  left: var(--edge);
  bottom: calc(var(--edge) - 6px);
}

.marks__monogram {
  left: 30%;
  bottom: 0;
  /* Half-sunk below the page edge, like a print crop. */
  translate: 0 45%;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.marks__monogram span {
  font-style: italic;
}

.marks__seal {
  left: 50%;
  translate: -50% 0;
}

.marks__address {
  right: calc(var(--edge) + 8.5rem);
  font-family: var(--serif);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.7;
  text-align: justify;
}

.marks__theme {
  right: var(--edge);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
}

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 640px) {
  .products {
    flex-direction: column;
    gap: 1.5rem;
  }

  .marks__monogram,
  .marks__seal,
  .marks__address {
    display: none;
  }
}

/* ---- Reduced motion ----------------------------------------------------- */

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

  .status__square--pulse {
    animation: none;
  }

  [data-reveal] {
    transition: none;
  }
}
