/* elastic minds lab ~ shared design system
   no em-dashes anywhere. tildes only. */

:root {
  --paper:     #f5f1e8;
  --night-bg:  #050810;
  --ink:       #1a1a1a;
  --warm:      #f0ecde;
  --warm-soft: #c4bfa8;
  --muted:     #5a544a;
  --tilde:     #8a8472;
  --leaf-day:  #2f5f3a;
  --leaf-stem: #1d3f24;
  --leaf-night:#f0c860;
  --leaf-night-stem: #d4a338;
  --rule:      rgba(26, 26, 26, 0.18);
  --rule-soft: rgba(26, 26, 26, 0.12);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; }

/* ~ links default underline style ~ */
.u-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ============================================================
   DOORMAT + HUB (shared shell, two states via data-state)
   ============================================================ */

.doormat-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.doormat {
  position: relative;
  width: 100%;
  max-width: 880px;
  min-height: 540px;
  padding: 5rem 4rem 4rem;
}

.corner {
  position: absolute;
  top: 3rem;
  right: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.copy { max-width: 32em; }

.name {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

.motto {
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.lead {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.wave {
  font-size: 17px;
  line-height: 1.95;
  padding-left: 1.5rem;
}

.wave strong { font-weight: 500; }
.wave em     { opacity: 0.7; font-style: italic; }
.wave-last   { margin-bottom: 1.75rem; }

.invite {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.invite a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.arrow { display: inline-block; margin-left: 2px; }

.email {
  font-size: 15px;
  opacity: 0.7;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.email a { color: inherit; text-decoration: none; }
.email a:hover { text-decoration: underline; text-underline-offset: 3px; }

.signature {
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
}

/* ~ hub-specific (inherits doormat shell) ~ */

.hub-name {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.crumb {
  font-size: 14px;
  opacity: 0.55;
  font-style: italic;
  margin-bottom: 3rem;
}

.crumb a, .crumb button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 0.5px dotted currentColor;
}

.door {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1.75rem 0;
  border-bottom: 0.5px solid var(--rule);
  transition: opacity 0.3s ease;
}

.door:first-of-type { border-top: 0.5px solid var(--rule); }
.door:hover { opacity: 0.65; }

.door-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.door-line {
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.75;
  font-style: italic;
}

.door-arrow {
  display: inline-block;
  margin-left: 0.5rem;
  opacity: 0.5;
}

.hub-footer {
  margin-top: 3rem;
  font-size: 14px;
  opacity: 0.6;
  line-height: 1.7;
}

.hub-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.hub-signature {
  margin-top: 1.5rem;
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
}

/* ~ state-driven visibility ~ */
body[data-state="doormat"] .state-doormat { display: block; }
body[data-state="doormat"] .state-hub     { display: none; }
body[data-state="hub"]     .state-doormat { display: none; }
body[data-state="hub"]     .state-hub     { display: block; }

/* ~ corner SVG visibility per state (doormat vs hub sprig) ~ */
body[data-state="doormat"] .sprig-hub     { display: none; }
body[data-state="hub"]     .sprig-doormat { display: none; }

/* ============================================================
   NIGHT MODE
   ============================================================ */

body[data-mode="night"] {
  background: var(--night-bg) !important;
  color: var(--warm) !important;
}

body[data-mode="night"] html { background: var(--night-bg) !important; }

/* iPhone Safari hardening: persistent black panel + sky behind everything */
.sky-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  display: none;
}

body[data-mode="night"] .sky-bg { display: block; }

body[data-mode="night"] .doormat-shell {
  position: relative;
  z-index: 1;
}

body[data-mode="night"] .copy p,
body[data-mode="night"] .copy .name,
body[data-mode="night"] .copy .motto,
body[data-mode="night"] .copy .lead,
body[data-mode="night"] .copy .wave,
body[data-mode="night"] .copy .invite { color: var(--warm) !important; }

body[data-mode="night"] .wave strong { color: var(--warm) !important; }
body[data-mode="night"] .wave em     { color: var(--warm-soft) !important; }
body[data-mode="night"] .invite a    { color: var(--warm) !important; }
body[data-mode="night"] .email,
body[data-mode="night"] .email a     { color: var(--warm-soft) !important; }
body[data-mode="night"] .signature   { color: var(--tilde) !important; }

body[data-mode="night"] .hub-name    { color: var(--warm) !important; }
body[data-mode="night"] .crumb,
body[data-mode="night"] .crumb a,
body[data-mode="night"] .crumb button { color: var(--warm) !important; opacity: 0.7; }
body[data-mode="night"] .door        { border-color: rgba(240, 236, 222, 0.18); }
body[data-mode="night"] .door:first-of-type { border-top-color: rgba(240, 236, 222, 0.18); }
body[data-mode="night"] .door-name   { color: var(--warm) !important; }
body[data-mode="night"] .door-line   { color: var(--warm-soft) !important; }
body[data-mode="night"] .hub-footer,
body[data-mode="night"] .hub-footer a { color: var(--warm-soft) !important; }
body[data-mode="night"] .hub-signature { color: var(--tilde) !important; }

/* ~ corner SVGs in night mode ~ */
body[data-mode="night"] .clock-stroke { stroke: var(--warm) !important; }
body[data-mode="night"] .clock-fill   { fill: var(--warm) !important; }
body[data-mode="night"] .sprig-stem   { stroke: var(--warm) !important; }
body[data-mode="night"] .sprig-bud    { stroke: var(--warm) !important; }
body[data-mode="night"] .sprig-leaf   { fill: var(--leaf-night) !important; stroke: var(--leaf-night-stem) !important; filter: url(#leaf-glow); }
body[data-mode="night"] .sprig-petal  { stroke: var(--warm) !important; }

/* ============================================================
   DOORMAT + HUB ~ MOBILE
   ============================================================ */

@media (max-width: 720px) {
  .doormat-shell { padding: 2rem 1.5rem; align-items: flex-start; }
  .doormat { padding: 2rem 1.5rem; min-height: 0; }
  .corner {
    position: relative;
    top: auto; right: auto;
    flex-direction: row;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }
  .name      { font-size: 22px; margin-bottom: 1.75rem; }
  .motto     { font-size: 18px; margin-bottom: 1.5rem; }
  .hub-name  { font-size: 22px; margin-bottom: 1rem; }
  .crumb     { margin-bottom: 2rem; }
  .door-name { font-size: 19px; }
}

/* ============================================================
   WAVE ROOMS (always day mode)
   ============================================================ */

.room-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2rem 4rem;
}

.room {
  position: relative;
  width: 100%;
  max-width: 880px;
  padding: 4rem 4rem 3rem;
}

.room .corner {
  top: 2.5rem;
  right: 2.5rem;
  gap: 1rem;
  opacity: 0.7;
}

.room .crumb {
  font-size: 13px;
  margin-bottom: 2.5rem;
}

.wave-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 2.25rem;
}

.wave-name-tight { margin-bottom: 0.75rem; }

.slogan {
  font-style: italic;
  font-size: 16px;
  opacity: 0.65;
  margin-bottom: 2.75rem;
  letter-spacing: 0.01em;
}

.essence {
  max-width: 32em;
  margin-bottom: 4rem;
}

.essence p {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.essence p:last-child { margin-bottom: 0; }
.essence em { font-style: italic; }

.gallery-label {
  font-size: 13px;
  opacity: 0.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 38em;
}

.group {
  margin-bottom: 2.5rem;
  max-width: 38em;
}

.group:last-of-type { margin-bottom: 0; }

.group-label {
  font-size: 12px;
  opacity: 0.55;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.card {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1.5rem 0;
  border-top: 0.5px solid var(--rule);
  transition: opacity 0.3s ease;
}

.gallery .card:last-child,
.group   .card:last-child { border-bottom: 0.5px solid var(--rule); }

.card:hover { opacity: 0.7; }

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 0.4rem;
}

.card-title {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.group .card-title { font-size: 18px; }

.card-state {
  font-size: 12px;
  font-style: italic;
  opacity: 0.55;
  white-space: nowrap;
}

.card-line {
  font-size: 15px;
  opacity: 0.7;
  line-height: 1.6;
}

.card-arrow { display: inline-block; margin-left: 4px; opacity: 0.5; }

.card-special-note {
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
  line-height: 1.6;
  margin-top: 0.4rem;
}

.card-static, .card-forming { cursor: default; }
.card-static:hover, .card-forming:hover { opacity: 1; }

.room-footer {
  margin-top: 4rem;
  font-size: 14px;
  opacity: 0.55;
  line-height: 1.7;
  max-width: 32em;
}

.room-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.room-signature {
  margin-top: 1.5rem;
  font-size: 12px;
  opacity: 0.5;
  font-style: italic;
}

@media (max-width: 720px) {
  .room-shell { padding: 2rem 1.5rem 3rem; }
  .room { padding: 1.5rem 0.5rem; }
  .room .corner {
    position: relative;
    top: auto; right: auto;
    flex-direction: row;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
    opacity: 0.7;
  }
  .wave-name { font-size: 24px; margin-bottom: 1.75rem; }
  .wave-name-tight { margin-bottom: 0.75rem; }
  .slogan { font-size: 15px; margin-bottom: 2rem; }
  .essence p { font-size: 16px; }
  .essence { margin-bottom: 3rem; }
  .card-row { flex-wrap: wrap; gap: 0.5rem; }
  .card-title, .group .card-title { font-size: 17px; }
}

/* ============================================================
   READER PAGES (always day mode)
   ============================================================ */

.reader {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 2rem 3rem;
}

.crumb-top {
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
  margin-bottom: 3rem;
}

.crumb-top a {
  color: inherit;
  text-decoration: none;
  border-bottom: 0.5px dotted currentColor;
}

.wall-card {
  margin-bottom: 2.5rem;
  max-width: 32em;
}

.wall-card-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.75rem;
}

.wall-card-context {
  font-size: 15px;
  line-height: 1.7;
  opacity: 0.7;
  font-style: italic;
}

.pdf-frame {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: 0.5px solid var(--rule);
  background: #ffffff;
  display: block;
  margin-bottom: 1.25rem;
}

.fallback-line {
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.fallback-line a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 0.5px;
}

.crumb-bottom {
  font-size: 13px;
  opacity: 0.55;
  font-style: italic;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 0.5px solid var(--rule-soft);
}

.crumb-bottom a {
  color: inherit;
  text-decoration: none;
  border-bottom: 0.5px dotted currentColor;
}

@media (max-width: 720px) {
  .reader { padding: 2rem 1.25rem 2.5rem; }
  .wall-card-title { font-size: 21px; }
  .pdf-frame { height: 70vh; min-height: 500px; }
}

/* ============================================================
   CLOCK POSE VISIBILITY ~ global (doormat, hub, wave rooms)
   ============================================================ */

.clock-night-pose { display: none; }
body[data-mode="night"] .clock-day-pose  { display: none; }
body[data-mode="night"] .clock-night-pose { display: block; }

/* ============================================================
   NIGHT MODE ~ WAVE ROOMS AND READER PAGES
   ============================================================ */

body[data-mode="night"] .card { border-top-color: rgba(240, 236, 222, 0.18); }
body[data-mode="night"] .gallery .card:last-child,
body[data-mode="night"] .group  .card:last-child { border-bottom-color: rgba(240, 236, 222, 0.18); }

body[data-mode="night"] .pdf-frame    { border-color: rgba(240, 236, 222, 0.18); }
body[data-mode="night"] .crumb-bottom { border-top-color: rgba(240, 236, 222, 0.08); }

/* ============================================================
   HYHM ESSAY READER (inline HTML, no iframe)
   ============================================================ */

.essay {
  max-width: 34em;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.75;
}

.essay h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.essay .essay-subtitle {
  text-align: center;
  font-size: 15px;
  font-style: italic;
  opacity: 0.65;
  margin-bottom: 3rem;
}

.essay p {
  margin-bottom: 1.25rem;
}

.essay p.lead-line {
  font-size: 18px;
  margin-bottom: 1.5rem;
}

.essay em { font-style: italic; }

.essay-divider {
  text-align: center;
  font-size: 18px;
  color: var(--tilde);
  letter-spacing: 0.4em;
  margin: 2rem 0;
}

.essay-closing {
  text-align: center;
  font-size: 22px;
  margin: 2rem 0;
}

.essay-footer {
  margin-top: 2.5rem;
  font-size: 14px;
  font-style: italic;
  opacity: 0.6;
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .essay { font-size: 16px; }
  .essay h1 { font-size: 24px; }
  .essay p.lead-line { font-size: 17px; }
}
