/* ==========================================================================
   mansigupta.in — shared styles (white, minimal, editorial)
   One typeface, thin rules, and one decorative device: the dotted route.
   ========================================================================== */

:root {
  --ink:    #161616;   /* text and rules */
  --muted:  #5C5A55;   /* secondary text (6.9:1 on white) */
  --line:   #D9D9D4;   /* faint dividers */
  --accent: #2A56A5;   /* focus rings and link hover only */
  --sans:   'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shadow:    0 1px 2px rgba(22,22,26,.16), 0 8px 18px rgba(22,22,26,.07);   /* a sheet of paper lying on the page */
  --shadow-sm: 0 1px 2px rgba(22,22,26,.16), 0 4px 10px rgba(22,22,26,.07);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --gap:    clamp(2rem, 6vw, 5rem);
  --bar-h:  3.25rem;   /* sticky series bar on the catalogue page */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 30; }
.skip:focus { top: 1rem; }
.lnk { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.lnk:hover { color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding-top: calc(.4rem + env(safe-area-inset-top)); padding-bottom: .4rem;
  border-bottom: 1px solid var(--ink);
}
.brand { font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; text-decoration: none; padding-block: .55rem; white-space: nowrap; }
.nav-d { display: none; gap: 1.75rem; }
.nav-d a, .menu a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.nav-d a:hover, .menu a:hover { text-decoration: underline; text-underline-offset: 5px; }
.nav-d a[aria-current="page"], .menu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "+"; font-size: 1.2rem; line-height: 1; }
.menu[open] summary::after { content: "\2212"; }
.menu nav { display: grid; justify-items: end; padding-bottom: .5rem; font-size: 1.25rem; }
@media (min-width: 900px) { .nav-d { display: flex; } .menu { display: none; } }

/* ---------- Landing: intro + opening painting ---------- */
.landing { display: grid; gap: 1.5rem var(--gap); padding-block: 1.75rem 0; }
h1.tag {
  margin: 0; max-width: 14ch;
  font-weight: 500; font-size: clamp(2.1rem, 9vw, 3.75rem); line-height: 1.06; letter-spacing: -.035em;
}
.statement { margin: .9rem 0 0; max-width: 40ch; color: #333; }
.go { margin: 1rem 0 0; }

.hero { margin: 0; }
.hero .sheet img { width: 100%; }
.hero figcaption { margin-top: .65rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }

/* ---------- The sheet: whole work, own proportions, soft shadow ---------- */
.sheet { display: block; }
.sheet img { display: block; width: 100%; height: auto; background: #f1f1ee; box-shadow: var(--shadow); }
.sheet img:not([height]) { aspect-ratio: auto 4 / 5; }   /* reserves space until the image loads */

/* ---------- The route: one dotted line, every section is a stop ---------- */
.route { position: relative; margin-top: 2.75rem; padding-left: 2.1rem; }
.route::before {
  content: ""; position: absolute; left: .5rem; top: .9rem; bottom: 1.5rem; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 2px, transparent 2px 9px);
}
.stop { position: relative; display: block; padding-bottom: 2.1rem; text-decoration: none; color: inherit; }
.stop::before {
  content: ""; position: absolute; left: -2.1rem; top: .4rem; width: 18px; height: 18px;
  border: 2px solid var(--ink); border-radius: 50%; background: #fff;
}
.stop::after { content: ""; position: absolute; left: -1.68rem; top: .83rem; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.stop-label { font-size: .85rem; color: var(--muted); margin: 0 0 .15rem; }

.stop.s { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: .35rem 1.1rem; align-items: start; }
.stop.s h2, .stop h2 { margin: 0; font-weight: 600; font-size: 1.55rem; line-height: 1.12; letter-spacing: -.03em; }
.stop.s p { margin: .35rem 0 0; font-size: .95rem; line-height: 1.45; color: var(--muted); max-width: 44ch; }
.stop.s .facts { margin-top: .35rem; }
.stop.s .im img { width: 92px; box-shadow: var(--shadow-sm); }
@media (hover: hover) { a.stop.s:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; } }
a.stop.s:focus-visible { outline-offset: 6px; }
.facts { font-size: .85rem; color: var(--muted); margin: 0; }

.cred { margin: .5rem 0 0; border-top: 1px solid var(--ink); }
.cred div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.cred dt { color: var(--muted); }
.cred dd { margin: 0; }
.cta { margin: 0; font-weight: 600; font-size: clamp(1.5rem, 5.6vw, 2.1rem); line-height: 1.15; letter-spacing: -.03em; }
.cta small { display: block; margin-top: .4rem; font-size: .95rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }

@media (min-width: 900px) {
  .landing { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; padding-top: 2.5rem; }
  .identity { position: sticky; top: 2rem; }
  h1.tag { font-size: 3.9rem; }
  .go { display: none; }                      /* the menu already links to the catalogue */
  .hero .sheet img { max-width: 25rem; }
  .route { margin-top: 3.25rem; }
  .stop.s { grid-template-columns: minmax(0, 1fr) 112px; }
  .stop.s .im img { width: 112px; }
}

/* ---------- Studio notes (newsletter) ---------- */
.notes { border-top: 1px solid var(--ink); margin-top: 1.5rem; padding-block: 2.25rem; display: grid; gap: 1rem var(--gap); }
.notes h2 { margin: 0; font-weight: 600; font-size: 1.5rem; letter-spacing: -.03em; }
.notes p { margin: .35rem 0 0; color: var(--muted); max-width: 40ch; }
@media (min-width: 900px) { .notes { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.formkit-alert { list-style: none; margin: 0 0 .75rem; padding: 0; color: #9B1C1C; font-size: .9rem; }
.formkit-alert:empty { display: none; }
.formkit-fields { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 600px) { .formkit-fields { flex-direction: row; } .formkit-field { flex: 1; } }
.formkit-input { width: 100%; min-height: 48px; padding: .6rem .9rem; border: 1px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); font: 400 16px var(--sans); }
.formkit-submit { min-height: 48px; padding: .6rem 1.5rem; border: 1px solid var(--ink); border-radius: 0; cursor: pointer; background: var(--ink); color: #fff; font: 600 1rem var(--sans); }
.formkit-submit:hover { background: #2b2b2b; }
.formkit-spinner { display: none; }
.formkit-powered-by-convertkit-container { margin-top: .9rem; }
.formkit-powered-by-convertkit { font-size: .78rem; color: var(--muted); }

/* ==========================================================================
   CATALOGUE PAGE
   ========================================================================== */
.page-title { display: grid; gap: 1rem var(--gap); padding-block: 2.25rem 1.75rem; }
h1.page-h { margin: 0; font-weight: 600; font-size: clamp(2.5rem, 10vw, 4.25rem); line-height: 1; letter-spacing: -.045em; }
.page-title p { margin: 0; max-width: 52ch; color: var(--muted); }
.page-title a { color: var(--ink); text-underline-offset: 3px; }
@media (min-width: 900px) { .page-title { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; } }

.series-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: #fff; border-block: 1px solid var(--ink); }
.series-nav .wrap { position: relative; display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.series-nav .wrap::-webkit-scrollbar { display: none; }
.series-nav a { flex: none; min-height: 48px; display: inline-flex; align-items: center; padding-inline: .9rem; text-decoration: none; font-weight: 500; font-size: .95rem; border-bottom: 3px solid transparent; }
.series-nav a:first-child { margin-left: -.9rem; }
.series-nav a:hover { color: var(--accent); }
.series-nav a[aria-current="true"] { border-bottom-color: var(--ink); font-weight: 600; }

.series-block { scroll-margin-top: var(--bar-h); padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.series-block + .series-block { margin-top: clamp(.5rem, 2vw, 1.5rem); border-top: 2px dotted var(--ink); }   /* the route, as a divider */
.series-head { display: grid; gap: 1rem var(--gap); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
@media (min-width: 900px) { .series-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.series-head h2 { margin: 0 0 .4rem; font-weight: 600; font-size: clamp(1.9rem, 5.5vw, 2.9rem); line-height: 1.05; letter-spacing: -.04em; }
.series-text p { margin: 0 0 .75rem; font-size: .95rem; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.series-text p:last-child { margin-bottom: 0; }

.works { list-style: none; margin: 0; padding: 0 0 clamp(2.5rem, 6vw, 4.5rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.1rem; align-items: start; }
@media (min-width: 640px)  { .works { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.5rem; } }
@media (min-width: 1000px) { .works { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.75rem 1.75rem; } }
.work { margin: 0; min-width: 0; }
.work-img { display: block; cursor: zoom-in; }
.work-body { margin-top: 1rem; display: grid; gap: .15rem; }
.w-title { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.w-line  { margin: 0; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.w-data  { margin: .1rem 0 .5rem; font-size: .85rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.w-data .cm { color: var(--muted); }
.w-foot { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin: .4rem 0 0; padding-top: .45rem; border-top: 1px solid var(--line); }
.status { font-size: .85rem; }
.price  { font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; }
.work.is-sold .status, .work.is-other .status, .work.is-sold .price, .work.is-other .price { color: var(--muted); }
.w-id { margin: .3rem 0 0; font-size: .75rem; color: var(--muted); word-break: break-all; letter-spacing: .01em; }

dialog.viewer { border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: rgba(22,22,26,.96); color: #fff; }
dialog.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
dialog.viewer::backdrop { background: rgba(22,22,26,.96); }
.viewer-stage { display: grid; place-items: center; padding: 1rem; min-height: 0; cursor: zoom-out; }
.viewer-stage img { max-width: 100%; max-height: calc(100dvh - 6.5rem); width: auto; height: auto; object-fit: contain; }
.viewer-cap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); font-size: .9rem; }
.viewer-cap button { min-height: 44px; min-width: 44px; padding: 0 1.1rem; border: 0; cursor: pointer; background: #fff; color: var(--ink); font: 600 .95rem var(--sans); }
.viewer-cap button:focus-visible { outline-color: #fff; }

/* ---------- Footer (shared) ---------- */
.site-foot { border-top: 1px solid var(--ink); padding-block: 2.25rem 2rem; margin-top: 1rem; }
.foot { display: grid; gap: 1.5rem var(--gap); }
@media (min-width: 900px) { .foot { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.foot p { margin: 0; }
.foot-name { font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.foot-note { color: var(--muted); font-size: .95rem; }
.foot-mail { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0 1.5rem; }
@media (min-width: 560px) { .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.foot-links a { display: flex; flex-direction: column; justify-content: center; min-height: 3.4rem; padding-block: .5rem; text-decoration: none; border-top: 1px solid var(--line); }
.foot-links .name { font-weight: 600; }
.foot-links .detail { font-size: .85rem; color: var(--muted); }
.foot-links a:hover .name { text-decoration: underline; text-underline-offset: 4px; color: var(--accent); }
.legal { margin-top: 1.75rem !important; font-size: .85rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Print: the catalogue doubles as a price list ---------- */
@media print {
  .skip, .site-head, .series-nav, .site-foot, dialog, .menu { display: none !important; }
  .series-block { break-before: page; border: 0; padding-top: 0; }
  .series-block:first-of-type { break-before: auto; }
  .works { grid-template-columns: repeat(3, 1fr); gap: 1.25rem 1rem; }
  .work { break-inside: avoid; }
  .sheet img { box-shadow: none; border: 1px solid #ccc; background: #fff; }
}
