/* nabin.net: warm sketchbook memorial */

/* Fonts are served from /fonts with the site. font-display: block keeps
   text hidden for the brief moment before they load, instead of showing a
   different font first. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Noto Serif Devanagari";
  src: url("../fonts/noto-serif-devanagari.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --paper: #f6efe3;
  --paper-deep: #efe4d2;
  --card: #fbf7ef;
  --ink: #2e2a26;
  --ink-soft: #5c544b;
  --graphite: #8a8178;
  --ochre: #d9a86c;
  --ochre-wash: rgba(217, 168, 108, 0.22);
  --sage: #9bae84;
  --sage-wash: rgba(155, 174, 132, 0.22);
  --sky: #9fbfd6;
  --sky-wash: rgba(159, 191, 214, 0.25);
  --rose-wash: rgba(214, 150, 130, 0.18);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --devanagari: "Noto Serif Devanagari", "Kohinoor Devanagari", serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  --spine-x: 50%;
  --gutter: 16px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 60% 40% at 10% 0%, var(--ochre-wash), transparent 70%),
    radial-gradient(ellipse 50% 35% at 95% 8%, var(--sky-wash), transparent 70%),
    radial-gradient(ellipse 70% 30% at 50% 100%, var(--sage-wash), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 88vh;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--gutter) 3rem;
}

.hero-kicker {
  margin: 0 0 1rem;
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
}

.hero-name {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.75rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.hero-devanagari {
  margin: 0.75rem 0 0;
  font-family: var(--devanagari);
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  color: var(--ink-soft);
}

.hero-dates {
  margin: 2rem 0 0;
  padding: 0.35rem 1.25rem;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--graphite);
  border-bottom: 1px solid var(--graphite);
}

.hero-dash {
  margin: 0 0.6rem;
  color: var(--graphite);
}

.hero-tagline {
  margin: 1.75rem 0 0;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-soft);
}

/* ---------- Timeline ---------- */

main {
  padding: 0 var(--gutter) 4rem;
}

.timeline {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
  list-style: none;
}

/* the pencil spine */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--spine-x);
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    var(--graphite) 0 14px,
    rgba(138, 129, 120, 0.55) 14px 18px,
    var(--graphite) 18px 40px,
    rgba(138, 129, 120, 0.35) 40px 43px
  );
  opacity: 0.8;
}

.entry {
  position: relative;
  width: 50%;
  padding: 0 3rem 3.5rem 0;
}

.entry:nth-child(even) {
  margin-left: 50%;
  padding: 0 0 3.5rem 3rem;
}

/* dot on the spine */
.entry::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  right: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink-soft);
  z-index: 1;
  transition: background-color 0.5s ease, border-color 0.5s ease,
    box-shadow 0.5s ease, transform 0.5s ease;
}

/* the one dot currently in focus (set by js/main.js) */
.entry.is-current::before {
  background: var(--ochre);
  border-color: var(--ochre);
  box-shadow: 0 0 0 6px var(--ochre-wash);
  transform: scale(1.2);
}

.entry:nth-child(even)::before {
  right: auto;
  left: -7px;
}

.entry article {
  position: relative;
  padding: 1.5rem 1.75rem 1.6rem;
  background: var(--card);
  border: 1px solid rgba(46, 42, 38, 0.12);
  border-radius: 3px 6px 4px 5px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 10px 24px -14px rgba(60, 45, 30, 0.35);
}

/* watercolour wash behind each card, cycling tints */
.entry article::before {
  content: "";
  position: absolute;
  inset: -10px -14px auto auto;
  width: 55%;
  height: 70%;
  border-radius: 60% 40% 55% 45%;
  background: var(--ochre-wash);
  filter: blur(14px);
  z-index: -1;
}

.entry:nth-child(3n + 2) article::before {
  background: var(--sage-wash);
}

.entry:nth-child(3n) article::before {
  background: var(--sky-wash);
}

.entry:nth-child(even) article::before {
  inset: auto auto -10px -14px;
}

.entry-date {
  display: inline-block;
  margin: 0 0 0.35rem;
  font-family: var(--hand);
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ink-soft);
}

.entry h2 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.2;
}

.entry p {
  margin: 0;
}

.entry figure {
  margin: 1.5rem 0 0.25rem;
  padding: 0.6rem 0.6rem 0.4rem;
  background: #fffdf8;
  box-shadow: 0 8px 20px -10px rgba(60, 45, 30, 0.45);
  transform: rotate(-1.2deg);
}

.entry:nth-child(even) figure {
  transform: rotate(1.2deg);
}

.entry figcaption {
  padding-top: 0.4rem;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--ink-soft);
}

.entry-milestone article {
  border-color: rgba(217, 168, 108, 0.55);
}

.entry-milestone::before {
  border-color: var(--ochre);
}

.entry-farewell.is-current::before {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 6px rgba(92, 84, 75, 0.15);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem var(--gutter) 3rem;
  text-align: center;
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
}

/* ---------- Scroll reveal (only when JS is running) ---------- */

.js .entry {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.js .entry.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .entry::before {
    transition: none;
  }

  .js .entry {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Small screens: single column ---------- */

@media (max-width: 760px) {
  body {
    font-size: 1.15rem;
  }

  .timeline::before {
    left: 7px;
    transform: none;
  }

  .entry,
  .entry:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding: 0 0 2.5rem 2.25rem;
  }

  .entry::before,
  .entry:nth-child(even)::before {
    left: 0;
    right: auto;
  }

  .entry article {
    padding: 1.25rem 1.25rem 1.35rem;
  }

  .entry article::before,
  .entry:nth-child(even) article::before {
    inset: -8px -6px auto auto;
  }

  .entry h2 {
    font-size: 1.55rem;
  }
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
  }

  .hero {
    min-height: 0;
  }

  .entry,
  .js .entry {
    opacity: 1;
    transform: none;
    break-inside: avoid;
  }

  .entry article {
    box-shadow: none;
  }

  .entry article::before {
    display: none;
  }
}
