/* Kumo: a weather journal in ink. Black ink on warm paper; the seal is the only colour. */

:root {
  --paper: #f2ece0;
  --ink: #1a1815;
  --ink-2: #4b463f;
  --ink-3: #857e72;
  --hair: rgba(26, 24, 21, 0.14);
  --seal: #2d4f9e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --serif: "EB Garamond", "Yuji Syuku", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html {
  background-color: var(--paper);
  /* paper grain, tiled */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .07 .11 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  font: 400 19px/1.62 var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.k-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
::selection { background: rgba(45, 79, 158, 0.2); }

/* ---------- top ---------- */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  max-width: 1040px; margin: 0 auto; padding: 30px 24px 0;
}
.name { text-decoration: none; font-size: 19px; font-variant-caps: all-small-caps; letter-spacing: 0.14em; }
.top nav { display: flex; gap: 26px; }
.top nav a { position: relative; text-decoration: none; color: var(--ink-3); transition: color 200ms var(--ease-out); }
.top nav a[aria-current] { color: var(--ink); }
.top nav a[aria-current]::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 5px; height: 5px; margin-left: -2.5px;
  background: var(--seal); border-radius: 1px;
}
@media (hover: hover) { .top nav a:hover { color: var(--ink); } }

main { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- scenes ---------- */
.scene { margin: 0 auto; max-width: 980px; }
.layers { position: relative; aspect-ratio: 1000 / 560; overflow: hidden; }
.layers svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the painting fades into the paper at its edges, as an unframed ink painting does */
.layers {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, #000 90%, transparent);
  mask-composite: intersect;
}
.scene .layers { opacity: 0; filter: blur(3px); transition: opacity 900ms var(--ease-out), filter 900ms var(--ease-out); }
.scene.drawn .layers { opacity: 1; filter: none; }
.drift { animation: drift 16s ease-in-out infinite alternate; will-change: transform; }
@keyframes drift { from { transform: translateX(-1.2%); } to { transform: translateX(1.2%); } }
.fall { animation: fall var(--fall, 2s) linear infinite; }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(560px); } }
.scene.still .drift, .scene.still .fall { animation-play-state: paused; }
figcaption {
  max-width: 31em; margin: 14px auto 0; text-align: center;
  font-size: 19.5px; line-height: 1.55; color: var(--ink);
}
figcaption .who { color: var(--ink-2); }
.seal { display: inline-block; line-height: 0; }
.seal svg { width: 100%; height: 100%; }

/* ---------- cover ---------- */
.cover { position: relative; max-width: 980px; margin: 0 auto; padding: clamp(36px, 7vh, 72px) 0 8px; text-align: center; }
.kicker { margin: 0 0 10px; font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: 0.16em; color: var(--ink-3); }
.cover h1 { margin: 0; font-weight: 400; font-size: clamp(48px, 7.4vw, 86px); line-height: 1; letter-spacing: -0.015em; }
.tag { margin: 14px 0 0; font-style: italic; font-size: clamp(19px, 2vw, 23px); color: var(--ink-2); }
.cover .seal { width: 46px; height: 46px; margin-top: 22px; }

/* ---------- contents ---------- */
.label { margin: 0 0 6px; font-weight: 400; font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: 0.16em; color: var(--ink-3); text-align: center; }
.days { max-width: 720px; margin: clamp(56px, 10vh, 96px) auto 0; }
.days ol, .also ul { list-style: none; margin: 0; padding: 0; }
.days li + li, .also li + li { border-top: 1px solid var(--hair); }
.days a, .also a {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 2px 18px;
  padding: 18px 4px; text-decoration: none;
}
.glyph { display: block; width: 40px; height: 40px; }
.days a .glyph, .also a .glyph { grid-row: span 2; }
.wx { font-size: 14.5px; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-3); }
.nm { font-size: 25px; line-height: 1.2; }
.nm span { color: var(--ink-2); font-style: italic; font-size: 19px; margin-left: 10px; }
.go { grid-row: 1 / span 2; grid-column: 3; color: var(--ink-3); font-size: 22px; transition: transform 240ms var(--ease-out), color 240ms var(--ease-out); }
@media (hover: hover) {
  .days a:hover .go, .also a:hover .go { transform: translateX(4px); color: var(--ink); }
  .days a:hover .nm, .also a:hover .nm { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
}
.also { max-width: 720px; margin: 56px auto 0; }

/* ---------- an entry ---------- */
.entry-head { text-align: center; padding: clamp(36px, 6vh, 64px) 0 10px; }
.entry-head .kicker { display: inline-flex; align-items: center; gap: 10px; }
.entry-head .glyph { width: 30px; height: 30px; }
.entry-scene { position: relative; }
.layers .seal { position: absolute; z-index: 2; right: 7%; bottom: 9%; width: 32px; height: 32px; }
article { max-width: 620px; margin: clamp(48px, 8vh, 80px) auto 0; }
article h1 { margin: 0 0 12px; font-weight: 400; font-size: clamp(38px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.015em; }
.lede { margin: 0 0 22px; font-style: italic; font-size: 22px; line-height: 1.5; color: var(--ink-2); }
article p { margin: 0 0 16px; }
.notes { margin: 30px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--hair); }
.notes div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.notes dt { font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-3); padding-top: 3px; }
.notes dd { margin: 0; }
.links { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--ink-3); transition: text-decoration-color 200ms var(--ease-out); }
.links a::after { content: " \2197"; font-size: 0.8em; color: var(--ink-3); }
.links a.in::after { content: " \2192"; }
@media (hover: hover) { .links a:hover { text-decoration-color: var(--ink); } }

.turn { max-width: 620px; margin: 64px auto 0; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--hair); padding-top: 18px; }
.turn a { text-decoration: none; display: grid; gap: 2px; }
.turn a span { font-size: 14px; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-3); }
.turn a.next { text-align: right; margin-left: auto; }
@media (hover: hover) { .turn a:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } }
.turn b { font-weight: 400; font-size: 21px; }

/* ---------- contact ---------- */
.email {
  display: inline-flex; align-items: baseline; gap: 14px; flex-wrap: wrap; max-width: 100%;
  margin: 4px 0 0; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 400 clamp(28px, 5vw, 40px)/1.2 var(--serif); text-align: left;
  transition: transform 160ms var(--ease-out);
}
.email:active { transform: scale(0.98); }
.email .addr { overflow-wrap: anywhere; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; text-decoration-color: var(--ink-3); }
.copy-label { font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-3); }
.mail-alt { margin-top: 10px; font-size: 17px; color: var(--ink-2); }

/* ---------- foot ---------- */
.foot { max-width: 1040px; margin: 0 auto; padding: 72px 24px 40px; text-align: center; color: var(--ink-3); font-size: 16px; }
.rule { display: block; width: 120px; height: 10px; margin: 0 auto 18px; }
.rule svg { width: 100%; height: 100%; }
.foot a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) { .foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; } }
.foot .dot { margin: 0 8px; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  body { font-size: 18px; }
  .top { padding-top: 20px; }
  .top nav { gap: 16px; font-size: 17px; }
  .layers {
    aspect-ratio: 1 / 1;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(180deg, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(180deg, #000 86%, transparent);
  }
  figcaption { font-size: 18px; padding: 0 6px; }
  .layers .seal { right: 15%; bottom: 16%; width: 26px; height: 26px; }
  .days a, .also a { grid-template-columns: 36px 1fr auto; gap: 2px 14px; padding: 16px 0; }
  .glyph { width: 34px; height: 34px; }
  .nm { font-size: 22px; }
  .nm span { display: block; margin: 2px 0 0; font-size: 17px; }
  .notes div { grid-template-columns: 1fr; gap: 0; }
  .turn b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .drift, .fall { animation: none; }
  .scene .layers { transition: none; opacity: 1; filter: none; }
}
