/* Typography */

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--micro);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-2);
  font-size: var(--small);
  color: var(--text-soft);
  line-height: 1.6;
}
.dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 3rem;
  padding: 0 var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn--primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-bg-hover);
}
.btn--quiet {
  border-color: var(--line-strong);
  background: var(--surface);
}
.btn--quiet:hover {
  border-color: var(--text);
}
.btn--text {
  padding-inline: var(--s-3);
  color: var(--text-soft);
}
.btn--text:hover {
  color: var(--text);
}
.btn--small {
  min-height: 2.25rem;
  padding-inline: var(--s-3);
  font-size: var(--small);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger-text {
  padding-inline: var(--s-3);
  color: var(--danger);
}
.btn--danger-text:hover {
  text-decoration: underline;
}
.btn:disabled {
  cursor: not-allowed;
  background: var(--surface-sunk);
  border-color: var(--line);
  color: var(--text-soft);
}

.btn .icon {
  flex: none;
}

.link-arrow {
  color: var(--accent);
  font-size: var(--small);
  text-decoration: none;
}
.link-arrow:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  padding-block: var(--s-2);
  color: var(--text-soft);
  font-size: var(--small);
  text-decoration: none;
}
.back-link:hover {
  color: var(--text);
}

/* Page header: a serif title and a quiet line beneath it */

.page-header {
  margin-bottom: var(--s-7);
}
.page-header .eyebrow {
  margin-bottom: var(--s-3);
}
.page-header__title {
  font-size: var(--step-4);
  line-height: 1.12;
  color: var(--text);
}
.page-header__text {
  margin-top: var(--s-3);
  color: var(--text-soft);
  font-size: var(--step-1);
}

/* Welcome: the doorway, centred on the plain page */

.welcome {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(100dvh - var(--header-h) - 3rem);
  padding-block: var(--s-7);
  text-align: center;
}
.welcome__title {
  max-width: 14ch;
  font-size: var(--step-5);
  line-height: 1.12;
}
.welcome__text {
  max-width: 30rem;
  margin-top: var(--s-5);
  color: var(--text-soft);
  font-size: var(--step-1);
}
.welcome__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-7);
}

/* Today: the thought, centred */

.today-head {
  max-width: 46rem;
  margin: 0 auto var(--s-7);
  text-align: center;
}
.thought-quote {
  margin-top: var(--s-5);
  font-family: var(--font-serif);
  font-size: var(--step-4);
  font-weight: 400;
  line-height: 1.22;
  text-wrap: balance;
}
.thought-author {
  margin-top: var(--s-5);
  color: var(--text-soft);
  font-size: var(--step-0);
}
.thought-tools {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-4);
}
.thought-save {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: var(--small);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.thought-save:hover {
  color: var(--accent);
}

.reading {
  max-width: 36rem;
  margin-inline: auto;
}

/* Cards */

.grid {
  display: grid;
  gap: var(--s-4);
}
@media (min-width: 620px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-4);
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.card--link:hover {
  border-color: var(--line-strong);
}
.card__title {
  font-family: var(--font-serif);
  font-size: var(--step-2);
  line-height: 1.2;
}
.card__text {
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.card__count {
  margin-top: var(--s-3);
  color: var(--text-soft);
  font-size: var(--micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Invitation */

.invitation {
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}
.invitation__text {
  margin-top: var(--s-3);
  font-size: var(--step-1);
  line-height: 1.5;
  text-wrap: balance;
}

.past {
  margin-top: var(--s-5);
  text-align: center;
  font-size: var(--small);
  color: var(--text-soft);
}
.past a {
  color: var(--accent);
}

/* Writing: a blank page, not a form */

.writing {
  margin-top: var(--s-7);
}
.page-area__wrap {
  padding: var(--s-2) var(--s-4) var(--s-4);
}
.page-area {
  display: block;
  width: 100%;
  min-height: 11rem;
  padding: var(--s-2) 0;
  border: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: var(--step-1);
  line-height: 1.75;
  color: var(--text);
  caret-color: var(--accent);
}
.page-area::placeholder {
  color: var(--text-soft);
  opacity: 0.75;
}
.page-area:focus {
  outline: none;
}

.writing-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4);
  border-top: 1px solid var(--line);
}
.writing-foot__link {
  color: var(--text-soft);
  font-size: var(--small);
  text-decoration: none;
}
.writing-foot__link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.writing-foot .btn {
  min-height: 2.5rem;
  padding-inline: var(--s-5);
}
.writing-foot__actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.actions--center {
  justify-content: center;
}

.kept {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  animation: fade-in var(--dur-slow) var(--ease) both;
}
.kept__title {
  margin-top: var(--s-3);
  font-family: var(--font-serif);
  font-size: var(--step-3);
  line-height: 1.2;
}

/* Journal and saved */

.stack {
  display: grid;
  gap: var(--s-4);
}

.entry {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
.entry:hover {
  border-color: var(--line-strong);
}
.entry__quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.5;
}
.entry__text {
  line-height: 1.7;
  white-space: pre-line;
}

.saved-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.saved-item__quote a {
  font-family: var(--font-serif);
  font-size: var(--step-2);
  line-height: 1.35;
  text-decoration: none;
}
.saved-item__quote a:hover {
  color: var(--accent);
}

/* The thought a journal entry belongs to */

.thought {
  margin-bottom: var(--s-5);
  text-align: center;
}
.thought__text {
  margin-top: var(--s-3);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.4;
  text-wrap: balance;
}
.thought__attribution {
  margin-top: var(--s-3);
  font-size: var(--small);
  color: var(--text-soft);
}

/* Empty states */

.empty {
  padding: var(--s-8) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}
.empty__title {
  font-size: var(--step-2);
  line-height: 1.3;
  font-family: var(--font-sans);
  color: var(--text-soft);
}
.empty__text {
  margin-top: var(--s-2);
  color: var(--text-soft);
  font-size: var(--small);
}
.empty__action {
  margin-top: var(--s-5);
}

/* Social icons: a quiet signature at the foot of the Explore page */

.social {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.social__item {
  display: inline-grid;
  place-items: center;
  width: 2.75rem; /* a comfortable tap target around a 20px icon */
  height: 2.75rem;
  border-radius: 50%;
  color: var(--text-soft);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
a.social__item:hover {
  color: var(--accent);
  background: var(--surface-sunk);
}
.social__item--idle {
  cursor: default;
}

/* Settings */

.settings-section {
  padding-block: var(--s-6);
  border-top: 1px solid var(--line);
}
.settings-section:last-child {
  border-bottom: 1px solid var(--line);
}
.settings-section__title {
  margin-bottom: var(--s-4);
  font-size: var(--step-2);
}
.settings-text {
  max-width: 34rem;
}
.settings-note {
  max-width: 34rem;
  margin-top: var(--s-3);
  font-size: var(--small);
  color: var(--text-soft);
}
.settings .actions {
  margin-top: var(--s-5);
}
.field-label {
  display: block;
  margin-block: var(--s-5) var(--s-2);
  font-size: var(--small);
  color: var(--text-soft);
}
.field {
  width: 100%;
  max-width: 20rem;
  min-height: 3rem;
  padding: 0 var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.field::placeholder {
  color: var(--text-soft);
  opacity: 0.8;
}
.field:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  border: 0;
  padding: 0;
}
.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--text);
  background: var(--surface-sunk);
}
.choice:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.notice {
  max-width: 34rem;
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  font-size: var(--small);
}


/* Dialog */

.dialog {
  margin: auto; /* the site-wide reset would otherwise pin it to a corner */
  width: min(92vw, 28rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.35);
  animation: fade-in var(--dur) var(--ease) both;
}
.dialog::backdrop {
  background: rgba(22, 20, 18, 0.55);
}
.dialog__body {
  padding: var(--s-6);
}
.dialog__title {
  font-size: var(--step-2);
  line-height: 1.25;
}
.dialog__text {
  margin-top: var(--s-3);
  color: var(--text-soft);
}
.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-6);
}


/* Share card dialog */

.dialog.sharecard {
  width: min(94vw, 34rem);
}
.sharecard__preview {
  display: grid;
  place-items: center;
  margin-top: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
}
.sharecard__canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(44vh, 28rem);
  border-radius: 3px;
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.35);
  transition: opacity var(--dur) var(--ease);
}
.sharecard__canvas.is-busy {
  opacity: 0.45;
}
.sharecard__controls {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.sharecard__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}
.sharecard__legend {
  float: left;
  min-width: 3rem;
  margin: 0;
  padding: 0;
}
.choice--small {
  min-height: 2.5rem;
  padding: 0 var(--s-4);
  font-size: var(--small);
}
.sharecard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2) var(--s-3);
  margin-top: var(--s-5);
}
@media (max-width: 520px) {
  .sharecard__actions .btn--primary {
    flex: 1 1 100%;
    order: -1;
  }
}

@media (max-width: 520px) {
  .welcome__actions .btn {
    flex: 1 1 100%;
  }
  .writing-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .writing-foot__actions {
    justify-content: space-between;
  }
}

@media print {
  .header,
  .bottomnav,
  .status,
  .backdrop {
    display: none;
  }
}
