/* ============================================================
   Field Notes — travel journal of Ulana Rey
   Paper: warm ivory · Ink: near-black · Accent: fountain-pen blue
   Wax-seal red reserved for the compass needle only
   ============================================================ */

:root {
  --paper: #f7f3ea;
  --paper-deep: #efe9db;
  --ink: #1c1a16;
  --ink-soft: rgba(28, 26, 22, 0.66);
  --pen: #23486e;        /* fountain-pen blue */
  --seal: #a3372f;       /* compass needle only */
  --body: "Newsreader", Georgia, serif;
  --display: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --measure: 33.5em;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.18rem;
  line-height: 1.72;
}

::selection { background: var(--pen); color: var(--paper); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pen); }
a:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }

/* ---- The route line (SVG, drawn on scroll) ---- */
#route {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  color: var(--pen);
  opacity: 0.5;
}
#route path {
  fill: none; stroke: currentColor;
  stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 6 7;   /* stitched, hand-drawn feel */
}

/* ---- Compass ---- */
#compass {
  position: fixed; right: 2rem; bottom: 2rem;
  width: 56px; height: 56px;
  z-index: 6; color: var(--ink-soft);
  opacity: 0; transition: opacity 0.8s;
}
body.traveling #compass { opacity: 1; }
#compass text { font-family: var(--mono); fill: currentColor; }
#needle { transform-origin: 30px 30px; transition: transform 1.6s var(--ease); }

/* ---- Masthead ---- */
.masthead {
  position: relative; z-index: 1;
  min-height: 88vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}
.mast-kicker {
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 300;
  letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--ink-soft);
}
.masthead h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 10.5rem);
  line-height: 0.95;
  margin: 1.2rem 0 1rem;
}
.mast-byline {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}
.byline-name { color: var(--pen); font-style: normal; }
.mast-standfirst {
  max-width: 34em;
  margin-top: 2.4rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ---- Contents ---- */
.contents {
  position: relative; z-index: 1;
  border-top: 1px solid rgba(28,26,22,0.16);
  border-bottom: 1px solid rgba(28,26,22,0.16);
  margin: 0 auto 8rem;
  max-width: 46em;
  padding: 1.1rem 1.5rem;
}
.contents ol {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: 0.4rem 2.2rem;
  justify-content: center;
  counter-reset: entry;
}
.contents li { counter-increment: entry; }
.contents a {
  font-family: var(--mono);
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft);
}
.contents a::before { content: counter(entry, upper-roman) ". "; color: var(--pen); }
.contents a:hover { color: var(--pen); }

/* ---- Entries ---- */
.entry {
  position: relative; z-index: 1;
  max-width: var(--measure);
  margin: 0 auto 11rem;
  padding: 0 1.5rem;
}
.dateline {
  font-family: var(--mono);
  font-size: 0.74rem; font-weight: 300;
  letter-spacing: 0.18em;
  color: var(--pen);
  margin-bottom: 1.1rem;
}
.entry h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 2rem;
}
.entry p { margin-bottom: 1.5rem; }

/* Drop cap on the first paragraph after the plate */
.plate + p::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 4.6em;
  line-height: 0.78;
  padding: 0.08em 0.12em 0 0;
  color: var(--pen);
}

/* ---- Plates ---- */
.plate {
  margin: 0 0 2.6rem;
  /* full-bleed beyond the text measure on wide screens */
  width: min(92vw, 58em);
  position: relative;
  left: 50%; transform: translateX(-50%);
}
.plate img {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(28,26,22,0.14);
  padding: 10px;                    /* mounted-print border */
  background: #fffdf8;
  box-shadow: 0 1px 0 rgba(28,26,22,0.05);
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.plate.is-seen img { opacity: 1; transform: none; }
.plate figcaption {
  margin-top: 0.8rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- About ---- */
.about {
  position: relative; z-index: 1;
  background: var(--paper-deep);
  border-top: 1px solid rgba(28,26,22,0.12);
  padding: 7rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 34em);
  gap: clamp(2rem, 6vw, 5rem);
  justify-content: center;
  align-items: center;
}
.about-portrait img {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(28,26,22,0.14);
  padding: 8px; background: #fffdf8;
}
.about-portrait figcaption {
  margin-top: 0.7rem; text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-soft);
}
.about h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 1.4rem;
}
.about-text p { margin-bottom: 1.3rem; }
.about-links { font-size: 0.95rem; color: var(--ink-soft); }

/* ---- Footer ---- */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid rgba(28,26,22,0.16);
  padding: 2.6rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.86rem;
  font-family: var(--mono);
  color: var(--ink-soft);
}
.footer p { margin-bottom: 0.5rem; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  body { font-size: 1.08rem; }
  .about { grid-template-columns: 1fr; }
  .about-portrait { max-width: 340px; margin: 0 auto; }
  #compass { right: 1.1rem; bottom: 1.1rem; width: 46px; height: 46px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .plate img { opacity: 1; transform: none; }
  #route { display: none; }
}
