/* ==========================================================================
   Loving Yoni  |  design tokens
   Derived from: nephrite and jade, rose quartz, celadon glaze on Song ceramics,
   silk, lotus in still water, morning light through paper, gold thread.
   ========================================================================== */

:root {
  /* colour */
  --paper:        #FCFAF7;   /* ground, warm paper white */
  --paper-deep:   #F3EDE6;   /* secondary surface, unbleached silk */
  --celadon:      #D5E3DA;   /* pale glaze, quiet surfaces */
  --celadon-mid:  #A9C4B6;   /* glaze at the rim */
  --celadon-deep: #6F9384;   /* wet jade */
  --nephrite:     #1B2A24;   /* all text, never pure black */
  --nephrite-mid: #4A5B53;   /* muted text */
  --quartz:       #E7C6CB;   /* rose quartz, used only near the body */
  --quartz-deep:  #C08F97;
  --gold:         #A98B4E;   /* gold thread, hairline weight only */

  /* type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Commissioner", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.94rem);
  --step-0:  clamp(1.03rem, 0.99rem + 0.22vw, 1.16rem);
  --step-1:  clamp(1.24rem, 1.16rem + 0.38vw, 1.48rem);
  --step-2:  clamp(1.49rem, 1.36rem + 0.64vw, 1.89rem);
  --step-3:  clamp(1.79rem, 1.58rem + 1.03vw, 2.41rem);
  --step-4:  clamp(2.15rem, 1.82rem + 1.62vw, 3.07rem);
  --step-5:  clamp(2.58rem, 2.08rem + 2.48vw, 3.92rem);

  /* measure and rhythm */
  --measure: 34rem;
  --measure-wide: 52rem;
  --gap: clamp(1.2rem, 0.9rem + 1.4vw, 2rem);
  --section: clamp(4rem, 3rem + 5vw, 7.5rem);
}

/* ==========================================================================
   base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--nephrite);
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.68;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 90;
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); margin-top: 0; }
h3 { font-size: var(--step-1); font-weight: 500; letter-spacing: -0.004em; }

p { margin: 0 0 1.3em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--nephrite);
  text-decoration-color: var(--celadon-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.25s ease, color 0.25s ease;
}
a:hover { color: var(--celadon-deep); text-decoration-color: var(--celadon-deep); }
a:focus-visible {
  outline: 2px solid var(--celadon-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

strong { font-weight: 550; }
em { font-style: italic; }

/* ==========================================================================
   layout
   ========================================================================== */

.wrap {
  width: min(100% - 2.6rem, var(--measure-wide));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2.6rem, var(--measure)); }

.section { padding-block: var(--section); }
.section--tint { background: var(--paper-deep); }
.section--glaze { background: linear-gradient(180deg, var(--paper) 0%, var(--celadon) 100%); }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--nephrite-mid);
  font-weight: 300;
}

/* ==========================================================================
   petal arc  |  the signature divider
   A single lotus petal outline, alternating direction down the page.
   ========================================================================== */

.arc {
  display: block;
  width: 100%;
  max-width: 15rem;
  margin: var(--section) auto;
  height: auto;
  color: var(--celadon-mid);
}
.arc--flip { transform: rotate(180deg); }
.arc path { fill: none; stroke: currentColor; stroke-width: 1; }
.arc circle { fill: var(--gold); stroke: none; }

/* ==========================================================================
   masthead
   ========================================================================== */

.masthead {
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--celadon);
  background: var(--paper);
}
.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display);
  font-size: var(--step-1);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 40;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--nephrite);
}
.wordmark:hover { color: var(--celadon-deep); }

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
}
.nav a { text-decoration: none; color: var(--nephrite-mid); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--nephrite); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); }

/* ==========================================================================
   hero  |  the one orchestrated moment on the site
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 3rem + 7vw, 9rem);
  background: var(--paper);
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  inset: -25% -10% auto -10%;
  height: 130%;
  z-index: -2;
  background:
    radial-gradient(58% 48% at 50% 34%, rgba(213, 227, 218, 0.85) 0%, rgba(252, 250, 247, 0) 72%),
    radial-gradient(42% 38% at 74% 62%, rgba(231, 198, 203, 0.55) 0%, rgba(252, 250, 247, 0) 70%);
  animation: breathe 19s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.9; }
  50%      { transform: scale(1.08) translateY(-1.5%); opacity: 1; }
}

.hero__inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.6rem;
}

.hero h1 {
  max-width: 18ch;
  margin: 0;
  font-variation-settings: "SOFT" 70, "WONK" 1, "opsz" 144;
  font-weight: 300;
}
.hero p {
  max-width: 46ch;
  color: var(--nephrite-mid);
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.5;
}

/* the lotus */
.lotus { width: clamp(9rem, 22vw, 15rem); height: auto; overflow: visible; }
.lotus .petal {
  fill: none;
  stroke: var(--celadon-deep);
  stroke-width: 1.1;
  transform-origin: 100px 150px;
  transform: scaleY(0.06) scaleX(0.5);
  opacity: 0;
  animation: open 2.6s cubic-bezier(0.22, 0.8, 0.28, 1) forwards;
}
.lotus .petal--outer { stroke: var(--celadon-mid); }
.lotus .petal--inner { stroke: var(--quartz-deep); }
.lotus .heart { fill: var(--gold); opacity: 0; animation: fadein 1.6s ease 2.5s forwards; }
.lotus .water { stroke: var(--celadon-mid); stroke-width: 0.8; fill: none; opacity: 0; animation: fadein 2s ease 2.9s forwards; }

.lotus .p1 { animation-delay: 0.15s; }
.lotus .p2 { animation-delay: 0.35s; }
.lotus .p3 { animation-delay: 0.55s; }
.lotus .p4 { animation-delay: 0.75s; }
.lotus .p5 { animation-delay: 0.95s; }
.lotus .p6 { animation-delay: 1.15s; }
.lotus .p7 { animation-delay: 1.4s; }
.lotus .p8 { animation-delay: 1.6s; }
.lotus .p9 { animation-delay: 1.8s; }

@keyframes open {
  from { transform: scaleY(0.06) scaleX(0.5); opacity: 0; }
  to   { transform: scaleY(1) scaleX(1); opacity: 1; }
}
@keyframes fadein { to { opacity: 1; } }

/* ==========================================================================
   lotus overview  |  petals arranged around a centre, not a card grid
   ========================================================================== */

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  margin-top: 3rem;
}

.petal-item {
  position: relative;
  padding: 2rem 1.6rem 2.2rem;
  border-top: 1px solid var(--celadon);
}
.petal-item:nth-child(even) { background: rgba(213, 227, 218, 0.22); }
.petal-item h3 { margin-bottom: 0.5rem; color: var(--nephrite); }
.petal-item p { font-size: var(--step--1); color: var(--nephrite-mid); line-height: 1.6; }

/* the arc: each item sits a little lower or higher than its neighbour, so the
   set reads as a curve of petals rather than a row of boxes */
@media (min-width: 62rem) {
  .overview { grid-template-columns: repeat(3, 1fr); }
  .petal-item:nth-child(3n+1) { transform: translateY(1.6rem); }
  .petal-item:nth-child(3n+3) { transform: translateY(1.6rem); }
  .overview { padding-bottom: 1.6rem; }
}

/* ==========================================================================
   the pause  |  stops the reading and gives the body something to do
   ========================================================================== */

.pause {
  position: relative;
  margin: 2.8rem 0;
  padding: 2rem 1.8rem 2rem 2.4rem;
  background: var(--paper-deep);
  border-left: 2px solid var(--gold);
}
.pause h3 {
  font-size: var(--step-0);
  font-weight: 500;
  font-family: var(--body);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.pause p { font-size: var(--step-0); color: var(--nephrite); }
.pause p:last-child { margin-bottom: 0; }

/* ==========================================================================
   prose
   ========================================================================== */

.prose { width: min(100% - 2.6rem, var(--measure)); margin-inline: auto; }
.prose h2 { margin-top: 2.6em; }
.prose h3 { margin-top: 2em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.6em; }
.prose li::marker { color: var(--celadon-deep); }

.prose blockquote {
  margin: 2.4rem 0;
  padding-left: 1.6rem;
  border-left: 1px solid var(--quartz-deep);
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 300;
  font-style: italic;
  color: var(--nephrite-mid);
}

.safety {
  margin: 2.8rem 0;
  padding: 1.6rem 1.6rem 1.7rem;
  border: 1px solid var(--celadon-mid);
  background: var(--paper);
}
.safety h3 { font-size: var(--step-0); font-family: var(--body); font-weight: 550; margin-bottom: 0.6rem; }
.safety p, .safety li { font-size: var(--step--1); color: var(--nephrite-mid); }

/* ==========================================================================
   article furniture
   ========================================================================== */

.article-head { padding-block: clamp(3rem, 2rem + 4vw, 5rem) 0; }
.article-head h1 { font-size: var(--step-4); max-width: 22ch; }
.article-head .lede { margin-top: 1.2rem; max-width: 46ch; }

.crumb {
  font-size: var(--step--1);
  color: var(--nephrite-mid);
  margin-bottom: 1.4rem;
}
.crumb a { text-decoration: none; color: var(--nephrite-mid); }
.crumb a:hover { color: var(--celadon-deep); text-decoration: underline; }

.next-read {
  margin-top: var(--section);
  padding: 2.2rem 2rem;
  background: var(--celadon);
}
.next-read h2 { font-size: var(--step-1); margin-bottom: 0.7rem; }
.next-read p { margin-bottom: 0; }

/* ==========================================================================
   blog index
   ========================================================================== */

.cluster { margin-bottom: var(--section); }
.cluster > p { max-width: 46ch; color: var(--nephrite-mid); }

.entries { list-style: none; margin: 2rem 0 0; padding: 0; }
.entries li { border-top: 1px solid var(--celadon); padding: 1.5rem 0; }
.entries li:last-child { border-bottom: 1px solid var(--celadon); }
.entries a {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 300;
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 60;
  text-decoration: none;
  line-height: 1.2;
  display: inline-block;
  margin-bottom: 0.4rem;
}
.entries p { font-size: var(--step--1); color: var(--nephrite-mid); margin: 0; max-width: 52ch; }

/* ==========================================================================
   footer
   ========================================================================== */

.foot {
  border-top: 1px solid var(--celadon);
  padding-block: 3rem 3.5rem;
  background: var(--paper-deep);
  font-size: var(--step--1);
  color: var(--nephrite-mid);
}
.foot .wrap { display: grid; gap: 1.6rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.foot-nav a { text-decoration: none; color: var(--nephrite-mid); }
.foot-nav a:hover { color: var(--nephrite); text-decoration: underline; }
.foot small { display: block; max-width: 60ch; line-height: 1.6; }

/* ==========================================================================
   404
   ========================================================================== */

.lost { text-align: center; padding-block: clamp(5rem, 4rem + 6vw, 9rem); }
.lost h1 { font-size: var(--step-4); }
.lost p { max-width: 42ch; margin-inline: auto; color: var(--nephrite-mid); }

/* ==========================================================================
   motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__glow { animation: none; }
  .lotus .petal { animation: none; opacity: 1; transform: none; }
  .lotus .heart, .lotus .water { animation: none; opacity: 1; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   photography
   ========================================================================== */

.shot {
  margin: 2.6rem 0;
  padding: 0;
}
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}
.prose .shot {
  /* let images breathe slightly wider than the text measure on large screens */
  margin-inline: 0;
}
@media (min-width: 62rem) {
  .prose .shot { margin-inline: -3rem; }
}
