/* =========================================================
   MY STORY PAGE (about.html)
   ========================================================= */

/* ---------- DRAGGABLE PHOTO BOARD ---------- */

.story-hero {
  padding-block: 3rem 4rem;
  overflow: hidden;
}

.story-board {
  position: relative;
  max-width: 1100px;
  margin-inline: auto;
  height: 660px;
  padding-inline: 1.5rem;
  isolation: isolate;
}

/* Fade only the board background, leaving photo cards fully opaque. */
.story-board::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 45%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 45%, transparent 85%);
}

.story-title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-inline: 1.5rem;
  pointer-events: none;
  z-index: 8; /* above every pinned photo */
}

/* Keep the title shadow on the text so it does not darken the photos. */

.story-title h1 {
  /* Scales with viewport so the full name stays on one line */
  font-size: clamp(1.5rem, 4.2vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  margin-inline: auto;
  margin-bottom: 1.1rem;
  text-shadow: 0 4px 24px rgba(10, 15, 30, 0.9);
  animation: titleIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.drag-hint { animation: titleIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both; }

@keyframes titleIn {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}
.drag-hint svg { width: 15px; height: 15px; stroke-linecap: round; stroke-linejoin: round; }

/* Pinned photos */
.pin {
  position: absolute;
  margin: 0;
  width: 210px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 2;
  transition: box-shadow 0.2s ease;
  animation: pinDrop 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.pin--1 { animation-delay: 0.15s; animation-name: pinInLeft; }
.pin--2 { animation-delay: 0.28s; animation-name: pinInRight; }
.pin--3 { animation-delay: 0.41s; animation-name: pinInLeft; }
.pin--4 { animation-delay: 0.54s; animation-name: pinInRight; }

/* Opacity + margin only — never `transform`, which the drag code owns. */
@keyframes pinDrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pinInLeft {
  from { opacity: 0; margin-left: -34px; }
  to   { opacity: 1; margin-left: 0; }
}
@keyframes pinInRight {
  from { opacity: 0; margin-left: 34px; }
  to   { opacity: 1; margin-left: 0; }
}

/* Lift on hover so they invite dragging */
.pin:hover, .sticky-note:hover { filter: brightness(1.08); }
.pin:active,
.pin.is-dragging { cursor: grabbing; z-index: 10; }

.pin-ph,
.pin img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--accent-red);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.pin figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
  pointer-events: none;
}

.pin--1 { top: 3%;  left: 1%;  transform: rotate(-5deg); }
.pin--2 { top: 2%;  right: 1%; transform: rotate(4deg); width: 240px; }
.pin--2 .pin-ph { aspect-ratio: 4 / 3; }
.pin--3 { bottom: 4%; left: 2%; transform: rotate(3deg); width: 250px; }
.pin--3 .pin-ph { aspect-ratio: 4 / 3; }
.pin--4 { bottom: 4%; right: 2%; transform: rotate(-4deg); }

/* Sticky note */
.sticky-note {
  position: absolute;
  top: 8%;
  left: 34%;
  width: 175px;
  padding: 1.5rem 1.15rem;
  background: #ffd6e4;
  color: #542239;
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: center;
  transform: rotate(-6deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 3;
  animation: pinDrop 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.66s both;
}
.sticky-note:active,
.sticky-note.is-dragging { cursor: grabbing; z-index: 10; }

/* ---------- STORY TEXT ---------- */

.story-heading {
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-bottom: 3rem;
}

.story-body {
  max-width: 62ch;
  margin-inline: auto;
  margin-block: 3rem;
}
.story-body p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---------- TILTED WORK GALLERY ---------- */

.tilt-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 720px;
  margin-inline: auto;
}

.tilt { margin: 0; }
.tilt-ph,
.tilt img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--accent-red);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.tilt--a { transform: rotate(-3deg); }
.tilt--b { transform: rotate(2.5deg); }
.tilt--c { transform: rotate(2deg); }
.tilt--d { transform: rotate(-2.5deg); }

.tilt:hover .tilt-ph,
.tilt:hover img { transform: scale(1.04) translateY(-4px); }

/* ---------- LIFE GALLERY ---------- */

.life-gallery {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  max-width: 760px;
  margin-inline: auto;
  align-items: start;
}

.life { margin: 0; }
.life-ph,
.life img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--accent-red);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.life--tall { grid-row: span 2; }
.life--tall .life-ph,
.life--tall img { aspect-ratio: 3 / 4; height: 100%; }

.life figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-faint);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 880px) {
  /* Dragging a board this size doesn't work on a phone — stack instead */
  .story-board {
    height: auto;
    padding-block: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background-image: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .pin,
  .sticky-note {
    position: static;
    transform: none !important;
    width: min(280px, 80%);
    cursor: default;
  }
  .story-title { position: static; order: -1; margin-bottom: 1rem; }
  .story-title h1 { white-space: normal; font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .story-title::before { display: none; }
  .drag-hint { display: none; }

  .tilt-gallery { grid-template-columns: 1fr; max-width: 420px; }
  .tilt { transform: none; }
  .life-gallery { grid-template-columns: 1fr; max-width: 420px; }
  .life--tall { grid-row: auto; }
  .life--tall .life-ph { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
  .story-title h1,
  .drag-hint,
  .pin,
  .sticky-note { animation: none; }
}

/* ---------- SCROLL ANIMATIONS ---------- */

.story-heading,
.story-body p,
.tilt,
.life {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.story-heading.is-visible,
.story-body p.is-visible,
.life.is-visible { opacity: 1; transform: none; }

/* Tilted items keep their rotation when revealed */
.tilt.is-visible { opacity: 1; }
.tilt--a.is-visible { transform: rotate(-3deg); }
.tilt--b.is-visible { transform: rotate(2.5deg); }
.tilt--c.is-visible { transform: rotate(2deg); }
.tilt--d.is-visible { transform: rotate(-2.5deg); }

/* Stagger within each gallery */
.tilt--b { transition-delay: 0.1s; }
.tilt--c { transition-delay: 0.2s; }
.tilt--d { transition-delay: 0.3s; }
.life:nth-child(2) { transition-delay: 0.12s; }
.life:nth-child(3) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .story-heading,
  .story-body p,
  .tilt,
  .life { opacity: 1 !important; transform: none !important; transition: none; }
}
/* Emphasize the name in the story introduction. */
.story-title h1 .gradient-text {
  display: inline-block;
  font-size: 1.12em;
  font-weight: 700;
  background: linear-gradient(100deg, #ff5c96, #ff174f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(255, 23, 79, 0.3));
  text-shadow: none;
}

@media (max-width: 600px) {
  .story-title h1 {
    white-space: normal;
  }
  .story-title h1 .gradient-text {
    display: block;
    margin-top: 0.15em;
  }
}
/* Two-line story heading, keeping the existing site font. */
.story-title h1 {
  white-space: normal;
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  line-height: 1.08;
}
.story-title h1 .gradient-text {
  display: block;
  margin-top: 0.1em;
  font-size: 1.2em;
  background: linear-gradient(100deg, #ff5c96, #ff174f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(255, 23, 79, 0.3));
  text-shadow: none;
}
/* Keep the story heading and every text block on the same column. */
.story-section .story-heading,
.story-section .story-body,
.story-section .story-video-gallery,
.story-section .story-feature-video {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  text-align: left;
}
/* Two landscape video frames in one row in My Story. */
.story-video-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 760px;
  margin-inline: auto;
}
.story-video { margin: 0; min-width: 0; }
.story-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #080d18;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.story-video figcaption {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .story-video-gallery { gap: 0.75rem; }
}

/* Featured video replacing the life photo placeholders. */
.story-feature-video { max-width: 760px; margin-inline: auto; }
.story-feature-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: var(--radius);
  background: #080d18;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Photos for the draggable board and closing story gallery. */
.pin--2 img { object-position: center 25%; }
.pin--3 img { aspect-ratio: 4 / 3; }
.pin--4 img { object-position: center 55%; }
.story-photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 760px;
  margin: 3rem auto 1rem;
}
.story-photo-gallery figure { margin: 0; min-width: 0; }
.story-photo-gallery figure:first-child { transform: rotate(-2deg); }
.story-photo-gallery figure:last-child { transform: rotate(2deg); }
.story-photo-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 40%;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
@media (max-width: 600px) {
  .story-photo-gallery { gap: 1rem; }
}

/* Personal captions beneath the story photos. */
.pin figcaption,
.story-photo-gallery figcaption {
  margin-top: 0.7rem;
  text-align: center;
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--white);
}

/* Pan the grid by dragging the empty desktop board. */
.story-board::before { background-position: var(--grid-x, 0px) var(--grid-y, 0px); }
@media (min-width: 880px) {
  .story-board { cursor: grab; touch-action: none; }
  .story-board.is-panning { cursor: grabbing; user-select: none; }
}

/* Italic emphasis for the name and Story heading. */
.story-title h1 .gradient-text,
.story-heading .gradient-text { font-style: italic; }

/* Smaller headings with room for italic overhang and wrapping. */
.story-heading {
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.story-title h1 {
  font-size: clamp(1.7rem, 4.3vw, 3.5rem);
  line-height: 1.2;
  max-width: 100%;
  white-space: normal;
}
.story-title h1 .gradient-text,
.story-heading .gradient-text {
  display: inline-block;
  padding: 0.08em 0.18em 0.12em 0.04em;
  margin-right: -0.18em;
  line-height: 1.2;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.story-title h1 .gradient-text {
  display: block;
  font-size: 1.1em;
}

/* Slightly larger introduction, preserving the current name size. */
.story-title h1 { font-size: clamp(1.9rem, 4.8vw, 3.9rem); }
.story-title h1 .gradient-text { font-size: clamp(1.87rem, 4.73vw, 3.85rem); }

/* Reference-inspired handwritten title and folded paper note. */
.story-title h1 {
  font-weight: 300;
  font-size: clamp(2.1rem, 5.5vw, 4.5rem);
  line-height: 1.12;
  text-shadow: none;
}
.story-title h1 .gradient-text {
  font-family: "Caveat", "Segoe Print", cursive;
  font-size: clamp(3rem, 7.3vw, 6rem);
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  padding: 0.04em 0.14em 0.12em;
  margin: 0;
  filter: none;
}
.sticky-note {
  width: 210px;
  min-height: 195px;
  top: 3%;
  left: calc(50% - 105px);
  padding: 3.3rem 1.25rem 1.5rem;
  display: grid;
  align-content: center;
  font-family: "Caveat", "Segoe Print", cursive;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
  background: #ffd6e4;
  transform: rotate(-12deg);
}
.sticky-note::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 30px;
  background: #ffb8d0;
  clip-path: polygon(0 8%, 100% 0, 100% 90%, 0 100%);
  pointer-events: none;
}
.pin figcaption,
.story-photo-gallery figcaption { font-family: "Caveat", "Segoe Print", cursive; font-size: 1.15rem; font-weight: 600; }
.story-heading .gradient-text { font-family: "Caveat", "Segoe Print", cursive; font-weight: 700; }
@media (max-width: 880px) {
  .sticky-note { min-height: 160px; width: 190px; padding-top: 2.5rem; }
  .story-title h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
  .story-title h1 .gradient-text { font-size: clamp(2.8rem, 8vw, 4.5rem); }
}

/* Larger opening line to match the story reference. */
.story-title h1 { font-size: clamp(2.5rem, 7.2vw, 6rem); }
@media (max-width: 880px) {
  .story-title h1 { font-size: clamp(2.3rem, 7.5vw, 4.5rem); }
}

/* Shared reference handwriting, with space for complete letter strokes. */
.story-title h1 .gradient-text,
.story-heading .gradient-text,
.sticky-note,
.pin figcaption,
.story-photo-gallery figcaption {
  font-family: var(--font-handwritten);
  font-style: normal;
  font-weight: 400;
}
.story-title h1 .gradient-text,
.story-heading .gradient-text {
  line-height: 1.3;
  padding-inline: 0.15em;
  padding-bottom: 0.15em;
}
