/* A loop page: one remembered dream. The loop is the screen on a phone, a lit window on a desk; the words read like
   the line you write down on waking, and the pack's buy sits under it on the first screen. */

@font-face { font-family: "Instrument Serif"; src: url(/serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/mono.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #050308;
  --ink: #fbf7ff;
  --dim: rgba(251, 247, 255, 0.72);
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(1.1rem, 4vw, 3rem);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { color: var(--ink); font-family: var(--serif); line-height: 1.25; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* The phone: the loop fills the screen behind everything, darkened toward the bottom where the words sit. */
.loop-frame { position: fixed; inset: 0; margin: 0; z-index: 0; }
.loop-film { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg); }

.loop-card { position: relative; z-index: 1; }
.loop-first { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad) var(--pad) calc(var(--pad) + var(--safe-b));
  /* the shade travels with the words, so they stay readable over a bright loop when the page scrolls */
  background: linear-gradient(to bottom, rgba(5, 3, 8, 0) 38%, rgba(5, 3, 8, 0.55) 62%, rgba(5, 3, 8, 0.94) 100%); }
.loop-fact, .loop-hint, .loop-words { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: lowercase;
  color: var(--dim); margin: 0; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.loop-dream { font-style: italic; font-weight: 400; font-size: clamp(2.3rem, 10.5vw, 4.6rem); line-height: 0.98;
  letter-spacing: -0.01em; margin: 0.5rem 0 1.3rem; text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.loop-hint { margin-top: 0.7rem; }

.btn-accent { display: inline-flex; align-self: flex-start; align-items: center; gap: 0.5em; min-height: 3.3rem; padding: 0 1.7rem;
  border-radius: 999px; background: var(--ink); color: #0a0610; font-family: var(--serif); font-style: italic; font-size: 1.5rem;
  text-decoration: none; white-space: nowrap; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(251, 247, 255, 0.5);
  animation: pulse 3.2s ease-out infinite; }
.btn-accent b { font-family: var(--mono); font-style: normal; font-weight: 400; font-size: 0.95rem; letter-spacing: 0.04em; }
.btn-accent:hover, .btn-accent:focus-visible { background: #fff; outline: none; animation: none;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(251, 247, 255, 0.35); }
@keyframes pulse {
  0% { box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(251, 247, 255, 0.55); }
  70% { box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45), 0 0 0 14px rgba(251, 247, 255, 0); }
  100% { box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(251, 247, 255, 0); }
}
@media (prefers-reduced-motion: reduce) { .btn-accent { animation: none; } }

/* The dollar dream: this loop alone, a quiet outlined pill under the pack's bright one. */
.loop-single { display: inline-flex; align-self: flex-start; align-items: center; gap: 0.5em; min-height: 2.9rem; margin-top: 0.7rem;
  padding: 0 1.4rem; border-radius: 999px; border: 1px solid rgba(251, 247, 255, 0.55); background: rgba(5, 3, 8, 0.35);
  color: var(--ink); font-family: var(--serif); font-style: italic; font-size: 1.2rem; text-decoration: none; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.loop-single b { font-family: var(--mono); font-style: normal; font-weight: 400; font-size: 0.85rem; letter-spacing: 0.04em; }
.loop-single:hover, .loop-single:focus-visible { border-color: var(--ink); background: rgba(251, 247, 255, 0.12); outline: none; }

/* Under the first screen: what the loop is, in the words a search uses, and the way on. */
.loop-more { background: var(--bg); padding: 2.2rem var(--pad) calc(2.6rem + var(--safe-b)); }
.loop-search { font-style: italic; font-weight: 400; font-size: 1.55rem; line-height: 1.15; margin: 0 0 0.8rem; }
.loop-about { font-size: 1.15rem; color: var(--dim); margin: 0 0 1rem; max-width: 34rem; }
.loop-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; margin-top: 1.8rem; }
.loop-nav a { color: var(--ink); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: lowercase;
  text-decoration: none; border-bottom: 1px solid rgba(251, 247, 255, 0.4); padding: 0.75rem 0 0.2rem; }
.loop-nav a i { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0; text-transform: none; margin-left: 0.3em; }
.loop-nav a:hover, .loop-nav a:focus-visible { border-color: var(--ink); outline: none; }

/* The desk: the loop stands as a lit phone-shaped window, its own still blurred behind it; the words beside it. */
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; align-items: center;
    column-gap: clamp(2rem, 5vw, 6rem); padding: 0 clamp(2rem, 6vw, 7rem); }
  body::before { content: ""; position: fixed; inset: -40px; z-index: 0; background: var(--still) center / cover no-repeat;
    filter: blur(48px) brightness(0.32) saturate(1.2); }
  .loop-frame { position: relative; inset: auto; justify-self: end; height: min(86vh, 820px); aspect-ratio: 9 / 16; z-index: 1;
    border-radius: 22px; overflow: hidden; box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(251, 247, 255, 0.08); }
  .loop-card { max-width: 38rem; }
  .loop-first { min-height: 0; padding: 0; background: none; }
  .loop-fact, .loop-hint, .loop-words { font-size: 0.8rem; }
  .loop-dream { font-size: clamp(3rem, 4.6vw, 5rem); }
  .loop-more { background: none; padding: 2.6rem 0 0; }
  .loop-words { max-width: 30rem; }
}

/* The send: a quiet line under the buy that wakes when the loop first wraps. */
.loop-send { align-self: flex-start; margin-top: 1.1rem; padding: 0.55rem 0; min-height: 2.75rem; background: none; border: 0;
  border-bottom: 1px solid rgba(251, 247, 255, 0.35); color: inherit; font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: lowercase; cursor: pointer; animation: loop-send-in 0.9s ease-out both; }
.loop-send[hidden] { display: inline-block; visibility: hidden; }
.loop-send:hover, .loop-send:focus-visible { border-bottom-color: #fff; outline: none; }
@keyframes loop-send-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .loop-send { animation: none; } }
