/* Miles n Memories — palette taken from the Rajasthan photographs */
:root {
  color-scheme: light;
  --limewash: #f2f4f3;   /* white-washed walls */
  --indigo: #1e2552;     /* Junagarh blue room, ink */
  --indigo-soft: #4a5070;
  --ochre: #c98a12;      /* Jaisalmer sandstone */
  --sindoor: #a8232b;    /* fresco red */
  --sand: #e9dcbc;
  --rule: #c9cbd6;

  --display: "Rozha One", Georgia, serif;
  --text: "Literata", Georgia, serif;

  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--limewash);
  color: var(--indigo);
  font: 400 1.0625rem/1.75 var(--text);
  font-optical-sizing: auto;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sindoor); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: 0.005em; }

/* ---------- Site header / footer ---------- */
.site-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--display); font-size: 1.35rem; color: var(--indigo); text-decoration: none; }
.site-head nav a { color: var(--indigo); text-decoration: none; margin-left: 1.25rem; font-size: 0.95rem; }
.site-head nav a:hover { color: var(--sindoor); }

.site-foot {
  margin-top: 6rem; padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem; color: var(--indigo-soft);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
}

/* ---------- Mithila frame: double line with bharni-style hatching ---------- */
.frame {
  position: relative;
  padding: 8px;
  border: 1.5px solid var(--indigo);
  background:
    repeating-linear-gradient(-45deg, var(--indigo) 0 1px, transparent 1px 5px);
}
.frame::after { /* inner rule of the double line */
  content: ""; position: absolute; inset: 6px;
  border: 1px solid var(--indigo); pointer-events: none;
}
.frame img { border: 2px solid var(--limewash); width: 100%; }
.frame--ochre { border-color: var(--ochre); background: repeating-linear-gradient(-45deg, var(--ochre) 0 1.2px, transparent 1.2px 6px); }
.frame--ochre::after { border-color: var(--ochre); }

/* ---------- Home ---------- */
.home-hero {
  display: grid; gap: clamp(24px, 5vw, 64px);
  grid-template-columns: 1fr;
  padding: clamp(32px, 7vw, 88px) var(--gutter) 0;
  max-width: 1200px; margin: 0 auto; align-items: end;
}
@media (min-width: 860px) { .home-hero { grid-template-columns: 1.1fr 1fr; } }
.home-hero h1 { font-size: clamp(3.4rem, 11vw, 8.5rem); line-height: 0.92; }
.home-hero h1 > span { display: block; }
.home-hero h1 .amp { color: var(--ochre); }
.home-hero .lead { color: var(--indigo); font-size: 1.08rem; }
.home-hero .button { margin-top: 1.75rem; }
.home-hero p { max-width: 38ch; font-size: 1.15rem; margin: 1.5rem 0 0; color: var(--indigo-soft); }
.home-hero .tagline { font-size: clamp(1.2rem, 2.4vw, 1.45rem); font-style: italic; }
.home-hero .frame { max-width: 520px; justify-self: end; width: 100%; }

.stories { max-width: 1200px; margin: clamp(56px, 9vw, 120px) auto 0; padding: 0 var(--gutter); }
.stories h2 { font-size: 1.6rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--indigo); }
.story-card {
  display: grid; gap: 24px; grid-template-columns: 1fr;
  padding: 32px 0; color: inherit; text-decoration: none;
}
@media (min-width: 720px) { .story-card { grid-template-columns: 300px 1fr; align-items: center; } }
.story-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.story-card h3 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.story-card:hover h3 { color: var(--sindoor); }
.story-card .when { color: var(--ochre); font-size: 0.95rem; margin: 0 0 0.4rem; }
.story-card p { margin: 0.6rem 0 0; max-width: 60ch; }
.story-card .read { display: inline-block; margin-top: 0.9rem; color: var(--sindoor); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Story page ---------- */
.story-hero { max-width: 1200px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 0; }
.story-hero h1 { font-size: clamp(3rem, 10vw, 7.5rem); line-height: 0.95; max-width: 11ch; }
.story-hero .dek { font-size: 1.2rem; max-width: 46ch; margin: 1.25rem 0 0; color: var(--indigo-soft); }
.story-hero .when { color: var(--ochre); margin: 0 0 1rem; }
.story-hero .frame { margin-top: clamp(28px, 5vw, 56px); }
.story-hero .frame img { aspect-ratio: 16 / 9; object-fit: cover; object-position: center 60%; }

/* Route: a real sequence, so it is drawn as one */
.route { max-width: 1200px; margin: 48px auto 0; padding: 0 var(--gutter); }
.route h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.route ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 0;
}
.route li { display: flex; align-items: center; font-size: 0.98rem; white-space: nowrap; }
.route li:not(:last-child)::after {
  content: ""; width: 26px; height: 0; margin: 0 8px;
  border-top: 2px dotted var(--ochre);
}
.route li.home { color: var(--indigo-soft); }

.prose { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); box-sizing: content-box; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: 0 0 0.3rem; }
.prose h3 { font-family: var(--text); font-weight: 600; font-size: 1.12rem; margin: 2em 0 0.5em; line-height: 1.4; }

.intro { margin-top: 64px; }
.intro .note {
  border-left: 3px solid var(--ochre); padding: 2px 0 2px 18px;
  color: var(--indigo-soft); font-size: 0.97rem; margin-bottom: 2rem;
}

.toc { max-width: var(--measure); margin: 40px auto 0; padding: 0 var(--gutter); box-sizing: content-box; }
.toc details { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.toc ol { margin: 0 0 16px; padding-left: 1.4rem; columns: 2 220px; column-gap: 32px; }
.toc li { margin: 0 0 6px; break-inside: avoid; }
.toc a { color: var(--indigo); text-decoration: none; }
.toc a:hover { color: var(--sindoor); text-decoration: underline; }

.day { margin-top: clamp(64px, 9vw, 104px); scroll-margin-top: 24px; }
.day-head { border-top: 2px solid var(--indigo); padding-top: 18px; margin-bottom: 1.5rem; }
.day-head .date { color: var(--ochre); font-size: 0.98rem; margin: 0 0 0.5rem; }
.day-head .sub { font-style: italic; color: var(--indigo-soft); margin: 0.6rem 0 0; }

figure { margin: 2.2rem 0; }
figcaption { font-size: 0.88rem; color: var(--indigo-soft); margin-top: 10px; line-height: 1.5; }
.wide { max-width: 980px; margin-left: auto; margin-right: auto; padding: 0 var(--gutter); }
.pair { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.pair img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

.pull {
  margin: 2.4rem 0; padding: 0;
  font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2;
  color: var(--sindoor);
}

/* Glossary */
.glossary { margin-top: clamp(64px, 9vw, 104px); }
.glossary dl { margin: 1.5rem 0 0; }
.glossary dt { font-weight: 600; margin-top: 1.2rem; }
.glossary dt span { font-weight: 400; color: var(--ochre); }
.glossary dd { margin: 0.25rem 0 0; }
.glossary .words { display: grid; gap: 0 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .glossary .words { grid-template-columns: 1fr 1fr; } }
.glossary .words div { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.glossary .words dt { margin: 0; }
.aside { font-size: 0.95rem; color: var(--indigo-soft); }

/* Gallery */
.gallery { max-width: 1200px; margin: clamp(72px, 10vw, 120px) auto 0; padding: 0 var(--gutter); }
.gallery > h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.gallery > p { max-width: 60ch; color: var(--indigo-soft); }
.gallery h3 { font-family: var(--text); font-weight: 600; font-size: 1.05rem; margin: 2.2rem 0 0.8rem; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.grid img { aspect-ratio: 1; object-fit: cover; width: 100%; transition: filter 0.2s; }
.grid button:hover img { filter: brightness(1.08); }

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 94vh;
}
dialog.lightbox::backdrop { background: rgb(30 37 82 / 0.92); }
dialog.lightbox img { max-height: 86vh; width: auto; margin: 0 auto; border: 2px solid var(--limewash); }
dialog.lightbox p { color: var(--limewash); text-align: center; margin: 10px 0 0; font-size: 0.92rem; }
dialog.lightbox .close {
  position: fixed; top: 14px; right: 16px;
  background: var(--limewash); color: var(--indigo); border: 0; border-radius: 999px;
  font: 600 0.95rem var(--text); padding: 8px 16px; cursor: pointer;
}

.endnote { text-align: center; margin-top: 3rem; font-style: italic; color: var(--indigo-soft); }

/* ---------- Home sections ---------- */
.button {
  display: inline-block; background: var(--indigo); color: var(--limewash);
  padding: 12px 22px; text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.button:hover { background: var(--sindoor); text-decoration: none; }

.home-section { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.welcome, .featured, .explore, .beyond, .closing { max-width: 1200px; margin: clamp(72px, 10vw, 128px) auto 0; padding: 0 var(--gutter); }

.welcome { display: grid; gap: clamp(24px, 5vw, 64px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .welcome { grid-template-columns: 320px 1fr; } }
.welcome img { width: 100%; max-width: 320px; aspect-ratio: 3 / 4; object-fit: cover; }
.welcome h2 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.welcome-text { max-width: var(--measure); }
.welcome-text p { margin: 0 0 1.1em; }

.featured {
  display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: 1fr; align-items: center;
  border-top: 2px solid var(--indigo); padding-top: clamp(32px, 5vw, 56px);
}
@media (min-width: 820px) { .featured { grid-template-columns: 1fr 1fr; } }
.featured img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 40%; }
.featured h2 { font-size: clamp(2.4rem, 6vw, 4rem); }
.featured .when { color: var(--ochre); margin: 0 0 0.6rem; }
.featured p { max-width: 48ch; }
.featured .button { margin-top: 0.75rem; }

.explore h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin-bottom: 1.75rem; }
.explore-grid { display: grid; gap: 28px 20px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .explore-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .explore-grid { grid-template-columns: repeat(4, 1fr); } }
.explore-grid a { color: inherit; text-decoration: none; display: block; }
.explore-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.explore-grid h3 { font-size: 1.45rem; margin: 14px 0 6px; }
.explore-grid a:hover h3 { color: var(--sindoor); }
.explore-grid p { margin: 0; font-size: 0.98rem; color: var(--indigo-soft); }

.beyond {
  background: var(--indigo); color: var(--limewash);
  max-width: none; padding: clamp(56px, 8vw, 96px) var(--gutter);
}
.beyond > * { max-width: 42rem; margin-left: auto; margin-right: auto; }
.beyond h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); color: var(--ochre); margin-bottom: 1.25rem; }
.beyond .big { font-family: var(--display); font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.25; }
.beyond p { margin-top: 0; margin-bottom: 1.1em; }

.closing { text-align: center; max-width: var(--measure); }
.closing h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 1rem; }
.closing p { margin: 0 auto 0.9em; }
.closing .sign { font-style: italic; color: var(--ochre); font-size: 1.15rem; }

.site-foot .social a { color: inherit; margin-right: 1rem; }
.site-foot .social a:last-child { margin-right: 0; }
.site-foot .social a:hover { color: var(--sindoor); }
