/* =========================================================
   Anabelle's Grad Invite — editable watercolor template
   Palette: cream paper + baby blue (school colors) + navy ink + gold tassel accent
   ========================================================= */

:root {
  --cream:       #f6efe2;     /* warm paper background */
  --cream-soft:  #fbf6ea;     /* card surface */
  --baby-blue:   #a8c8e0;     /* school accent */
  --baby-blue-2: #c9dcec;     /* lighter wash */
  --navy:        #1a2a44;     /* hand-lettering ink */
  --navy-soft:   #2b3a55;
  --gold:        #d6a72f;     /* tassel accent */
  --ink-body:    #2a2a2a;     /* body copy */
  --rule:        rgba(26, 42, 68, 0.18);
  --shadow-card: 0 30px 60px -20px rgba(26, 42, 68, 0.30),
                 0 8px 18px -8px  rgba(26, 42, 68, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #efe7d6 0%, #f6efe2 40%, #efe7d6 100%);
  color: var(--ink-body);
  font-family: "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ TOOLBAR ============ */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 239, 226, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 14px 24px 12px;
}
.toolbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--baby-blue);
  box-shadow: 0 0 0 3px rgba(168, 200, 224, 0.25);
}
.brand-name {
  font-family: "Caveat", "Sacramento", cursive;
  font-size: 24px;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand-tag {
  font-size: 13px;
  color: var(--navy-soft);
  opacity: 0.75;
}
.toolbar-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.bg-slider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.bg-slider span { opacity: 0.75; }
.bg-slider input[type="range"] {
  width: 100px;
  accent-color: var(--baby-blue);
}
.btn {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease, color 120ms ease;
}
.btn.primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn.primary:hover { background: var(--navy-soft); }
.btn.ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--rule);
}
.btn.ghost:hover { background: rgba(168, 200, 224, 0.18); }
.btn:active { transform: translateY(1px); }

.toolbar-hint {
  max-width: 1100px;
  margin: 8px auto 0;
  font-size: 13px;
  color: var(--navy-soft);
  opacity: 0.72;
}

/* ============ STAGE + CARD ============ */
.stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 24px 80px;
}

/* The card itself — 5x7 aspect, scaled to viewport */
.card {
  position: relative;
  width: min(560px, 90vw);
  aspect-ratio: 5 / 7;
  background: var(--cream-soft);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
}
/* paper texture hint */
.card::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(214, 167, 47, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(168, 200, 224, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Faded campus-path backdrop. Sits behind caps, in front of paper texture. */
.card-bg {
  position: absolute;
  /* Pulled slightly down + scaled so the building cupola sits roughly under
     the "class of YYYY" line and the path opens toward the bottom name block. */
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 110%;
  height: auto;
  z-index: 0;
  opacity: var(--bg-opacity, 0.35);
  pointer-events: none;
  mix-blend-mode: multiply;     /* lets the cream paper bleed through the white pixels */
  filter: saturate(0.85);
  user-select: none;
}

/* ============ CAP CLUSTER ============ */
.caps { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cap {
  position: absolute;
  width: 32%;       /* relative to card */
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(26, 42, 68, 0.08));
  user-select: none;
}

/* Seven caps scattered around the border, mimicking the reference card */
.cap-1 { top: 2%;   left: 2%;   transform: rotate(-18deg); width: 30%; }
.cap-2 { top: 4%;   left: 36%;  transform: rotate(  6deg); width: 22%; opacity: 0.92; }
.cap-3 { top: 8%;   right: 1%;  transform: rotate( 24deg); width: 32%; }
.cap-4 { top: 38%;  left: -3%;  transform: rotate(-32deg); width: 28%; }
.cap-5 { top: 36%;  right: -2%; transform: rotate( 14deg); width: 30%; opacity: 0.95; }
.cap-6 { top: 56%;  left:  4%;  transform: rotate(-12deg); width: 26%; }
.cap-7 { top: 50%;  right:  6%; transform: rotate( 28deg); width: 24%; opacity: 0.9; }

/* ============ HEADLINE — "class of YYYY" ============ */
.headline {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 84%;
  text-align: center;
  z-index: 2;
  color: var(--navy);
  line-height: 0.95;
}
.class-of {
  display: block;
  font-family: "Sacramento", "Caveat", cursive;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: -4px;
  transform: rotate(-2deg);
}
.class-year {
  display: block;
  font-family: "Caveat", "Sacramento", cursive;
  font-weight: 700;
  font-size: clamp(96px, 22vw, 180px);
  letter-spacing: -2px;
  outline: none;
  /* subtle outline underline that fades when actively editing */
  border-bottom: 2px dashed transparent;
  transition: border-color 200ms ease;
  padding: 0 8px;
  cursor: text;
}
.class-year:hover { border-bottom-color: rgba(168, 200, 224, 0.6); }
.class-year:focus { border-bottom-color: var(--baby-blue); background: rgba(255, 255, 255, 0.5); }

/* ============ DETAILS (editable middle/bottom) ============ */
.details {
  position: absolute;
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%);
  width: 86%;
  text-align: center;
  z-index: 2;
  color: var(--navy);
}
.event-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(22px, 4.6vw, 34px);
  margin: 0 0 10px;
  letter-spacing: 0.4px;
  outline: none;
  border-bottom: 2px dashed transparent;
  transition: border-color 200ms ease;
  padding: 4px 6px 6px;
  cursor: text;
}
.event-name:hover { border-bottom-color: rgba(168, 200, 224, 0.6); }
.event-name:focus { border-bottom-color: var(--baby-blue); background: rgba(255, 255, 255, 0.5); }

.event-line {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: clamp(15px, 2.8vw, 21px);
  margin: 2px 0;
  letter-spacing: 0.4px;
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 200ms ease;
  padding: 2px 6px;
  cursor: text;
  min-height: 1.4em;
}
.event-line:hover { border-bottom-color: rgba(168, 200, 224, 0.6); }
.event-line:focus { border-bottom-color: var(--baby-blue); background: rgba(255, 255, 255, 0.5); }

/* placeholder pattern for empty editable lines */
[contenteditable=""]:empty::before,
.event-line:empty::before,
.event-name:empty::before,
.class-year:empty::before {
  content: attr(data-default);
  opacity: 0.35;
  font-style: italic;
}

/* ============ FOOTER NOTE ============ */
.page-foot {
  max-width: 720px;
  margin: 0 auto 60px;
  padding: 0 24px;
  text-align: center;
  font-size: 14px;
  color: var(--navy-soft);
  opacity: 0.7;
  line-height: 1.55;
}

/* ============ PRINT — drop UI, fit card to one page ============ */
@media print {
  @page {
    size: 5in 7in;
    margin: 0;
  }
  html, body {
    background: var(--cream-soft) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .no-print { display: none !important; }
  .stage {
    padding: 0;
    min-height: 100vh;
    align-items: center;
  }
  .card {
    width: 5in;
    aspect-ratio: 5 / 7;
    box-shadow: none;
    border-radius: 0;
  }
  /* hide the dashed editing affordances in the print */
  .class-year,
  .event-name,
  .event-line { border-bottom-color: transparent !important; background: transparent !important; }
}

/* ============ Small-screen sanity ============ */
@media (max-width: 520px) {
  .toolbar-hint { font-size: 12px; }
  .stage { padding: 24px 16px 60px; }
}
