/* ==========================================================================
 * Block 1 of 1 — First-load study splash (LIBRUS)
 * Description: Charcoal gradient, embossed brand, CSS post-it only
 * Version: 2.a
 * Revised: 13Jul26
 * ========================================================================== */

.study-note-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.study-note-modal.is-hidden,
.study-note-modal[hidden] {
  display: none;
}

.study-note-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Modern charcoal vignette */
.study-note-modal--charcoal .study-note-backdrop {
  background-color: #1a1c1e;
  background-image: radial-gradient(
    ellipse 78% 72% at 50% 46%,
    #3a3f46 0%,
    #2c3036 28%,
    #23262b 55%,
    #1a1c1e 100%
  );
}

.study-note-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin: 0 0 0.35rem;
  max-width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
  user-select: none;
}

.study-note-brand-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  opacity: 0.85;
  filter:
    brightness(0) invert(0.88)
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.2))
    drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.5));
}

.study-note-brand-text {
  min-width: 0;
  text-align: left;
}

.study-note-brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: rgba(230, 234, 240, 0.4);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 -1px 0 rgba(0, 0, 0, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.study-note-brand-beta {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  vertical-align: super;
  line-height: 1;
  color: rgba(230, 234, 240, 0.34);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 -1px 0 rgba(0, 0, 0, 0.4);
}

.study-note-brand-tagline {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(230, 234, 240, 0.32);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1),
    0 -1px 0 rgba(0, 0, 0, 0.35);
}

.study-note-lang-pill {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.study-note-lang-btn {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: #eef1f5;
  font-size: 1.45rem;
  line-height: 1;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
}

.study-note-lang-btn + .study-note-lang-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.study-note-lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.study-note-lang-btn.is-active,
.study-note-lang-btn[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.22);
}

.study-note-lang-btn:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: -2px;
  z-index: 1;
}

.study-note-lang-btn:disabled,
.study-note-lang-btn.is-soon,
.study-note-lang-btn[aria-disabled='true'] {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.study-note-lang-btn:disabled:hover,
.study-note-lang-btn.is-soon:hover,
.study-note-lang-btn[aria-disabled='true']:hover {
  background: transparent;
}

.study-note-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Matches librus.html container gap */
  gap: 30px;
  flex: 0 1 auto;
  width: min(3.6in, calc(100vw - 1.5rem));
  min-height: 0;
  max-height: calc(100dvh - 12rem);
  overflow: auto;
  pointer-events: none;
  margin: 0.35rem 0;
  padding-bottom: 1.25rem;
  padding-top: 0.35rem;
}

/* Post-it: 3in × 3in (from librus.html) */
.study-note-sheet {
  position: relative;
  z-index: 2;
  width: min(3in, 94vw);
  height: min(3in, 94vw);
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 20px 15px;
  margin: 0;
  box-sizing: border-box;
  background: #fbf9aa;
  color: #313d42;
  border-radius: 0;
  box-shadow: 3px 12px 18px rgba(0, 0, 0, 0.4);
  transform: rotate(-3deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

.study-note-sheet-text {
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: auto;
  font-family: 'Oooh Baby', cursive;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  font-weight: 400;
  text-align: center;
}

/* HTML/CSS polaroid — 3.48in × 4.23in; photo is PNG (watson) */
.study-note-polaroid {
  position: relative;
  z-index: 1;
  width: min(3.48in, 94vw);
  height: auto;
  aspect-ratio: 3.48 / 4.23;
  flex-shrink: 0;
  margin-top: 0;
  transform: rotate(3deg);
  background: #fbfbfb;
  box-shadow: 3px 12px 18px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 0.15in;
}

.study-note-polaroid-photo {
  width: min(3.1in, 89%);
  height: min(3.1in, 89%);
  aspect-ratio: 1 / 1;
  background: #111;
  margin-top: 0.2in;
  overflow: hidden;
  flex-shrink: 0;
}

.study-note-polaroid-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  filter: brightness(1.55) contrast(0.55) saturate(0.15);
}

.study-note-modal.is-developed .study-note-polaroid-img {
  opacity: 1;
  filter: brightness(1) contrast(1) saturate(1);
  transition:
    opacity 10s ease,
    filter 10s ease;
}

.study-note-polaroid-caption {
  margin: 0.2in 0.15in 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-family: 'Oooh Baby', cursive;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: #111;
}

.study-note-enter-wrap {
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: min(26rem, calc(100vw - 1.5rem));
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

.study-note-enter {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.25rem;
  padding: 0.5rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #eef1f5;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  cursor: pointer;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.study-note-enter:hover {
  background: rgba(255, 255, 255, 0.2);
}

.study-note-enter:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 3px;
}

@media (min-width: 768px) and (min-height: 700px) {
  .study-note-brand-title {
    font-size: 1.55rem;
  }
  /* Keep physical inch sizes from the HTML mockups on desktop */
  .study-note-sheet {
    width: 3in;
    height: 3in;
  }
  .study-note-polaroid {
    width: 3.48in;
  }
  .study-note-stage {
    width: min(4in, calc(100vw - 3rem));
  }
}

body.study-note-open {
  overflow: hidden;
}
