:root{
  /* Typography */
  --font-body: "Coming Soon", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-cta: "Knewave", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Neutral paper palette — warmth lives in hero imagery only */
  --bg0: #d8d7d5;   /* light cool grey */
  --bg1: #cccbca;   /* mid neutral grey */
  --bg2: #b8bbbf;   /* cool blue-grey */
  --ink: #2f2f33;   /* charcoal */

  --card: rgba(240, 239, 237, 0.75);        /* cool paper */
  --card-strong: rgba(244, 243, 241, 0.90);
  --text: rgba(47,47,51,0.92);
  --muted: rgba(47,47,51,0.68);
  --faint: rgba(47,47,51,0.48);
  --border: rgba(47,47,51,0.10);

  /* accents (grey blues) */
  --accent: #6f8796;        /* slate blue */
  --accent-2: #566a77;      /* deeper slate */
  --accent-soft: rgba(111,135,150,0.22);

  --shadow: 0 12px 36px rgba(35,35,40,0.10);
  --radius: 18px;
  --max: 540px;

  /* Notepad lines — adjust to taste */
  --line-color: rgba(47,47,51,0.04);  /* raise for darker rules, lower to fade */
  --line-spacing: 32px;               /* px between ruled lines */

  /* App shell */
  --bottom-nav-height: 60px;

  /* Home background — random image, unified by soft-light overlay */
  --home-bg-image: url("assets/images/bg-1.png"); /* JS-overridden per session; no-JS fallback */
  --bg-image-opacity: 0.22;           /* 0 = hidden, 0.15 = gentle, 0.25 = visible */
  --bg-blur: 2.5px;                   /* 0 = sharp grain, 4px = soft, 8px = dreamy */
  --bg-overlay-color: #c8c2b8;        /* warm-neutral paper tone — nudge toward #d0cbc3 for lighter */
  --bg-overlay-opacity: 0.35;         /* raise to unify more, lower to let images through */
}


* { box-sizing: border-box; }
button { font: inherit; cursor: pointer; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg0);
}

/* Session background image — shared by Home and Diary */
body.home::before,
body.diary-page::before{
  content: "";
  position: fixed;
  inset: 0;
  background: var(--home-bg-image) center / cover no-repeat;
  opacity: var(--bg-image-opacity);
  filter: blur(var(--bg-blur));
  pointer-events: none;
  z-index: 0;
}

/*
   Soft-light overlay — gently neutralises warmth and contrast so all
   16 background images feel cohesive regardless of individual palette.
   mix-blend-mode: soft-light keeps highlights soft and shadows open,
   closer to Figma's Soft Light than multiply or screen.
*/
body.home::after,
body.diary-page::after{
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-overlay-color);
  mix-blend-mode: soft-light;
  opacity: var(--bg-overlay-opacity);
  pointer-events: none;
  z-index: 0;
}


a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.shell{
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar{
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-icon{
  height: 56px;
  width: auto;
  display: block;
}

.brand-textlogo{
  height: 40px;
  width: auto;
  display: block;
}

.nav{
  display: flex;
  gap: 10px;
}

.pill{
  padding: 6px 0;
  border: none;
  border-radius: 0;
  background: none;
  font-size: 13px;
  color: var(--faint);
}

.pill:hover{ background: none; color: var(--text); }

.hero{
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 10px 20px 34px;
  display: grid;
  gap: 18px;
}

.card{
  border: 1px solid var(--border);
  background: var(--card-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(35,35,40,0.06);
  overflow: hidden;
}

.card-inner{
  padding: 30px 28px;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--line-spacing) - 1px),
      var(--line-color) calc(var(--line-spacing) - 1px),
      var(--line-color) var(--line-spacing)
    );
}

.artwork-card{
  border: none;
  background: none;
  box-shadow: none;
}

.artwork-card .card-inner{
  padding: 0;
  display: grid;
  gap: 8px;
  background-image: none;
}

.artwork-card img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.h1{
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  font-weight: 600;
}

.lede{
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  max-width: 70ch;
}

.actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(86, 106, 119, 0.35);
  background: rgba(240, 239, 237, 0.55);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(35,35,40,0.10);
}

.btn:hover{
  background: rgba(240, 239, 237, 0.72);
  border-color: rgba(86, 106, 119, 0.48);
}

.btn.primary{
  background: var(--ink);
  border-color: var(--ink);
  color: rgba(240, 239, 237, 0.95);
}

.btn.primary:hover{
  background: #3d3d42;
  border-color: #3d3d42;
}


.bg-image{
  position: relative;
  background: none;
}

.bg-overlay{
  display: none;
}

.bg-content{
  position: relative;
}

.small{
  color: var(--faint);
  font-size: 13px;
  line-height: 1.4;
}

.form{
  display: grid;
  gap: 12px;
}

.label{
  font-size: 13px;
  color: var(--muted);
}

.input, .textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  padding: 12px 12px;
  font-size: 15px;
  outline: none;
}

.textarea{
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}

.entry-text{
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.row{
  display: grid;
  gap: 12px;
}

@media (max-width: 480px){
  .h1{ font-size: 22px; }
  .card-inner{ padding: 22px 18px; }
}

.list{
  display: grid;
  gap: 10px;
}

.item{
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.item:hover{ background: rgba(255,255,255,0.06); }

.item-title{
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.item-meta{
  order: -1;
  font-size: 12px;
  color: var(--faint);
}

.hr{
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.embed{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.15);
}

.empty-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 0 16px;
  gap: 18px;
}

.empty-text{
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

/* ------------------------------------------------
   Post-it CTA — paper note resting on the page
   ------------------------------------------------ */

.btn-postit{
  /* Tuning knobs */
  --postit-bg: #eee9d9;              /* warm paper — pale sticky-note beige */
  --postit-bg-end: #e6e1d1;          /* slightly darker warm bottom edge */
  --postit-border: rgba(185,175,150,0.35); /* warm neutral edge */
  --postit-rotate: -0.4deg;          /* tiny tilt — physical imperfection */
  --postit-ink: #38362e;             /* warm charcoal ink */

  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;                  /* tap-safe, visually slim */
  padding: 7px 28px;                /* slim vertical — label, not pill */
  background: linear-gradient(180deg, var(--postit-bg), var(--postit-bg-end));
  color: var(--postit-ink);
  font-family: var(--font-cta);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.15px;
  border: 1px solid var(--postit-border);
  border-bottom: 1.5px solid rgba(170,160,135,0.45);
  border-radius: 3px;
  box-shadow:
    0 0.5px 1px rgba(40,38,28,0.08),
    0 3px 8px rgba(40,38,28,0.06);
  transform: rotate(var(--postit-rotate));
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-postit:hover{
  text-decoration: none;
  box-shadow:
    0 0.5px 2px rgba(40,38,28,0.10),
    0 4px 10px rgba(40,38,28,0.07);
  transform: rotate(var(--postit-rotate)) translateY(-0.5px);
}

.btn-postit:active{
  transform: rotate(var(--postit-rotate)) translateY(0.5px) scale(0.98);
  box-shadow:
    0 0.5px 1px rgba(40,38,28,0.10),
    0 1px 3px rgba(40,38,28,0.06);
}

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

/* ------------------------------------------------
   App shell — bottom nav + layout
   ------------------------------------------------ */

body.app-page .shell{
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

body.app-page .topbar .nav{
  display: none;
}

.bottom-nav{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  background: var(--card-strong);
  border-top: 1px solid var(--border);
}

.nav-tab{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active{
  opacity: 1;
}

.nav-tab:hover{
  text-decoration: none;
}

.nav-tab:active{
  transform: scale(0.92);
}

.nav-icon{
  width: 24px;
  height: 24px;
}

.nav-label{
  font-size: 11px;
  color: var(--faint);
  line-height: 1;
}

.nav-tab.active .nav-label{
  color: var(--text);
}

/* ------------------------------------------------
   Landing page
   ------------------------------------------------ */

.landing{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 40px 24px;
}

.landing .brand{
  margin-bottom: 16px;
  opacity: 0.85;
}

.landing .lede{
  max-width: 36ch;
  margin: 0 auto 28px;
}

.landing .small{
  margin-top: 24px;
}

/* ------------------------------------------------
   Home page — responsive desktop / mobile split
   ------------------------------------------------ */

/* Desktop default: hide mobile-only elements */
.app-home-mobile{ display: none; }
.bottom-nav.home-nav{ display: none; }

@media (max-width: 600px){
  /* Swap: hide landing, show app home */
  .landing-desktop{ display: none; }

  .app-home-mobile{
    display: flex;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav.home-nav{
    display: flex;
  }

  /* Topbar recedes — quiet context, not primary chrome */
  .app-home-mobile .brand{
    opacity: 0.45;
  }
}

/* Mobile home: paper sheet rising from the bottom nav */
.home-start{
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  width: auto;
  margin: 0;
  padding: 0;
}

/*
   Home sheet — paper surface rising from the nav edge, tappable.
   Rounded top corners, flat bottom edge sitting on the nav bar.
*/
.home-start .card{
  position: relative;
  border: none;
  border-radius: 26px 26px 0 0;
  background: rgba(246, 245, 243, 0.96);
  box-shadow: 0 -3px 12px rgba(35,35,40,0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Paper lip — subtle 1px highlight at the top edge */
.home-start .card::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 26px 26px 0 0;
  z-index: 1;
  pointer-events: none;
}

.home-card-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px 28px;
  gap: 18px;
}

.home-prompt{
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  letter-spacing: 0.1px;
}

/* ------------------------------------------------
   Compose surface — container-transform modal
   ------------------------------------------------ */

.compose-surface{
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(246, 245, 243, 0.98);
  visibility: hidden;
  pointer-events: none;
  transform-origin: top left;
  will-change: transform;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.compose-surface.compose-open{
  visibility: visible;
  pointer-events: auto;
}

/* Lock page scroll while compose is open */
[data-compose="open"]{
  overflow: hidden;
}

/* Lined-paper texture — same ruled lines as the home card */
.compose-paper{
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 16px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--line-spacing) - 1px),
      var(--line-color) calc(var(--line-spacing) - 1px),
      var(--line-color) var(--line-spacing)
    );
}

.compose-header{
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.compose-close{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: -4px 0 0 -10px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.compose-close:active{
  background: rgba(47,47,51,0.06);
}

.compose-title{
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
  color: var(--text);
}

.compose-lede{
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.compose-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Subtle inputs that blend with the paper surface */
.compose-input{
  background: rgba(47,47,51,0.03);
  border-color: rgba(47,47,51,0.08);
}

.compose-entry-field{
  display: flex;
  flex-direction: column;
  flex: 1;
}

.compose-entry-field .textarea{
  flex: 1;
  min-height: 140px;
  resize: none;
}

.compose-actions{
  padding: 8px 0 4px;
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------
   Write surface — full-page ruled paper for new.html
   ------------------------------------------------ */

body.write-page{
  background: #f6f5f3;
}

.write-surface{
  background: #f6f5f3;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--line-spacing) - 1px),
      var(--line-color) calc(var(--line-spacing) - 1px),
      var(--line-color) var(--line-spacing)
    );
}

/* Content stack — fills the page; top padding clears edge-tab when present */
.write-content{
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 24px 24px;
}

body.has-edge-tab .write-content{
  padding-top: calc(56px + 56px + 16px + env(safe-area-inset-top, 0px));
}

/* Heading and prompt recede — quiet context on paper, not a form title */
.write-content .h1{
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 4px;
}

.write-content .lede{
  font-size: 14px;
  color: var(--faint);
  margin: 0 0 20px;
  text-align: center;
}

/* Form fills available space; textarea stretches to fill */
.write-content .form{
  flex: 1;
  display: flex;
  flex-direction: column;
}

.write-content .paper-textarea{
  flex: 1;
  min-height: 30vh;
}

/* ------------------------------------------------
   Paper textarea — invisible field on ruled paper
   ------------------------------------------------ */

.paper-textarea{
  display: block;
  width: 100%;
  min-height: 50vh;
  padding: 8px 0 0;            /* top offset nudges baseline toward ruled lines */
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: var(--line-spacing);  /* matches the ruled-line interval */
  resize: none;
  -webkit-appearance: none;
}

.paper-textarea::placeholder{
  color: var(--faint);
}

/* ------------------------------------------------
   Post-it small variant — close / back buttons
   ------------------------------------------------ */

.btn-postit-sm{
  --postit-rotate: 0deg;        /* no tilt for close buttons */
  min-height: 36px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
}

/* ------------------------------------------------
   Edge-tab actions — flush to screen edge like
   post-it tabs sticking out of a book.
   ------------------------------------------------ */

.edge-tab{
  position: fixed;
  top: calc(56px + env(safe-area-inset-top, 0px));
  z-index: 50;
  width: 56px;
  height: 56px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  letter-spacing: 0;
  --postit-rotate: 0deg;
  overflow: visible;
  isolation: isolate;
}

/* Icon inside edge tab — above curl shadow */
.edge-tab .edge-tab-icon{
  position: relative;
  z-index: 1;
  display: block;
  width: 24px;
  height: 24px;
}

.edge-tab--left{
  left: 0;
  border-left: none;
  border-radius: 0 3px 3px 0;
}

.edge-tab--right{
  right: 0;
  border-right: none;
  border-radius: 3px 0 0 3px;
}

/* Per-page colour overrides — reflection close / confirm */
.edge-tab--close{
  --postit-bg: #E9B9B9;
  --postit-bg-end: #dfa8a8;
  --postit-border: rgba(180,130,130,0.35);
}

.edge-tab--confirm{
  --postit-bg: #B9E9CB;
  --postit-bg-end: #a4dbb8;
  --postit-border: rgba(120,175,145,0.35);
}

/* Curl shadow — subtle angled pseudo under each tab.
   z-index:0 within the isolate context keeps it behind the icon (z-index:1)
   but still visible outside the button. */
.edge-tab::after{
  content: "";
  position: absolute;
  bottom: -5px;
  width: 75%;
  height: 8px;
  background: rgba(0,0,0,0.10);
  filter: blur(5px);
  z-index: 0;
  pointer-events: none;
}

.edge-tab--left::after{
  left: 15%;
  transform: skewX(-10deg) rotate(-1deg);
}

.edge-tab--right::after{
  right: 15%;
  transform: skewX(10deg) rotate(1deg);
}

/* ------------------------------------------------
   Mood tag — small inline label on entry detail
   ------------------------------------------------ */

.mood-tag{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(47,47,51,0.06);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.entry-meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.entry-reflection{
  margin: 0;
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
}

/* ------------------------------------------------
   Diary page — entries.html
   ------------------------------------------------ */

body.diary-page{
  background: var(--bg0);
}

/* Recede topbar on diary — matches home */
body.diary-page .topbar .brand{
  opacity: 0.45;
}

.diary-content{
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 24px;
}

.diary-list{
  display: grid;
  gap: 28px;
}

/* Each diary item: clickable card + overhanging polaroid */
.diary-item{
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  /* Extra right padding to make room for the polaroid overhang */
  padding-right: 70px;
  -webkit-tap-highlight-color: transparent;
}

.diary-item:hover{ text-decoration: none; }

/* Note card — paper */
.note-card{
  position: relative;
  background: #f6f5f3;
  border: 1px solid rgba(47,47,51,0.06);
  border-radius: 4px;
  padding: 16px 18px;
  box-shadow:
    0 1px 2px rgba(35,35,40,0.06),
    0 3px 10px rgba(35,35,40,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Ruled lines — very subtle */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(var(--line-spacing) - 1px),
      var(--line-color) calc(var(--line-spacing) - 1px),
      var(--line-color) var(--line-spacing)
    );
}

/* Header row: date + mood */
.note-header{
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-date{
  font-family: var(--font-body);
  font-size: 11px;
  color: #343434;
  letter-spacing: 0.3px;
}

.note-mood{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(47,47,51,0.06);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

/* Reflection message — primary line on card */
.note-reflection{
  font-family: var(--font-cta);
  font-size: 16px;
  font-weight: 400;
  color: #343434;
  line-height: 1.35;
}

/* Track info — quiet bottom row */
.note-track{
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.note-track-title{
  font-family: var(--font-body);
  font-size: 13px;
  color: #343434;
}

.note-track-artist{
  font-family: var(--font-body);
  font-size: 11px;
  color: #838383;
}

/* Polaroid — overhangs the note card top-right */
.note-polaroid{
  position: absolute;
  top: -10px;
  right: 0;
  width: 72px;
  pointer-events: none;
}

.note-polaroid-frame{
  background: #fff;
  padding: 4px 4px 14px;
  border-radius: 1px;
  box-shadow:
    0 1px 3px rgba(35,35,40,0.10),
    0 4px 12px rgba(35,35,40,0.06);
  transform: rotate(3deg);
}

.note-polaroid-img{
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1px;
  background: var(--bg1);
}

/* Responsive: tighten on very small screens */
@media (max-width: 380px){
  .diary-item{ padding-right: 60px; }
  .note-polaroid{ width: 60px; }
  .note-card{ padding: 14px 14px; }
}

/* ------------------------------------------------
   Reflection page — entry.html
   ------------------------------------------------ */

body.reflection-page{
  background: #f6f5f3;
}

.reflection-surface{
  background: #f6f5f3;
  min-height: 100vh;
}

.reflection-content{
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: calc(54px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  gap: 24px;
}

body.has-edge-tab .reflection-content{
  padding-top: calc(56px + 56px + 16px + env(safe-area-inset-top, 0px));
}

/* Date — quiet, centered */
.reflection-date{
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #343434;
}

/* Polaroid — white-bordered photo card */
.polaroid{
  margin: 0 auto;
  max-width: 280px;
  width: 100%;
}

.polaroid-frame{
  background: #fff;
  padding: 10px 10px 32px;
  border-radius: 2px;
  box-shadow:
    0 1px 3px rgba(35,35,40,0.08),
    0 6px 20px rgba(35,35,40,0.06);
  transform: rotate(-1deg);
}

.polaroid-img{
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1px;
  background: var(--bg1);
}

/* Entry text — hidden for v1 (markup preserved for re-enable) */
.reflection-text{
  display: none;
}

/* Reflection message */
.reflection-message{
  margin: 0;
  font-family: var(--font-cta);
  font-size: 24px;
  font-weight: 400;
  color: #343434;
  line-height: 1.35;
  text-align: center;
}

/* Track suggestion block — pinned near bottom via margin-top:auto */
.reflection-track{
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding: 16px 0 0;
  text-align: center;
}

.reflection-track-label{
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: #838383;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.reflection-track-title{
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #343434;
  line-height: 1.4;
}

.reflection-track-artist{
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: #838383;
  line-height: 1.4;
}

/* Delete — quiet, below track */
.reflection-actions{
  padding-top: 16px;
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------
   Page entrance animation — subtle slide-up on load
   ------------------------------------------------ */

@media (prefers-reduced-motion: no-preference){
  .page-enter{
    animation: pageEnter 0.22s ease-out;
  }
}

@keyframes pageEnter{
  from{
    opacity: 0;
    transform: translateY(10px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------
   Home → compose transition
   ------------------------------------------------ */

/* Overlay that expands from the sheet to fullscreen */
.sheet-transition-overlay{
  position: fixed;
  z-index: 150;
  background: rgba(246, 245, 243, 0.98);
  pointer-events: none;
  will-change: top, left, width, height, border-radius;
}

/* Bottom nav slides out during transition */
.bottom-nav.nav-exiting{
  transition: transform 220ms cubic-bezier(0.2, 0, 0.2, 1),
              opacity 220ms cubic-bezier(0.2, 0, 0.2, 1);
  transform: translateY(100%);
  opacity: 0;
}

/* Suppress default page-enter when arriving from home sheet transition */
html.from-home-sheet .page-enter{
  animation: none;
}

/* Subtle settle — content gently arrives after sheet expansion */
@media (prefers-reduced-motion: no-preference){
  html.from-home-sheet .shell{
    animation: composeSettle 0.2s ease-out;
  }
}

@keyframes composeSettle{
  from{ opacity: 0.96; transform: translateY(-3px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* Compose exit — slide down + fade when closing /new */
body.write-page-exiting .write-surface,
body.write-page-exiting .edge-tab{
  transition: transform 240ms cubic-bezier(0.2, 0, 0.2, 1),
              opacity 240ms cubic-bezier(0.2, 0, 0.2, 1);
  transform: translateY(40px);
  opacity: 0;
}

body.write-page-exiting .bottom-nav{
  transition: transform 200ms cubic-bezier(0.2, 0, 0.2, 1),
              opacity 200ms cubic-bezier(0.2, 0, 0.2, 1);
  transform: translateY(100%);
  opacity: 0;
}

