@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Newsreader:opsz,wght@6..72,600;6..72,700;6..72,800&family=Prata&family=Inter:wght@400;500&display=swap');

:root {
  --ink: #f2ede1;           /* pale cream text, sits on dark photo */
  --ink-dim: rgba(242, 237, 225, 0.68);
  --accent: #d8c9a3;        /* warm gold/cream for interactive bits */
  --accent-soft: rgba(216, 201, 163, 0.35);
  --scrim-top: rgba(12, 18, 20, 0.15);
  --scrim-mid: rgba(18, 26, 28, 0.55);
  --scrim-bottom: rgba(10, 15, 17, 0.86);
}

* {
  box-sizing: border-box;
}

html {
  /* nearly every size in this stylesheet is in rem, so scaling the root
     font-size scales the whole site's type + rem-based spacing together —
     this bakes in the "75% zoom" look as the actual 100% rendering, so
     nobody has to manually zoom out to get the density you like */
  font-size: 75%;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* dark from the very first paint — otherwise a full page navigation
     between today/share-yours briefly shows the browser's default white
     canvas before this stylesheet's own dark backgrounds take over.
     Softened from a starker near-black (#0b1012) — this color shows
     plainly during the moment before the photo fades in, and pure black
     felt harsh/flat there rather than like part of the same warm palette
     as the scrim and accent colors. */
  background-color: #171c1e;
  color-scheme: dark;
  /* stops mobile Safari/WebKit from auto-inflating text size ("font
     boosting") on narrow screens — without this, the exact same font-size
     renders visibly larger on phone than on desktop */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* used to show a colorful placeholder gradient here while the photo loaded
   in — but now that the same photo persists across today/share-yours (see
   bg.js), that gradient just flashed a mismatched color for a split second
   on every page. Removed; the dark html/body background shows through
   instead, so there's nothing to flash before the (usually already-cached)
   photo fades in. */
.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* a plain div with background-image instead of an <img> with object-fit —
   object-fit: cover combined with position: fixed has a known Safari bug
   where the image renders squished/distorted for a moment on reload
   (desktop Safari specifically). background-size: cover doesn't have this
   bug in any browser, since it's a much older and more consistently
   implemented pattern than object-fit. */
.bg-photo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0;
  /* slow, soft rise out of black rather than a quick fade — ease-out so it
     settles gently at the end instead of arriving all at once */
  transition: opacity 0.8s ease-out;
}

.bg-photo.loaded {
  opacity: 1;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    var(--scrim-top) 0%,
    var(--scrim-mid) 55%,
    var(--scrim-bottom) 100%
  );
}


/* --- nav --- */
/* three-column grid (brand / date / nav) so the date can sit truly
   centered on the header row regardless of how wide the brand or nav are */
.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 16px;
  padding: 32px 40px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-header .brand-wrap {
  grid-column: 1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.site-header .brand {
  font-family: 'Prata', serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  text-decoration: none;
}

/* explicit grid-column (rather than relying on source order) so pages
   without a date-line, like shareyours.html, still keep nav pinned to the
   right-hand column instead of collapsing into the middle one */
.site-header .date-line {
  grid-column: 2;
  justify-self: center;
  margin: 0;
  white-space: nowrap;
}

.site-header nav {
  grid-column: 3;
  justify-self: end;
}

.site-header nav a {
  color: var(--ink-dim);
  text-decoration: none;
  margin-left: 26px;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* below this width the 3-column layout (wordmark / date / nav) doesn't
   have room to breathe and starts crowding or overlapping — stack
   everything into one centered column instead of fighting for the same
   row. Overriding each child's explicit grid-column back to 1 is required
   here, otherwise their desktop column-3 placement would force the grid to
   grow extra (empty) columns instead of actually stacking. */
@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr;
    row-gap: 16px;
    padding: 24px 20px;
  }

  .site-header .brand-wrap,
  .site-header .date-line,
  .site-header nav {
    grid-column: 1;
    justify-self: center;
  }

  .site-header .brand-wrap {
    align-items: center;
  }

  .site-header nav a:first-child {
    margin-left: 0;
  }
}

/* --- stage: one line a day --- */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 40px 24px 120px;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

.date-line {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 34px;
}

.note-line {
  font-family: 'Newsreader', serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6.4vw, 4.6rem);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  text-wrap: balance;
}

.note-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* note.html (the standalone permalink a QR code / shared link opens) has
   no progress bar or next-control footer to balance against, so it centers
   the line vertically instead of anchoring it to the bottom */
.stage-solo {
  justify-content: center;
  padding-bottom: 40px;
}

.interaction {
  position: relative;
  display: flex;
  justify-content: center;
}

.me-too-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent-soft);
  padding: 7px 4px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

/* only apply hover on devices that actually have hover (a mouse) — on
   touchscreens, tapping the button otherwise "sticks" this style on since
   there's no mouse-leave event to clear it, making the button look stuck
   yellow even after the tap-to-cancel removes .tapped */
@media (hover: hover) and (pointer: fine) {
  .me-too-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
  }
}

.me-too-btn.tapped {
  color: var(--accent);
  border-color: var(--accent);
}

/* two small overlapping rings — a quiet "common feeling" motif (two
   experiences meeting) instead of a checkmark or an animated dot. Static,
   no motion — just a simple fade + scale in on tap. The spacer is an
   invisible twin so "me too" stays centered whether the rings are showing
   or not. */
.btn-icon-spacer,
.btn-icon {
  display: inline-flex;
  align-items: center;
}

.btn-icon-ring {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.btn-icon-ring + .btn-icon-ring {
  margin-left: -3px;
}

.btn-icon-spacer {
  visibility: hidden;
}

.btn-icon {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.me-too-btn.tapped .btn-icon {
  opacity: 1;
  transform: scale(1);
}

/* reveal-block (the count) is absolutely positioned below the button, so
   it never changes the height of .interaction — nothing above it shifts
   when it fades in or out. It's the only thing that appears here now —
   save/share live down in the footer so they don't compete with it. */
.reveal-block {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 18px;
  width: max-content;
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.reveal-block.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* elegant, upright caption style — replaces the old italic treatment */
.count-reveal {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
  white-space: nowrap;
}

/* save/share row — sits quietly in the footer, well below the count, and
   only appears once there's actually something to save or share. Space is
   always reserved (opacity-only transition) so nothing else in the footer
   shifts when it fades in or out. */
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.action-row.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.share-link {
  position: relative;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: none;
  padding: 2px 2px 8px;
  cursor: pointer;
  transition: color 0.7s ease-in-out;
  min-width: 68px;
  text-align: center;
}

/* a shorter, centered underline instead of one spanning the full button
   width — the button itself stays fixed-width so save/share still line up
   as a matched pair, the line beneath each word is just more modest */
.share-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 46px;
  height: 1px;
  background: var(--accent-soft);
  transition: background 0.7s ease-in-out;
}

.share-link:hover {
  color: var(--ink);
}

.share-link:hover::after {
  background: var(--ink);
}

.share-link:disabled {
  color: var(--ink-dim);
  cursor: default;
}

/* --- preview lightbox: shown after save/share generates the card, so
   people can see what they're actually getting before it downloads or
   opens the share sheet. `visibility` is included in the transition (not
   just opacity) so the fade-out is actually visible when closing — without
   it, visibility:hidden applies instantly and the opacity animation never
   gets a chance to render. --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 32px 24px;
  background: rgba(8, 10, 10, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.show {
  opacity: 1;
  visibility: visible;
}

/* the card itself gets its own subtle pop in/out, on top of the backdrop
   fade, so returning to the main view feels like a settle rather than a cut */
.lightbox-img,
.lightbox-actions {
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lightbox.show .lightbox-img,
.lightbox.show .lightbox-actions {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.lightbox-img {
  max-width: min(360px, 84vw);
  max-height: 68vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lightbox-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 12px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.lightbox-close {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--accent-soft);
}

.lightbox-close:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.lightbox-confirm {
  background: var(--accent);
  color: #1a1f1c;
  border: 1px solid var(--accent);
}

.lightbox-confirm:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.lightbox-confirm:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- progress bar + next control (12 lines a day) --- */
.stage-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px 44px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.progress-track {
  width: 100%;
  height: 2px;
  background: rgba(242, 237, 225, 0.18);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.progress-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.next-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease;
}

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

.done-msg {
  font-family: 'Newsreader', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink-dim);
  text-align: center;
  padding: 0 24px;
  line-height: 1.6;
}

/* --- submit page --- */
.submit-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 64px;
}

.submit-card {
  max-width: 620px;
  width: 100%;
  text-align: center;
}

.submit-card p.intro {
  font-family: 'Fraunces', serif;
  font-style: normal;
  font-weight: 400;
  color: var(--ink-dim);
  font-size: clamp(0.95rem, 2.6vw, 1.32rem);
  line-height: 1.6;
  margin-bottom: 30px;
  white-space: nowrap;
}

label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 8px;
  margin-top: 20px;
  text-align: left;
}

/* holds the textarea + empty-msg so the message can be absolutely
   positioned right under the box without pushing char-count/the button
   down when it appears */
.field-wrap {
  position: relative;
}

textarea {
  width: 100%;
  height: 118px;
  font-family: 'Fraunces', serif;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(242, 237, 225, 0.05);
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  padding: 18px 20px;
  resize: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}

textarea::placeholder {
  font-family: 'Fraunces', serif;
  color: var(--ink-dim);
  opacity: 0.45;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(242, 237, 225, 0.08);
}

.char-count {
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 4px;
}

/* wraps the button + thank-you message so the message can be absolutely
   positioned underneath it — appearing there adds no height to the form,
   so the vertically-centered card above never shifts when it shows up */
.submit-action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 28px;
}

.submit-btn {
  margin-top: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 13px 32px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.submit-btn:hover {
  background: var(--accent);
  color: #1a1f1c;
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* elegant, upright caption style — replaces the old italic treatment */
.thanks-msg {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 16px;
  width: max-content;
  max-width: 90vw;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.thanks-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* shown right under the textarea when "share it" is clicked with nothing
   written yet — plain text, no box, same treatment as the site-footer
   line ("every line is read before anything goes live") */
.empty-msg {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.empty-msg.show {
  opacity: 1;
}

/* --- "X here right now" — quiet ambient indicator, tucked in a corner
   rather than competing with the main content. Starts invisible and only
   fades in once the first count actually arrives, so it never flashes
   empty. --- */
.visitor-count {
  position: fixed;
  left: 24px;
  bottom: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.visitor-count.show {
  opacity: 0.85;
}

/* on the main page it now lives tucked under the wordmark instead of
   pinned to the corner — same element, just no longer fixed/floating */
.brand-wrap .visitor-count {
  position: static;
  left: auto;
  bottom: auto;
}

.visitor-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: visitor-pulse 2.4s ease-in-out infinite;
}

@keyframes visitor-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-bottom: 34px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
