/* aishwik.com — quiet, dark, the photographs first.
   System fonts only (the CSP allows nothing else): a thin sans for the
   name, an old-style serif for the couplets. */

:root {
  --ground: #0a0c0a;
  --ink: #ece6d6;
  --soft: rgba(236, 230, 214, 0.72);
  --faint: rgba(236, 230, 214, 0.58);   /* the small labels: ~6:1 on the ground, like the place lines */
  --moss: #a9b48c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ground); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* A whisper of grain over everything, like film. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 10;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.couplet {
  margin: 0;
  font: italic 400 1.06rem/1.55 var(--serif);
  color: var(--ink);
  text-wrap: balance;
}
.where {
  margin: 0.55rem 0 0;
  font: 500 0.66rem/1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(236, 230, 214, 0.58);
}

/* ---- the opening: five photographs breathing in turn ---------------------- */
.opening {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
}
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: turn 45s infinite;
  animation-delay: calc(var(--i) * 9s);
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: breathe 45s infinite linear;
  animation-delay: calc(var(--i) * 9s);
}
.slide figcaption {
  position: absolute;
  left: clamp(1.25rem, 5vw, 4rem);
  bottom: clamp(1.5rem, 7vh, 4.5rem);
  max-width: min(34rem, 82vw);
  z-index: 2;
  /* As in PlumageSort: a close, dark shadow that holds the letters on any
     ground, pale grass or white mist alike, and a soft wide one around it. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 12px rgba(0, 0, 0, 0.75);
}
/* A pool of shade behind the words, feathered to nothing at its edges, so the
   photograph darkens only where it is read. */
.slide figcaption::before {
  content: "";
  position: absolute;
  inset: -3.5rem -5rem -3rem -6rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(10, 12, 10, 0.7), rgba(10, 12, 10, 0.38) 60%, rgba(10, 12, 10, 0));
}
.slide .where { color: rgba(236, 230, 214, 0.8); }
@keyframes turn {
  0% { opacity: 0; }
  4% { opacity: 1; }
  20% { opacity: 1; }
  24% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes breathe {
  0% { transform: scale(1.0); }
  24% { transform: scale(1.06); }
  100% { transform: scale(1.06); }
}
.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(10, 12, 10, 0) 40%, rgba(10, 12, 10, 0.55) 100%),
    linear-gradient(to bottom, rgba(10, 12, 10, 0.5), rgba(10, 12, 10, 0.18) 16%, rgba(10, 12, 10, 0) 30%, rgba(10, 12, 10, 0) 55%, rgba(10, 12, 10, 0.78) 100%);
}
.name {
  position: absolute;
  z-index: 3;
  top: clamp(1.5rem, 9vh, 5.5rem);
  left: 0;
  right: 0;
  text-align: center;
  animation: rise 2.4s ease-out both;
}
.name h1 {
  margin: 0;
  padding-left: 0.5em;
  font: 200 clamp(2.4rem, 6vw, 4.2rem)/1 var(--sans);
  letter-spacing: 0.5em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
.name p {
  margin: 0;
  font: italic 400 clamp(0.98rem, 1.7vw, 1.15rem)/1.4 var(--serif);
  color: rgba(236, 230, 214, 0.86);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 12px rgba(0, 0, 0, 0.75);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---- a hush between the opening and the field ----------------------------- */
.hush {
  padding: clamp(5rem, 14vh, 9rem) 1.5rem;
  text-align: center;
}
.hush p {
  margin: 0 auto;
  max-width: 30rem;
  font: italic 400 clamp(1.15rem, 2.2vw, 1.45rem)/1.7 var(--serif);
  color: var(--soft);
}

/* ---- from the field: plates, alternating sides ---------------------------- */
.field {
  display: grid;
  gap: clamp(4rem, 12vh, 8rem);
  padding: 0 clamp(1.25rem, 5vw, 4rem) clamp(5rem, 12vh, 8rem);
  max-width: 1280px;
  margin: 0 auto;
}
.plate {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  align-items: end;
  gap: clamp(1.25rem, 3vw, 2.75rem);
}
.plate img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.plate:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.plate:nth-child(even) img { order: 2; }
.plate:nth-child(even) figcaption { text-align: right; }
.plate figcaption { padding-bottom: 0.4rem; }

/* ---- PlumageSort ------------------------------------------------------------ */
.work {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid rgba(236, 230, 214, 0.1);
}
.folders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.folder { margin: 0; }
.folder img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
}
.folder figcaption {
  margin-top: 0.6rem;
  font: 500 0.66rem/1.35 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.folder figcaption::before { content: "▸ "; color: var(--moss); }
.kicker {
  margin: 0;
  font: italic 400 1rem/1.4 var(--serif);
  color: var(--moss);
}
.about h2 {
  margin: 0.3rem 0 1rem;
  font: 300 clamp(2rem, 3.6vw, 2.7rem)/1.1 var(--sans);
  letter-spacing: 0.04em;
}
.about p:not(.kicker) { margin: 0; color: var(--soft); max-width: 30rem; }
.go {
  display: inline-block;
  margin-top: 1.6rem;
  padding-bottom: 0.15rem;
  text-decoration: none;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(169, 180, 140, 0.55);
  transition: color 0.3s, border-color 0.3s;
}
.go:hover { color: var(--moss); border-color: var(--moss); }

/* ---- Synesthete: a drawn sky (no song in it is named here) --------------- */
.work.sky { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .threads path { fill: none; stroke: rgba(190, 205, 255, 0.35); stroke-width: 1; }
.chart .verse { fill: none; stroke: url(#iri); stroke-width: 1; stroke-dasharray: 2 5; opacity: 0.8; }
.chart .stars circle { fill: var(--ink); animation: twinkle 5s ease-in-out infinite; }
.chart .stars circle:nth-child(3n) { animation-delay: -1.7s; }
.chart .stars circle:nth-child(3n + 1) { animation-delay: -3.1s; }
.chart .heart circle { fill: url(#iri); animation: twinkle 7s ease-in-out infinite; }
.chart .heart circle:nth-child(odd) { animation-delay: -2.4s; }
.chart .planet { fill: #f0b37a; }
@keyframes twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.45; } }

/* The corner mark: the way into the sky, from the very first screen. */
.corner {
  position: absolute;
  z-index: 4;
  top: clamp(1rem, 3vh, 1.6rem);
  right: clamp(1rem, 3vw, 2rem);
  opacity: 0.72;
  transition: opacity 0.5s;
}
.corner:hover, .corner:focus-visible { opacity: 1; }
.corner svg { width: 56px; height: 35px; display: block; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.6)); }
.corner path { fill: none; stroke: rgba(236, 230, 214, 0.55); stroke-width: 0.8; stroke-dasharray: 2 3; }
.corner circle { fill: var(--ink); }

/* ---- the foot ---------------------------------------------------------------- */
footer {
  padding: 4.5rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--faint);
}
footer p { margin: 0; letter-spacing: 0.06em; }

/* ---- small screens ---------------------------------------------------------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .plate, .plate:nth-child(even) { grid-template-columns: 1fr; }
  .plate:nth-child(even) img { order: 0; }
  .plate:nth-child(even) figcaption { text-align: left; }
  .work, .work.sky { grid-template-columns: 1fr; }
  .work.sky .chart { order: -1; }
}

/* Plates surface as they come into view — scroll-driven, no script; where
   a browser can't, they are simply there. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .plate, .work, .hush p {
      animation: surface linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
@keyframes surface {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .slide img, .name, .chart circle { animation: none; }
  .slide:first-child { opacity: 1; }
}
