/* vighneshrege.com
   Layout: home is an index of large words; each section is its own page with a breadcrumb back out.
   Going in, a page's content rises softly into place; coming home, the index settles from above. */
:root {
  --bg: #eceee9;
  --surface: #f6f7f3;
  --ink: #1d2138;
  --muted: #5d6275;
  --rule: #c9ccc4;
  --accent: #383d94;
  --hemp: #a8834a;
  --display: "Gloock", "Bodoni 72", Didot, Georgia, serif;
  --body: "Literata", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13151f; --surface: #1b1e2b; --ink: #e7e5dd; --muted: #a0a3b2;
    --rule: #2e3243; --accent: #a3a9f2; --hemp: #d3ae70; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13151f; --surface: #1b1e2b; --ink: #e7e5dd; --muted: #a0a3b2;
  --rule: #2e3243; --accent: #a3a9f2; --hemp: #d3ae70; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
.inner {
  max-width: 60rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
p { margin: 0; }

/* Soft movement between pages */
.rise { animation: rise 0.55s cubic-bezier(.2,.7,.2,1) both; }
.settle { animation: settle 0.55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise, .settle { animation: none; } }

/* Home */
.home-head { display: grid; gap: 1.1rem; padding-top: calc(env(safe-area-inset-top, 0px) + 4.5rem); margin-bottom: 3rem; }
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.rope { width: min(22rem, 100%); height: 22px; display: block; color: var(--hemp); }
.role { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 0; }
.intro { max-width: 34rem; margin: 0; font-size: 1.15rem; }

/* The index of doors: big words that lead into each page */
.doors { list-style: none; margin: 0; padding: 0; }
.doors li + li { border-top: 1px solid var(--rule); }
.door {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding: 1.3rem 0;
  color: var(--ink);
  text-decoration: none;
}
.door .word {
  font-family: var(--display);
  font-size: clamp(2.1rem, 6.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  transition: color 0.25s;
}
.door .what { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted); text-align: right; max-width: 16rem; }
.door .kind { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); order: -1; }
.door:hover .word, .door:focus-visible .word { color: var(--accent); }
.doors.small .door .word { font-size: clamp(1.7rem, 4.6vw, 2.8rem); }

/* Breadcrumb at the top of every section page */
.crumbs {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.crumbs .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; padding-block: 0.9rem; font-family: var(--mono); font-size: 0.8rem; }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; padding-block: 0.2rem; }
.crumbs a:first-child { color: var(--ink); }
.crumbs a:hover { color: var(--accent); border-color: var(--accent); }
.crumbs .sep { color: var(--rule); }
.crumbs .here { color: var(--ink); }

/* Section pages */
.view-head { padding-top: 3rem; margin-bottom: 2rem; display: grid; gap: 0.6rem; }
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); margin: 0; }
.deck { margin: 0.2rem 0 0; font-size: clamp(1.15rem, 2.8vw, 1.45rem); line-height: 1.35; color: var(--muted); text-wrap: balance; }
.coming-soon { margin-top: 2.5rem; font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--muted); }
.body { display: grid; gap: 1.1rem; max-width: 40rem; }
h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.15; margin: 0.5rem 0 0; text-wrap: balance; }
.quiet { color: var(--muted); }

.link-out {
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.link-out:hover { background: var(--accent); color: var(--bg); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.list li { padding-left: 1.2rem; position: relative; }
.list li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 0.5rem; height: 1px; background: var(--hemp); }
.sub { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
/* Jumping to a section lands below the sticky breadcrumb */
[id] { scroll-margin-top: 4.5rem; }
.consent-note { font-size: 0.95rem; color: var(--muted); border-left: 2px solid var(--hemp); padding-left: 1rem; }

/* Featured essays */
.essays { list-style: none; margin: 0; padding: 0; }
.essays li + li { border-top: 1px solid var(--rule); }
.essay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1.5rem;
  padding: 0.95rem 0;
  color: var(--ink);
  text-decoration: none;
}
.essay-title { font-family: var(--display); font-size: 1.15rem; line-height: 1.25; transition: color 0.2s; }
.essay-sub { grid-column: 1; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.essay-date { grid-column: 2; grid-row: 1; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.essay:hover .essay-title, .essay:focus-visible .essay-title { color: var(--accent); }

/* Placeholder marks for content still to come */
.todo {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px dashed var(--rule);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Loving Torture: four vertical videos, watched in order */
.reels-wrap { margin-top: 2rem; --reel-w: min(20rem, 72vw, 38vh); }
.reels {
  list-style: none;
  margin: 0;
  padding: 0.25rem calc((100% - var(--reel-w)) / 2) 0.75rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.reels::-webkit-scrollbar { display: none; }
.reel {
  flex: 0 0 var(--reel-w);
  scroll-snap-align: center;
  display: grid;
  gap: 0.7rem;
  opacity: 0.42;
  transform: scale(0.93);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(.2,.75,.15,1);
}
.reel.is-current { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reels { scroll-behavior: auto; } .reel { transition: none; } }
.reel-frame { position: relative; aspect-ratio: 9 / 16; max-width: 100%; background: #0e0f14; border-radius: 6px; overflow: hidden; }
.reel-player, .reel-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 1rem; color: #d3ae70; }
.reel-num { font-family: var(--display); font-size: 4.5rem; line-height: 1; }
.reel-empty .todo { color: #a9a8a2; border-color: #3a3c47; }
.reel-meta { display: flex; align-items: baseline; gap: 0.6rem; }
.reel-part { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); white-space: nowrap; }
.reel-title { font-family: var(--display); font-size: 1.2rem; line-height: 1.2; min-width: 0; }
.reel-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.75rem; }
.reel-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); cursor: pointer; font-family: var(--mono); }
.reel-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.reel-btn:disabled { opacity: 0.4; cursor: default; }
.reel-count { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 6.5rem; text-align: center; }

/* Shibari: gallery */
.gallery { columns: 3 15rem; column-gap: 0.75rem; margin-top: 1.75rem; }
.shot { display: block; width: 100%; margin: 0 0 0.75rem; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; break-inside: avoid; }
.shot img { display: block; width: 100%; height: auto; transition: opacity 0.3s; }
.shot:hover img { opacity: 0.86; }

/* Photo viewer: always dark, so the photographs read the same in either theme */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9, 10, 14, 0.95);
  color: #ecebe6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: calc(env(safe-area-inset-top, 0px) + 3.75rem) max(10px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 3.25rem) max(10px, env(safe-area-inset-left, 0px));
}
.lb-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid rgba(236, 235, 230, 0.28); background: none; color: #ecebe6; cursor: pointer; font-family: var(--mono); font-size: 1rem; }
.lb-btn:hover { border-color: #ecebe6; }
.lb-btn:focus-visible { outline-color: #ecebe6; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 0.75rem); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-count { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 0.78rem; color: #a9a8a2; font-variant-numeric: tabular-nums; }

/* Threshold before the poetry and rope pages */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gate-card {
  width: min(30rem, 100%);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.75rem 1.6rem 1.4rem;
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--ink) 35%, transparent);
  animation: gate-in 0.35s cubic-bezier(.2,.75,.15,1);
}
@keyframes gate-in { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .gate-card { animation: none; } }
.gate-card .rope { width: 9rem; height: 16px; }
.gate-name { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.gate-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem; align-items: start; padding: 1rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1.5; }
.gate-check:has(input:checked) { border-color: var(--hemp); }
.gate-check input { width: 1.3rem; height: 1.3rem; margin: 0.15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.gate-actions a, .gate-actions button { font-family: var(--mono); font-size: 0.85rem; padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; border: 1px solid var(--rule); background: none; color: var(--ink); text-decoration: none; }
.gate-actions .enter { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.gate-actions .enter:disabled { background: none; color: var(--muted); border-color: var(--rule); cursor: not-allowed; }
.is-gated .page { visibility: hidden; }

/* The space above the footer matches the space between the home intro and the first section (3rem + a door's 1.3rem padding) */
footer.inner { margin: 3rem auto 0; }
footer { padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
footer a { color: var(--ink); }

@media (max-width: 640px) {
  .home-head { padding-top: calc(env(safe-area-inset-top, 0px) + 2.75rem); }
  .door { grid-template-columns: minmax(0, 1fr); }
  .door .what { text-align: left; }
  .view-head { padding-top: 2rem; }
  .lightbox { grid-template-columns: minmax(0, 1fr); }
  .lightbox .lb-prev, .lightbox .lb-next { display: none; }
}
