/*
  Deepwords brand layer: the heart-green identity.
  Loaded last, so it refines the base styles without changing their structure.
*/

html[data-text='large'] { font-size: 112.5%; }
html[data-text='larger'] { font-size: 125%; }

/* Cormorant is a delicate face: give it a little more size and breathing room */
h1, h2, h3, .wordmark, .card__title, .thought-quote, .page-header__title, .welcome__title {
  letter-spacing: -0.005em;
}
.thought-quote, .page-header__title, .welcome__title { font-size-adjust: none; }
.thought-quote { font-size: clamp(2.2rem, 1.5rem + 3.2vw, 3.7rem); font-weight: 500; line-height: 1.16; }
.page-header__title { font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.7rem); font-weight: 500; }
.welcome__title { font-size: clamp(2.8rem, 1.6rem + 5vw, 5.4rem); font-weight: 500; max-width: 13ch; }
.card__title { font-size: 1.5rem; font-weight: 500; }
.wordmark { font-size: 1.6rem; font-weight: 500; letter-spacing: 0.01em; }
.welcome__text { font-size: 1.1875rem; }

/* Small caps for labels */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* The signature mark gets a little air */
.brand svg { transition: transform 900ms var(--ease-soft); }
.brand:hover svg { transform: rotate(90deg); }

/* A mist-green wash behind the busts */
.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 55% at 78% 38%, color-mix(in srgb, var(--mist) 70%, transparent), transparent 70%);
  opacity: 0.8;
  pointer-events: none;
}
:root[data-theme='dark'] .backdrop::before { background: radial-gradient(60% 55% at 78% 38%, rgba(74, 154, 114, 0.16), transparent 70%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .backdrop::before { background: radial-gradient(60% 55% at 78% 38%, rgba(74, 154, 114, 0.16), transparent 70%); }
}
@media (max-width: 47.99rem) {
  .backdrop::before { background: radial-gradient(70% 45% at 50% 30%, color-mix(in srgb, var(--mist) 70%, transparent), transparent 70%); }
}

/* Cards: a hairline of green when hovered */
.card--link { transition: border-color 500ms var(--ease-soft), transform 500ms var(--ease-soft), background 500ms var(--ease-soft); }
.card--link:hover { border-color: var(--leaf); }
.card--feature { border-color: color-mix(in srgb, var(--leaf) 55%, var(--line)); background: color-mix(in srgb, var(--mist) 45%, transparent); }
:root[data-theme='dark'] .card--feature { background: rgba(74, 154, 114, 0.1); }
.card__eyebrow { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.card--row { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-4); align-items: center; }
.card--row .icon { grid-row: span 2; color: var(--accent); }

/* Slow, soft arrival */
@keyframes soft-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page { animation: soft-rise 900ms var(--ease-soft) both; }

/* Loading emblem */
.boot svg { animation: breathe 3.2s ease-in-out infinite; color: var(--green); }
@keyframes breathe { 0%, 100% { opacity: 0.45; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1); } }

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-7) var(--gutter) var(--s-8);
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5); }
.footer__links a { color: var(--text-soft); font-size: var(--small); text-decoration: none; padding-block: var(--s-2); }
.footer__links a:hover { color: var(--accent); text-decoration: underline; }
.footer__credit { margin-top: var(--s-4); font-size: var(--micro); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
@media (max-width: 47.99rem) { .footer { padding-bottom: calc(var(--bottomnav-h) + var(--s-7)); } }
.app[data-page='studio'] .footer { display: none; }

/* Welcome */
.welcome__mark { color: var(--green); margin-bottom: var(--s-6); }
.welcome__about { margin-top: var(--s-6); color: var(--text-soft); font-size: var(--small); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.welcome__about:hover { color: var(--accent); }

/* Start here card on Today */
.startcard {
  display: grid;
  gap: var(--s-2);
  max-width: 34rem;
  margin: var(--s-8) auto 0;
  padding: var(--s-5) var(--s-6);
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 500ms var(--ease-soft);
}
.startcard:hover { border-color: var(--leaf); }
.startcard__title { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; }
.startcard__text { color: var(--accent); font-size: var(--small); }

/* Seven days */
.week { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.week__item { display: grid; gap: var(--s-1); padding: var(--s-5); text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color 500ms var(--ease-soft); }
.week__item:hover { border-color: var(--leaf); }
.week__day { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.week__word { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; }
.week__quote { color: var(--text-soft); }

/* Library */
.library__bar { display: grid; grid-template-columns: 1fr; gap: var(--s-3); margin-bottom: var(--s-4); }
@media (min-width: 48rem) { .library__bar { grid-template-columns: 1.6fr 1fr; } }
.library__count { color: var(--text-soft); font-size: var(--small); margin-bottom: var(--s-4); }
.library__list { display: grid; }
.library__item { display: grid; gap: var(--s-2); padding: var(--s-5) 0; text-decoration: none; border-top: 1px solid var(--line); }
.library__item:hover .library__quote { color: var(--accent); }
.library__quote { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.3; font-weight: 500; transition: color 400ms var(--ease-soft); }
.library__meta { font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-soft); }

/* Your space */
.you__size { margin-top: var(--s-7); }

/* Prose pages */
.prose p { margin-bottom: var(--s-5); font-size: 1.1875rem; line-height: 1.75; }
.prose h2 { margin: var(--s-7) 0 var(--s-3); font-size: 1.75rem; font-weight: 500; }
.prose__sign { font-family: var(--font-serif); font-style: italic; color: var(--accent); }
.prose .actions { margin-top: var(--s-6); }
.walker, .empty__walker { color: var(--leaf); }
.walker { margin-bottom: var(--s-5); }
.walker .icon, .empty__walker .icon { stroke-width: 0.75; }
.empty__walker { display: grid; justify-items: center; margin-bottom: var(--s-3); }

/* Tour */
.tour { list-style: none; padding: 0; display: grid; gap: var(--s-4); margin-bottom: var(--s-5); }
.tour li { display: grid; gap: var(--s-1); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.tour strong { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 500; }
.tour .tag { justify-self: start; font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--leaf); border-radius: var(--r-pill); padding: 0.1rem 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  .page, .boot svg, .brand svg { animation: none !important; transition: none !important; }
}

select.field { font-family: var(--font-sans); font-size: var(--step-0); appearance: none; padding-right: 2.5rem; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23567' stroke-width='1.5'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 1rem center; }

/* Dark mode: deep heart-green with soft depth (vignette, glow behind the bust, fine grain) */
:root[data-theme='dark'] body {
  background: radial-gradient(120% 95% at 62% 28%, rgba(14, 62, 52, 0.55), rgba(3, 28, 29, 0) 62%), radial-gradient(140% 120% at 50% 50%, rgba(3, 28, 29, 0) 55%, rgba(0, 10, 11, 0.55) 100%), var(--bg);
  background-attachment: fixed;
}
:root[data-theme='dark'] body::after {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); opacity: 0.045; mix-blend-mode: overlay;
}
:root[data-theme='dark'] .backdrop::before { background: radial-gradient(55% 55% at 76% 40%, rgba(40, 130, 96, 0.28), rgba(3, 28, 29, 0) 70%); opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) body {
    background: radial-gradient(120% 95% at 62% 28%, rgba(14, 62, 52, 0.55), rgba(3, 28, 29, 0) 62%), radial-gradient(140% 120% at 50% 50%, rgba(3, 28, 29, 0) 55%, rgba(0, 10, 11, 0.55) 100%), var(--bg);
    background-attachment: fixed;
  }
  :root:not([data-theme='light']) body::after { content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); opacity: 0.045; mix-blend-mode: overlay; }
  :root:not([data-theme='light']) .backdrop::before { background: radial-gradient(55% 55% at 76% 40%, rgba(40, 130, 96, 0.28), rgba(3, 28, 29, 0) 70%); opacity: 1; }
}
@media (max-width: 47.99rem) {
  :root[data-theme='dark'] .backdrop::before { background: radial-gradient(75% 45% at 50% 30%, rgba(40, 130, 96, 0.3), rgba(3, 28, 29, 0) 70%); }
}

/* Archive tabs and Wise Quotes A–Z */
.archive-tabs { display: flex; gap: var(--s-5); margin-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
.archive-tabs__tab { padding: var(--s-2) 0 var(--s-3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-soft); text-decoration: none; font-size: 0.9375rem; }
.archive-tabs__tab:hover { color: var(--text); }
.archive-tabs__tab.is-on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.quotes__bar { margin-bottom: var(--s-4); }
.quotes__letters { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-4); }
.quotes__letter { min-width: 2.25rem; min-height: 2.25rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 0.5rem; background: transparent; color: var(--text); font: inherit; font-size: 0.875rem; cursor: pointer; }
.quotes__letter:hover { border-color: var(--accent); color: var(--accent); }
.quotes__letter.is-empty { color: var(--text-soft); opacity: 0.4; cursor: default; }
.quotes__group { margin-bottom: var(--s-6); }
.quotes__heading { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; color: var(--accent); margin: 0 0 var(--s-2); scroll-margin-top: 5rem; outline: none; }
.quotes__person { display: grid; gap: var(--s-1); padding: var(--s-4) 0; border-top: 1px solid var(--line); text-decoration: none; }
.quotes__person:hover .quotes__name { color: var(--accent); }
.quotes__name { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 500; transition: color 400ms var(--ease-soft); }
.quotes__about { font-size: var(--small); color: var(--text-soft); }
.quotes__quotes { display: grid; }
.quotes__quote { margin: 0; padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.quotes__text { margin: 0 0 var(--s-3); font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.35; font-weight: 500; }
.quotes__caption { display: grid; justify-items: start; gap: var(--s-1); font-size: var(--small); color: var(--text-soft); }
.quotes__note { font-style: italic; }
.quotes__card { margin-top: var(--s-2); padding-left: 0; }
.quotes__next { display: flex; justify-content: space-between; gap: var(--s-4); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.quotes__next a { color: var(--text-soft); text-decoration: none; }
.quotes__next a:hover { color: var(--accent); }

/* Archive: Deepwords (the owner's own words) */
.paths__search { margin: 0 0 var(--s-5); }
.words__bar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-3); }
.words__bar > input { grid-column: 1 / -1; }
@media (min-width: 48rem) { .words__bar { grid-template-columns: 2fr 1fr 1fr; } .words__bar > input { grid-column: auto; } }
.words__kinds { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.words__kind { min-height: 2.25rem; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text-soft); font: inherit; font-size: var(--small); cursor: pointer; }
.words__kind:hover { color: var(--text); border-color: var(--accent); }
.words__kind[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.words__list { display: grid; }
.words__post { padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.words__text { margin: 0; font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.4; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.words__post--reflection .words__text, .words__post--thread .words__text { font-size: 1.25rem; line-height: 1.5; }
.words__thread { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s-4); }
.words__thread li::marker { color: var(--accent); font-size: 0.85em; }
.words__meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-top: var(--s-3); font-size: var(--small); color: var(--text-soft); }
.words__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-2); }
.words__act { padding-left: 0; }
.words__x { font-size: var(--small); color: var(--accent); text-underline-offset: 3px; }
.words__more { text-align: center; padding-top: var(--s-5); }

/* Creator Studio (#/create) */
.create__heading { margin: var(--s-7) 0 var(--s-4); font-size: 1.75rem; font-weight: 500; }
.create__lede { margin: calc(-1 * var(--s-2)) 0 var(--s-2); color: var(--text-soft); }
.create__soon .tour { margin-bottom: 0; }
.create-feature { display: grid; grid-template-columns: 5.75rem 1fr; gap: var(--s-4); align-items: center; padding: var(--s-4); border: 1px solid color-mix(in srgb, var(--leaf) 55%, var(--line)); border-radius: var(--r-md); background: color-mix(in srgb, var(--mist) 45%, transparent); color: inherit; text-decoration: none; transition: border-color 500ms var(--ease-soft); }
.create-feature:hover { border-color: var(--leaf); }
.create-feature__body { display: grid; gap: var(--s-2); justify-items: start; }
.create-feature__title { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; line-height: 1.15; }
.create-feature__go { display: inline-flex; align-items: center; gap: var(--s-2); margin-top: var(--s-1); color: var(--accent); font-size: var(--small); font-weight: 500; }
@media (min-width: 40rem) { .create-feature { grid-template-columns: 10rem 1fr; gap: var(--s-6); padding: var(--s-6); } }

/* An ebook cover, drawn with the page (the same design as the PDF's cover) */
.book { position: relative; display: block; aspect-ratio: 148 / 210; width: 100%; overflow: hidden; border-radius: 4px; background: #031c1d; color: #e8f2ec; outline: 1px solid rgb(127 207 154 / 0.2); outline-offset: -1px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 18px 40px -18px rgb(3 28 29 / 0.55); container-type: inline-size; }
.book__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book__mark { position: absolute; top: 13cqw; left: 12cqw; display: grid; width: 7cqw; height: 7cqw; color: #7fcf9a; }
.book__mark .icon { width: 100%; height: 100%; }
.book__words { position: absolute; left: 12cqw; right: 8cqw; bottom: 15cqw; display: grid; justify-items: start; }
.book__edition, .book__by { font-family: var(--font-sans); font-size: max(3cqw, 0.5rem); letter-spacing: 0.2em; text-transform: uppercase; color: #7fcf9a; }
.book__title { margin: 3.4cqw 0 2.6cqw; font-family: var(--font-serif); font-size: 11cqw; font-weight: 500; line-height: 1; }
.book__subtitle { margin-bottom: 8cqw; font-family: var(--font-serif); font-style: italic; font-size: max(4.4cqw, 0.75rem); line-height: 1.3; color: #cfe3d6; }
.book__edition { white-space: nowrap; font-size: max(2.6cqw, 0.45rem); letter-spacing: 0.16em; }
.book--small .book__edition, .book--small .book__subtitle, .book--small .book__by { display: none; }
.book--small .book__title { margin: 0; font-size: 16cqw; }

/* An ebook's own page */
.ebook { display: grid; gap: var(--s-6); margin-top: var(--s-4); }
.ebook > .book { max-width: 16rem; }
.ebook .page-header { margin-bottom: var(--s-4); }
.ebook__text { margin: 0 0 var(--s-4); font-size: 1.0625rem; line-height: 1.7; }
.ebook__facts { margin: 0 0 var(--s-5); color: var(--text-soft); font-size: var(--small); }
.ebook__rights { margin: var(--s-4) 0 0; color: var(--text-soft); font-size: var(--small); }
.ebook__chapters { margin: 0; padding: 0; list-style: none; counter-reset: chapter; }
.ebook__chapters li { counter-increment: chapter; display: grid; grid-template-columns: 2.5rem 1fr; align-items: baseline; padding: var(--s-3) 0; border-top: 1px solid var(--line); font-family: var(--font-serif); font-size: 1.35rem; }
.ebook__chapters li::before { content: counter(chapter); color: var(--accent); font-family: var(--font-sans); font-size: var(--small); }
.ebook__taste { margin: 0; padding: var(--s-6) 0; border-top: 1px solid var(--line); }
/* Printables: a picture of one printed page, and the pieces printed */
.print-sheet { display: block; width: 100%; height: auto; aspect-ratio: 210 / 297; border-radius: 2px; background: #fff; outline: 1px solid var(--line); outline-offset: -1px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 18px 40px -20px rgb(3 28 29 / 0.45); }
.ebook > .print-sheet { max-width: 16rem; }
.ebook__pieces { margin: 0; padding: 0; list-style: none; }
.ebook__pieces li { display: grid; grid-template-columns: 2.5rem 1fr; align-items: baseline; padding: var(--s-4) 0; border-top: 1px solid var(--line); font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.45; white-space: pre-line; }
.ebook__num { color: var(--accent); font-family: var(--font-sans); font-size: var(--small); }
/* Carousels: the slides side by side, in a row that scrolls */
.slide-pic { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 4px; background: var(--mist); outline: 1px solid rgb(127 207 154 / 0.2); outline-offset: -1px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 18px 40px -18px rgb(3 28 29 / 0.55); }
.slides { display: grid; grid-auto-flow: column; grid-auto-columns: min(72%, 17rem); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-4); }
.slides > .slide-pic { scroll-snap-align: start; }
@media (min-width: 48rem) { .ebook { grid-template-columns: 15rem 1fr; gap: var(--s-7); align-items: start; } .ebook > .book, .ebook > .print-sheet { max-width: none; } }
