
/* THE ORDER — Global styles
   Stillness first. No trend aesthetics.
*/

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

html, body {
  margin: 0;
  padding: 0;
  /* Quiet parchment background (mobile-first). */
  background: var(--bg) url('/assets/img/bg_parchment_warm.jpg') no-repeat center top;
  background-size: cover;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

body {
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soft wash over parchment so text remains readable (keep texture whisper-quiet). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(247, 242, 231, 0.58);
  pointer-events: none;
  z-index: -1;
}

main {
  /* Header height compensation (see .o-top). */
  min-height: calc(100vh - 98px);
}

/* Shell */
.o-shell {
  max-width: var(--max);
  margin: 0 auto;
  /*
    The top header is full-bleed + fixed.
    Reserve space so content never tucks under it.
  */
  padding: calc(var(--space-4) + 86px) var(--space-4) var(--space-6);
}

/* Auth screen: no fixed header, so remove header compensation padding. */
body[data-screen="auth"] .o-shell {
  padding-top: var(--space-5);
}

/* Gateway screen: no fixed header, full-screen centering handled in screens.css */
body[data-screen="gateway"] .o-shell {
  padding-top: var(--space-5);
}


/* Typography */
.o-title {
  font-size: 1.35rem;
  margin-bottom: var(--space-3);
}

.o-body {
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.o-body--small {
  font-size: 0.9rem;
}

.o-line {
  margin-bottom: var(--space-2);
}

/* Form primitives (used by auth + settings)
   Kept quiet and minimal.
*/
.o-field {
  display: block;
  text-align: left;
  margin-bottom: var(--space-3);
}

.o-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.o-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  padding: var(--space-3) var(--space-3);
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.o-input:focus {
  outline: none;
  border-color: var(--ink);
}

/* Buttons */
.o-btn {
  font-family: inherit;
  font-size: 1rem;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.o-btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.o-btn--full {
  width: 100%;
}

/* Today: Done state (quiet visual confirmation) */
.o-btn--primary.is-done {
  background: transparent;
  color: var(--accent-sage);
  border-color: rgba(107, 119, 106, 0.55);
}

.o-btn--ghost {
  background: transparent;
}

.o-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.o-btn--primary.is-done:disabled {
  opacity: 1;
}

/* Links */
.o-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.o-hint {
  margin-top: var(--space-3);
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.2em;
}


/* Top mark */
.o-top {
  /* Full-bleed, fixed header (not constrained by .o-shell padding/max-width) */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  width: 100vw;
  height: 86px;
  padding: 0;
  display: flex;
  justify-content: center;
  background: rgba(247, 242, 231, 0.88);
  border-bottom: 1px solid rgba(42, 39, 36, 0.10);
  backdrop-filter: blur(4px);
}

.o-top__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.o-top__logo {
  display: block;
  /* Larger mark with minimal padding */
  /* Keep header wrapper height fixed, but allow the mark to be larger. */
  height: 110px;
  width: auto;
  max-width: min(640px, 100%);
  margin-top: -12px;
}

/* Navigation */
.o-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: var(--space-3);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.o-nav__link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Choices */
.o-choices {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.o-choice {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

/* Onboarding (quiet fade-in, once per page) */
.ob21-content[data-fade] {
  opacity: 0;
  transition: opacity 780ms ease;
}

.ob21-content[data-fade].is-visible {
  opacity: 1;
}

.o-choice.is-selected {
  border-color: var(--ink);
}

/* Overlays */
.o-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 241, 236, 0.85);
  z-index: 50;
}

.o-overlay__panel {
  background: var(--card);
  border-radius: var(--r-2);
  padding: var(--space-5);
  max-width: var(--max);
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
}

.o-overlay[hidden] {
  display: none;
}
