/*
 * Lumno Design Tips: a fixed-size canvas for one daily tip.
 *
 * The stage renders at real export pixels (see the sizes below) and tip.js
 * scales it down to fit the window. Add ?export=1 to the URL to drop the
 * scaling, so a screenshot or screen recording captures exact pixels.
 */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,500;1,600&family=EB+Garamond:wght@500;600&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('./continuous-corners.css');

@font-face {
  font-family: 'Lumno Open Sans';
  src: url('./fonts/OpenSans-VariableFont-wdth-wght.woff2') format('woff2');
  font-weight: 300 800;
  font-stretch: 75% 100%;
}

:root {
  --tip-font-sans: 'Lumno Open Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  --tip-font-serif: 'EB Garamond', 'Iowan Old Style', Georgia, 'Songti SC', serif;
  --tip-font-accent: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --tip-font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  /* Lumno cream: the sky tone of the meadow wallpaper. */
  --tip-paper: #f5f2e9;
  --tip-paper-dark: #151515;
  --tip-ink: #14161b;
  --tip-ink-soft: #5b616e;
  --tip-ink-faint: #9aa0ab;
  --tip-line: rgba(20, 22, 27, 0.08);
  --tip-accent-ink: linear-gradient(100deg, #6a5a3c 0%, #a08559 45%, #5f6f86 100%);

  --tip-pad: 88px;
  --tip-radius-showcase: 36px;
  --tip-radius-window: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--tip-paper);
}

body {
  overflow: hidden;
  font-family: var(--tip-font-sans);
  color: var(--tip-ink);
  -webkit-font-smoothing: antialiased;
}

body[data-export] {
  display: block;
  height: auto;
  overflow: visible;
  background: var(--tip-paper);
}

/* ---------- Stage ---------- */

.tip-stage {
  --tip-w: 1080px;
  --tip-h: 1440px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
  width: var(--tip-w);
  height: var(--tip-h);
  flex: none;
  padding: var(--tip-pad);
  overflow: hidden;
  background: var(--tip-paper);
  color-scheme: light;
  isolation: isolate;
  transition: background-color 520ms ease;
}

/* Dark theme: neutral grays under the same layout. Pages theme their own UI
   with .tip-stage[data-theme="dark"] and keep color transitions on it. */
.tip-stage[data-theme="dark"] {
  --tip-paper: var(--tip-paper-dark);
  --tip-ink: #ececec;
  --tip-ink-soft: #a3a3a3;
  --tip-ink-faint: #737373;
  --tip-line: rgba(255, 255, 255, 0.1);
  color-scheme: dark;
}

body:has(.tip-stage[data-theme="dark"]) { background: var(--tip-paper-dark); }

/* Preview: centered in the window and scaled to fit, on a gray surround with
   a hairline and a size label marking exactly what an export captures. */
body:not([data-export]) {
  background: #d9d8d4;
}

body:not([data-export]) .tip-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--tip-fit, 1));
  outline: calc(1px / var(--tip-fit, 1)) solid rgba(0, 0, 0, 0.28);
}

/* The export size, just above the stage's top-left corner (placed by tip.js). */
.tip-size-label {
  position: fixed;
  color: rgba(0, 0, 0, 0.5);
  font: 500 12px/1 var(--tip-font-mono);
  pointer-events: none;
}

.tip-stage[data-size="4x5"] { --tip-w: 1080px; --tip-h: 1350px; }
.tip-stage[data-size="1x1"] { --tip-w: 1080px; --tip-h: 1080px; --tip-pad: 72px; gap: 40px; }
.tip-stage[data-size="16x9"] { --tip-w: 1920px; --tip-h: 1080px; --tip-pad: 96px; }

/* ---------- Header ---------- */

.tip-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  font-weight: 600;
  color: var(--tip-ink-soft);
}

.tip-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.tip-brand-name { color: var(--tip-ink); }

.tip-brand-issue {
  margin-left: auto;
  font-family: var(--tip-font-mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--tip-ink-faint);
}

.tip-title {
  margin: 0;
  font-size: 72px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* Latin accent inside a title: the site's italic serif, with its gradient ink. */
.tip-title em {
  padding: 0 0.08em 0.1em 0.02em;
  font-family: var(--tip-font-accent);
  font-size: 1.14em;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--tip-accent-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tip-lede {
  max-width: 30em;
  margin: 20px 0 0;
  font-size: 27px;
  line-height: 1.55;
  color: var(--tip-ink-soft);
}

/* ---------- Backdrops: a Lumno painting behind the stage or a showcase ---------- */

:is(.tip-stage, .tip-showcase)[data-backdrop]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--tip-backdrop) var(--tip-backdrop-pos, center) / cover no-repeat;
}

[data-backdrop="meadow"] { --tip-backdrop: url('./backdrops/meadow.webp'); }
[data-backdrop="monet-coast"] { --tip-backdrop: url('./backdrops/monet-coast.webp'); }
[data-backdrop="monet-soft"] { --tip-backdrop: url('./backdrops/monet-soft.webp'); }
[data-backdrop="seurat-coast"] { --tip-backdrop: url('./backdrops/seurat-coast.webp'); }

/* Softens a busy painting so UI on top stays the subject. */
:is(.tip-stage, .tip-showcase)[data-veil]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 249, 246, var(--tip-veil, 0.35));
}

/* ---------- Showcase: the rounded rectangle ---------- */

.tip-showcase {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  padding: 56px;
  border-radius: var(--tip-radius-showcase);
  overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--tip-line);
  isolation: isolate;
}

/* A white app window, like the one floating over the homepage hero. */
.tip-window {
  position: relative;
  width: 100%;
  border-radius: var(--tip-radius-window);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 0 1px rgba(20, 22, 27, 0.06),
    0 2px 4px rgba(20, 22, 27, 0.04),
    0 24px 60px -12px rgba(30, 36, 50, 0.22);
  backdrop-filter: blur(24px) saturate(1.2);
}

.tip-window-bar {
  display: flex;
  gap: 9px;
  padding: 20px 24px 0;
}

.tip-window-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(20, 22, 27, 0.1);
}

/* ---------- Small parts ---------- */

.tip-label {
  font-family: var(--tip-font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tip-ink-faint);
}

.tip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  color: var(--tip-ink-faint);
}

.tip-foot img { height: 26px; opacity: 0.8; }

/*
 * Author credit, bottom center: handle, then the site's nav wordmark.
 * The wordmark's glyphs fill 0.905 of its height to the baseline and 0.71
 * to the x-height; a 24px Open Sans handle beside a 19px wordmark matches
 * both, and the 1.8px nudge puts the wordmark on the text baseline.
 */
.tip-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: #68717c;
  transition: color 520ms ease;
}

.tip-credit img {
  height: 19px;
  transform: translateY(1.8px);
  transition: filter 520ms ease;
}

.tip-stage[data-theme="dark"] .tip-credit { color: #8f8f8f; }

/* The debossed wordmark turns into its dark twin: light ink, dark rim. */
.tip-stage[data-theme="dark"] .tip-credit img { filter: invert(1); }

/* Keep stage content clear of the credit. */
.tip-stage:has(> .tip-credit) { padding-bottom: 140px; }

/* A Figma-style collaborator cursor that tours a demo; tip.js moves it with tip.pointer. */
.tip-pointer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tip-pointer svg {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 56px;
  height: 56px;
  overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.22));
  transform-origin: 16% 16%;
  transition: transform 120ms ease;
}

.tip-pointer[data-down] svg { transform: scale(0.88); }

/* Name tag: same color as the cursor, square corner toward the tip. */
.tip-pointer-label {
  position: absolute;
  left: 34px;
  top: 42px;
  padding: 9px 14px 10px;
  border-radius: 4px 14px 14px 14px;
  background: var(--tip-pointer-color);
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
