
/* ==========================================
   GOESAN NOTEBOOK - RAINY AUTUMN
   ========================================== */

/* ---------- Page layers ---------- */

body {
  position: relative;
  isolation: isolate;
}

body > main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.autumn-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- Autumn trees ---------- */

.side-tree {
  position: absolute;
  top: 12%;
  width: clamp(100px, 13vw, 190px);
  max-width: 25vw;
  height: auto;
  opacity: 0.9;
  transform-origin: bottom center;
}

.maple-tree {
  left: 1%;
  animation: tree-sway 5s ease-in-out infinite alternate;
}

.ginkgo-tree {
  top: 10%;
  right: 1%;
  animation: tree-sway 6s ease-in-out infinite alternate-reverse;
}

/* ==========================================
   CLOUDS, MIST AND RAIN
   ========================================== */

.rain-clouds {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Soft drifting mist */

.mist {
  position: absolute;
  width: clamp(180px, 24vw, 340px);
  height: 55px;
  border-radius: 50%;
  background: rgba(174, 190, 205, 0.2);
  filter: blur(24px);
  animation: mist-drift 20s ease-in-out infinite alternate;
}

.mist-1 {
  top: 12%;
  left: 15%;
}

.mist-2 {
  top: 24%;
  right: 12%;
  animation-delay: -8s;
}

.mist-3 {
  top: 38%;
  left: 40%;
  animation-delay: -13s;
}

/* Rounded watercolor clouds */

.cloud {
  position: absolute;
  width: 100px;
  height: 30px;
  border-radius: 30px;
  background: rgba(177, 190, 207, 0.65);
  filter: blur(5px);
  opacity: 0.85;
  animation: cloud-drift 18s ease-in-out infinite alternate;
}

.cloud::before,
.cloud::after,
.cloud i {
  content: "";
  position: absolute;
  display: block;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  top: -18px;
  left: 15px;
  width: 42px;
  height: 42px;
}

.cloud::after {
  top: -27px;
  left: 38px;
  width: 52px;
  height: 52px;
}

.cloud i {
  top: -12px;
  left: 69px;
  width: 34px;
  height: 34px;
}

.cloud-1 {
  top: 9%;
  left: 28%;
}

.cloud-2 {
  top: 16%;
  right: 24%;
  transform: scale(0.8);
  animation-delay: -7s;
}

.cloud-3 {
  top: 27%;
  left: 48%;
  transform: scale(0.65);
  opacity: 0.55;
  animation-delay: -11s;
}

/* Fine raindrops */

.rain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    ellipse 1.2px 2.8px at center,
    rgba(103, 148, 187, 0.72) 80%,
    transparent 100%
  );
  background-size: 47px 59px;
  background-position: 0 0;
  background-repeat: repeat;
  animation: fine-rain 1.4s linear infinite;
}

.rain-2 {
  background-size: 67px 79px;
  background-position: 19px 13px;
  opacity: 0.48;
  animation-duration: 1.8s;
  animation-delay: -0.7s;
}

.rain-3 {
  background-size: 89px 97px;
  background-position: 37px 29px;
  opacity: 0.3;
  animation-duration: 2.2s;
  animation-delay: -1.1s;
}

/* ==========================================
   NOTEBOOK TITLE
   ========================================== */

main > h1 {
  margin: 0 0 30px;
  padding-bottom: 20px;
  color: #755b43;
  font-family: Georgia, "Noto Serif", serif;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #e8ddc9;
}

main > h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 15px;
  background: #d9ad72;
  border-radius: 4px;
}

/* ==========================================
   NOTEBOOK CONTENT
   ========================================== */

.notebook-content {
  min-width: 0;
  margin-top: 28px;
  color: #403b34;
  font-family: "Noto Sans", Verdana, sans-serif;
  font-size: 0.9em;
  line-height: 1.9;
  letter-spacing: 0.1px;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Paragraphs */

.notebook-content p {
  margin: 0 0 1.5em;
  text-align: left;
  text-indent: 1.4em;
}

.notebook-content p:first-child,
.notebook-content p.lead,
.notebook-content p.ending {
  text-indent: 0;
}

.notebook-content p:last-child {
  margin-bottom: 0;
}

/* Opening paragraph */

.notebook-content p.lead {
  margin-bottom: 1.8em;
  color: #655543;
  font-size: 1.08em;
  line-height: 2;
}

/* Section headings */

.notebook-content h2 {
  margin: 2.2em 0 0.9em;
  color: #896746;
  font-family: Georgia, "Noto Serif", serif;
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.5;
}

.notebook-content h3 {
  margin: 1.6em 0 0.6em;
  color: #9a704c;
  font-size: 1.2em;
  line-height: 1.5;
}

/* Section divider */

.notebook-content .section-divider {
  width: 52px;
  margin: 2.5em auto;
  border: 0;
  border-top: 2px solid #d9b77d;
  opacity: 0.8;
}

/* Images */

.notebook-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(85, 67, 43, 0.12);
}

.notebook-content .notebook-figure {
  margin: 2em 0;
  text-align: center;
}

.notebook-content .notebook-figure img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.notebook-content .notebook-figure figcaption {
  margin-top: 0.8em;
  color: #8b8377;
  font-size: 0.78em;
  font-style: italic;
  line-height: 1.6;
}

/* Quotes */

.notebook-content blockquote {
  margin: 2em 0;
  padding: 1em 1.3em;
  border-left: 3px solid #d9b77d;
  border-radius: 0 8px 8px 0;
  background: rgba(224, 207, 174, 0.15);
  color: #80684f;
  font-family: Georgia, "Noto Serif", serif;
  font-size: 1.08em;
  font-style: italic;
  line-height: 1.85;
}

/* Links */

.notebook-content a {
  color: #638d91;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.notebook-content a:hover {
  color: #b77c60;
}

/* Ending paragraph */

.notebook-content p.ending {
  margin-top: 2em;
  color: #755b43;
  font-weight: 500;
}

/* ==========================================
   VIDEO
   ========================================== */

.notebook-content .video-card,
.video-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin: 28px auto;
  overflow: hidden;
  border-radius: 14px;
  background-color: #e9e2d5;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 24px rgba(70, 55, 35, 0.14);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 54px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 16px;
  background: rgba(210, 70, 60, 0.95);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.video-play:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: #f04438;
}

.play-icon {
  display: block;
  width: 0;
  height: 0;
  margin: auto;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid white;
  transform: translateX(2px);
}

.video-card iframe,
.notebook-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-card iframe {
  position: absolute;
  inset: 0;
  height: 100%;
}

.video-card.is-playing {
  background-image: none !important;
}

/* ==========================================
   FOOTER: CAR LEFT, SIGNATURE RIGHT
   ========================================== */

.notebook-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  min-width: 0;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px dashed #ded2bd;
}

.notebook-footer-content {
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
}

/* Car and road */

.road-trip {
  position: relative;
  isolation: isolate;
  flex: 0 1 260px;
  width: 260px;
  min-width: 100px;
  margin: 0 auto 0 0;
  padding-bottom: 22px;
  animation: car-bounce 1s ease-in-out infinite;
}

.road-trip svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Road below the wheels */

.road {
  position: absolute;
  z-index: 1;
  right: -12%;
  bottom: 10px;
  left: -12%;
  height: 18px;
  overflow: hidden;
  border-top: 2px solid #b8ad9c;
  border-radius: 50%;
  background: #d8d0c2;
}

.road::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 200%;
  border-top: 2px dashed #fff9e9;
  animation: road-move 1.2s linear infinite;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fine-rain {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 59px;
  }
}

@keyframes cloud-drift {
  from {
    translate: -12px 0;
  }
  to {
    translate: 16px 4px;
  }
}

@keyframes mist-drift {
  from {
    transform: translateX(-25px);
    opacity: 0.35;
  }
  to {
    transform: translateX(35px);
    opacity: 0.75;
  }
}

@keyframes tree-sway {
  from {
    rotate: -1.5deg;
  }
  to {
    rotate: 1.5deg;
  }
}

@keyframes car-bounce {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@keyframes road-move {
  to {
    transform: translateX(-50%);
  }
}

/* ==========================================
   TABLET
   ========================================== */

@media (min-width: 601px) and (max-width: 900px) {
  .side-tree {
    width: clamp(85px, 12vw, 120px);
    opacity: 0.7;
  }

  .notebook-content {
    font-size: 0.88em;
  }

  .road-trip {
    flex-basis: 220px;
  }
}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 600px) {
  /* Keep decorations subtle and away from the text */

  .side-tree {
    width: 72px;
    max-width: 19vw;
    opacity: 0.42;
  }

  .maple-tree {
    top: 10%;
    left: -12px;
  }

  .ginkgo-tree {
    top: 9%;
    right: -12px;
  }

  .mist {
    width: 180px;
    height: 42px;
    filter: blur(20px);
  }

  .mist-1 {
    left: 4%;
  }

  .mist-2 {
    right: 2%;
  }

  .mist-3 {
    left: 25%;
  }

  .cloud {
    transform: scale(0.75);
    transform-origin: center;
    opacity: 0.65;
  }

  .cloud-1 {
    top: 8%;
    left: 8%;
  }

  .cloud-2 {
    top: 15%;
    right: 4%;
  }

  .cloud-3 {
    top: 25%;
    left: 35%;
    transform: scale(0.55);
  }

  /* Title */

  main > h1 {
    margin-bottom: 22px;
    padding-bottom: 15px;
    font-size: clamp(25px, 7vw, 30px);
    line-height: 1.35;
    letter-spacing: -0.35px;
  }

  main > h1::after {
    width: 48px;
    height: 3px;
    margin-top: 12px;
  }

  /* Article */

  .notebook-content {
    margin-top: 20px;
    font-size: 0.9em;
    line-height: 1.85;
    letter-spacing: 0;
  }

  .notebook-content p {
    margin-bottom: 1.3em;
    text-indent: 1em;
  }

  .notebook-content p.lead {
    font-size: 1.03em;
    line-height: 1.9;
    margin-bottom: 1.5em;
  }

  .notebook-content h2 {
    margin-top: 1.8em;
    margin-bottom: 0.7em;
    font-size: 1.2em;
  }

  .notebook-content h3 {
    margin-top: 1.4em;
    font-size: 1.1em;
  }

  .notebook-content .section-divider {
    margin: 2em auto;
  }

  /* Images */

  .notebook-content img {
    margin: 1.5em auto;
    border-radius: 8px;
  }

  .notebook-content .notebook-figure {
    margin: 1.5em 0;
  }

  .notebook-content .notebook-figure img {
    max-height: 420px;
    border-radius: 8px;
  }

  .notebook-content .notebook-figure figcaption {
    font-size: 0.8em;
  }

  /* Quotes */

  .notebook-content blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1em;
    font-size: 1em;
    line-height: 1.8;
  }

  /* Video */

  .notebook-content .video-card,
  .video-card {
    margin: 20px auto;
    border-radius: 9px;
  }

  .video-play {
    width: 60px;
    height: 43px;
    border-radius: 12px;
  }

  .play-icon {
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 14px;
  }

  /* Footer */

  .notebook-footer {
    align-items: flex-end;
    gap: 8px;
    margin-top: 28px;
    padding-top: 18px;
  }

  .road-trip {
    flex: 0 1 42%;
    width: 42%;
    min-width: 0;
    padding-bottom: 18px;
  }

  .road {
    bottom: 8px;
    height: 14px;
  }

  .road::before {
    top: 6px;
  }

  .notebook-footer-content {
    flex: 1 1 0;
    font-size: 0.85em;
    overflow-wrap: anywhere;
  }

  .note-date,
  .signature-link {
    font-size: 12px;
  }
}

/* ==========================================
   SMALL MOBILE
   ========================================== */

@media (max-width: 380px) {
  .notebook-content {
    font-size: 0.86em;
    line-height: 1.8;
  }

  .notebook-footer {
    gap: 6px;
  }

  .road-trip {
    flex-basis: 38%;
    width: 38%;
  }

  .note-date,
  .signature-link {
    font-size: 11px;
  }
}

/* ==========================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  .cloud,
  .mist,
  .rain,
  .side-tree,
  .road-trip,
  .road::before {
    animation: none !important;
  }

  .video-play {
    transition: none;
  }
}

/* Video figures */
.notebook-video-figure,
.video-card-figure {
  width: 100%;
  margin: 36px auto;
  text-align: center;
}

/* YouTube Shorts: vertical 9:16 */
.notebook-video {
  width: min(100%, 340px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #e8e1d7;
  box-shadow: 0 8px 24px rgba(65, 49, 35, 0.14);
}

.notebook-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Captions */
.video-caption {
  max-width: 460px;
  margin: 14px auto 0;
  padding: 10px 16px;
  color: #51473d;
  background: rgba(255, 250, 240, 0.95);
  border: 1px solid #e8ddca;
  border-radius: 12px;
  font-family: "Noto Sans", Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  font-style: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

.caption-icon {
  margin-right: 5px;
}

/* Tablet */
@media (min-width: 601px) and (max-width: 900px) {
  .notebook-content {
    font-size: 0.95em;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .notebook-content {
    font-size: 0.95em;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  .notebook-content {
    font-size: 0.9em;
  }
}

/* ==========================================
   VIDEO FIGURES & CAPTIONS
   ========================================== */

.notebook-video-figure,
.video-card-figure {
  width: 100%;
  margin: 28px auto;
  text-align: center;
}

/* Vertical YouTube Shorts */
.notebook-video {
  width: min(100%, 340px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: #e8e1d7;
  box-shadow: 0 6px 18px rgba(65, 49, 35, 0.12);
}

.notebook-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Compact caption */
.video-caption {
  display: table;
  max-width: min(100%, 380px);
  margin: 6px auto 0;
  padding: 4px 10px;
  color: #665646;
  background: rgba(245, 237, 220, 0.8);
  border: 1px solid #e8ddca;
  border-radius: 8px;
  font-family: "Noto Sans", Verdana, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  text-align: center;
  overflow-wrap: anywhere;
}

.caption-icon {
  margin-right: 4px;
}

/* Mobile */
@media (max-width: 600px) {
  .notebook-video-figure,
  .video-card-figure {
    margin: 22px auto;
  }

  .notebook-video {
    width: min(100%, 300px);
    border-radius: 12px;
  }

  .video-caption {
    max-width: min(100%, 300px);
    margin-top: 5px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.5;
  }
}