/* Pomecom landing page — standalone stylesheet. Not built from libs/ui: this is a single
   static page with zero JS and no build step, so it hand-mirrors libs/ui's idiom (fonts,
   grid canvas, corner-ribbon pattern) instead of importing it. Self-hosted fonts only —
   no Google Fonts, no CDN, CSP-friendly. */

/* ── Fonts ───────────────────────────────────────────────────────────────
   Mirrors libs/ui/css/fonts.css. Only the weights this page actually uses. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/InstrumentSerif.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Silkscreen.woff2") format("woff2");
}

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --canvas: #f8f1f2;
  --surface: #ffffff;
  --surface-muted: #f4eaec;

  --accent: #b02a4c;
  --accent-hover: #97223f;
  --accent-deep: #7c1c37;
  --accent-bright: #cf3f63;
  --accent-soft: #fbeaee;
  --accent-soft-deep: #f2d3dc;

  --garnet: #3a2731;
  --ink: #3c2b32;
  --ink-muted: #715a64;
  --ink-faint: #b39aa4;

  /* The night side. The banner art is a dark room, so the top of the page
     inverts: these are the only colors that run on the image. */
  --night: #190c13;
  --night-ink: #fdf6f7;
  --night-ink-soft: #dcb2be;

  --edge: #eee0e3;
  --edge-strong: #e0cdd2;

  --grid-minor: rgba(176, 42, 76, 0.055);
  --grid-major: rgba(176, 42, 76, 0.10);

  --shadow-soft: 0 1px 2px rgba(88, 45, 58, .05), 0 6px 16px rgba(88, 45, 58, .06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Silkscreen", ui-monospace, monospace;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ── Base ────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Graph-paper canvas — libs/ui's defining motif, reproduced here at two
     scales (major/minor rules) via four stacked linear gradients. */
  background-color: var(--canvas);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 20px 20px, 20px 20px;

  /* The hard offset shadows on .box are wider than their boxes; clip the
     overflow on the axis that could otherwise force a horizontal scrollbar
     at narrow widths, without touching vertical scroll. */
  overflow-x: clip;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.shell {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* ── Banner — the night room the software gets made in ───────────────
   Full-bleed art under the masthead and headline. Two scrims earn their
   place: one from the left so the type always clears the busy shelves
   whichever image is loaded, one at the bottom that lands exactly on
   --canvas so the photograph dissolves and the graph paper develops out
   of it. No vignette, no drift — the art already has texture. */
.banner {
  --fade-band: clamp(180px, 30vh, 320px);

  position: relative;
  /* Contain the scrim/dissolve z-indexes, or the fade band paints over the
     catalog boxes that pull up into it. */
  isolation: isolate;
  min-height: min(88vh, 800px);
  background-color: var(--night);
  background-image: url("/banners/homepage-banner.webp");
  background-size: cover;
  background-position: 55% center;
}

/* Scrims. The diagonal keeps the headline off the lit desk whichever image
   is loaded; the short top one keeps the masthead off the bright sky. */
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(105deg, rgba(25, 12, 19, .9) 0%, rgba(25, 12, 19, .7) 40%, rgba(25, 12, 19, .28) 66%, transparent 86%),
    linear-gradient(to bottom, rgba(25, 12, 19, .6), transparent 24%);
  pointer-events: none;
}

/* The dissolve, as a band of its own height rather than a share of the
   banner's — that way the art stays full-strength above it no matter how
   tall the banner gets, and .hero only has to clear a known distance. */
.banner::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  bottom: 0;
  height: var(--fade-band);
  background: linear-gradient(to bottom, transparent, var(--canvas) 92%);
  pointer-events: none;
}

.banner-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: inherit;
}

/* ── Masthead ────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 28px;
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The mark is a transparent illustration, not a photo tile: no radius, and
   contain rather than cover so the fruit is never clipped. */
.masthead .mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
}

.masthead .wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--night-ink);
}

/* ── Hero ────────────────────────────────────────────────────────────
   Sits in the lower third of the dark field, above where the fade starts,
   so the type never fights the dissolve. */
.hero {
  margin-top: auto;
  /* Clear the dissolve band, plus a little air, so the type is never
     sitting in the wash. */
  padding-bottom: calc(var(--fade-band) + 24px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.08;
  text-wrap: balance;
  /* Insurance, not decoration: the lit desk sits under the second line. */
  text-shadow: 0 2px 28px rgba(25, 12, 19, .6);
}

.hero span {
  display: block;
}

.hero .line-1 {
  color: var(--night-ink);
}

.hero .line-2 {
  color: var(--night-ink-soft);
}

/* ── Button — the one glossy object on the page ─────────────────────── */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  font: 600 1rem/1 var(--font-sans);
  color: #fff;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-deep));
  border: 1px solid var(--accent-deep);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px rgba(176, 42, 76, .25);
  text-decoration: none;
}

.btn-pill:hover,
.btn-pill:focus-visible {
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px rgba(176, 42, 76, .3);
}

.btn-pill:active {
  filter: brightness(0.97);
}

.btn-pill-sm {
  min-height: 32px;
  padding: 0 18px;
  font-size: 0.8125rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px rgba(176, 42, 76, .22);
}

.btn-pill-sm:hover,
.btn-pill-sm:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(176, 42, 76, .28);
}

/* ── Catalog ─────────────────────────────────────────────────────────── */
/* The negative pull is deliberate: the banner's fade bottoms out in pure
   canvas, so the boxes start inside that dead zone rather than after it. */
.catalog {
  margin-top: -6vh;
  padding-bottom: 80px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

/* ── Box — the signature retro software box ─────────────────────────── */
.box {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--accent-soft-deep);
}

.box-label {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 16px 6px;
  padding-right: 104px;
}

.box-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.box h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--garnet);
  margin-bottom: 10px;
}

.box-body > p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.box-screen {
  aspect-ratio: 16 / 10;
  background: var(--surface-muted);
  border: 1px dashed var(--edge-strong);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  margin-top: auto;
}

.box-screen span {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
}

/* Corner ribbon, top-right (the label strip already owns the top-left).
   Width/translate are tuned so the diagonal band's ends land fully under
   the box's overflow:hidden at both edges — no floating rectangle corners. */
.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 26px;
  transform: translate(44px, 22px) rotate(45deg);
  background: var(--garnet);
  color: #fff;
  font-family: var(--font-label);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 26px;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
/* Copyright pinned left, the reference link pinned right. flex-shrink:0 on
   the link keeps it a fixed anchor on the right edge while the copyright
   text — the longer, more elastic piece — wraps internally at narrow
   widths instead of forcing the row to wrap. */
footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding-block: 48px;
}

footer a {
  flex-shrink: 0;
  color: inherit;
}

footer a:hover,
footer a:focus-visible {
  color: var(--ink-muted);
}

/* ── Motion ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero {
    opacity: 0;
    animation: rise-in 500ms cubic-bezier(0.2, 0, 0, 1) forwards;
  }

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

  .btn-pill {
    transition:
      transform 120ms cubic-bezier(0.2, 0, 0, 1),
      box-shadow 120ms,
      filter 120ms;
  }

  .btn-pill:hover,
  .btn-pill:focus-visible {
    transform: translateY(-1px);
  }

  .btn-pill:active {
    transform: translateY(0);
  }

  .box {
    transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
  }

  .box:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 var(--accent-soft-deep);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    opacity: 1;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  /* Shorter banner and a tighter fade band: at this width the crop keeps
     the window and moon, and the type needs less room beneath it. */
  .banner {
    --fade-band: clamp(120px, 20vh, 180px);

    min-height: 76vh;
  }
}
