/* Shared styles for Hone writing pages */

:root {
  --font: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  --bg: #fafafa;
  --text: #171717;
  --text-secondary: #525252;
  --text-tertiary: #a3a3a3;
  --border: #e5e5e5;
  --surface: #ffffff;

  /* wordmark palette */
  --blue: #2b5aa7;
  --sky: #7fb0d8;
  --cream: #dcCBa4;
  --amber: #eda23b;
  --ember: #d84f1e;
  --ember-deep: #b93f14;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #fafafa;
    --text-secondary: #a3a3a3;
    --text-tertiary: #525252;
    --border: #262626;
    --surface: #141414;

    --blue: #6f9fd8;
    --sky: #8fb8dc;
    --cream: #d9c9a8;
    --amber: #f0a848;
    --ember: #e86436;
    --ember-deep: #f07c52;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Faint grid, matching the homepage */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 60%);
}

/* One quiet glow */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.glow-1 { width: 420px; height: 420px; background: var(--amber); top: -120px; right: -120px; }

/* ---------- Site bar ---------- */

.site-bar {
  position: relative;
  z-index: 2;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-bar .brand { display: inline-flex; align-items: center; }
.site-bar .brand img { display: block; height: 1.375rem; width: auto; }

.site-bar nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.site-bar nav a:hover { color: var(--text); }
.site-bar nav a[aria-current="page"] { color: var(--text); }

main { position: relative; z-index: 1; flex: 1; width: 100%; }

/* ---------- Article ---------- */

.article {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}

.article-head { max-width: 680px; margin: 0 auto 3rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}
.eyebrow .tick { color: var(--ember); }

.article-head h1 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2.25rem, 6vw, 3.375rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}

.dek {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.byline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.byline b { color: var(--text-secondary); font-weight: 500; }
.byline .sep { color: var(--border); }

/* ---------- Signal field (signature) ---------- */

.signal-field {
  margin: 0 auto 3.5rem;
  max-width: 880px;
}

.sf-grid {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(3rem, 1fr) auto;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 85% 50%, color-mix(in srgb, var(--ember) 6%, transparent), transparent 55%),
    var(--surface);
  padding: 2.25rem 2.5rem;
  gap: 0;
}

.sf-signals {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.875rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
  animation: bob 7s ease-in-out infinite;
}
.chip:nth-child(2) { animation-delay: -1.6s; margin-left: 1.25rem; }
.chip:nth-child(3) { animation-delay: -3.1s; margin-left: 0.375rem; }
.chip:nth-child(4) { animation-delay: -4.7s; margin-left: 1.625rem; }
.chip:nth-child(5) { animation-delay: -5.9s; margin-left: 0.75rem; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-blue { background: var(--blue); }
.dot-sky { background: var(--sky); }
.dot-cream { background: var(--cream); }
.dot-amber { background: var(--amber); }
.dot-ember { background: var(--ember); }

.sf-paths { position: relative; }
.sf-paths svg { display: block; width: 100%; height: 100%; }
.sf-paths path {
  fill: none;
  stroke: var(--text-tertiary);
  stroke-opacity: 0.45;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.sf-out {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.judgment {
  position: relative;
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.judgment::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg,
    var(--blue), var(--sky), var(--cream), var(--amber), var(--ember), var(--blue));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.judgment::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 210deg,
    var(--blue), var(--sky), var(--cream), var(--amber), var(--ember), var(--blue));
  filter: blur(14px);
  opacity: 0.25;
  z-index: -1;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.18; transform: scale(0.97); }
  50% { opacity: 0.35; transform: scale(1.03); }
}
.judgment span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sf-arrow { color: var(--text-tertiary); flex: none; }
.sf-arrow svg { display: block; }

.decision {
  flex: none;
  background: var(--ember);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
@media (prefers-color-scheme: dark) {
  .decision { color: #140a06; }
}

.signal-field figcaption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 0.875rem;
}

/* ---------- Prose ---------- */

.prose { max-width: 680px; margin: 0 auto; }

.prose p {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.625rem;
}
.prose p:last-child { margin-bottom: 0; }

.prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.prose a:hover { color: var(--ember); text-decoration-color: var(--ember); }

/* Divider: three squares in wordmark colors */
.divider {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  margin: 3rem auto;
}
.divider i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: block;
}
.divider i:nth-child(1) { background: var(--blue); }
.divider i:nth-child(2) { background: var(--cream); }
.divider i:nth-child(3) { background: var(--ember); }

/* Pull quote */
.pull-quote {
  max-width: 680px;
  margin: 3rem auto;
  padding-left: 1.75rem;
  border-left: 3px solid var(--ember);
}
.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(1.375rem, 3.4vw, 1.75rem);
  line-height: 1.35;
  color: var(--text);
}

/* Question pills */
.question-list {
  list-style: none;
  max-width: 680px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.question-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.8125rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Experiment card ---------- */

.experiment {
  max-width: 680px;
  margin: 3.5rem auto 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--amber) 7%, transparent), transparent 50%),
    var(--surface);
  padding: 2rem 2.25rem;
}

.exp-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.exp-head img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.exp-head .eyebrow { margin-bottom: 0.25rem; }
.exp-head h2 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: 1.375rem;
  line-height: 1.2;
}

.experiment > p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.loop-strip {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.loop-strip li {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.3125rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.loop-strip li:not(:last-child)::after { content: none; }
.loop-strip .loop-arrow {
  border: none;
  background: none;
  padding: 0;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 0.875rem;
}

.exp-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.cta-secondary {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}
.cta-secondary:hover { color: var(--ember); }

.cta {
  display: inline-block;
  background: var(--ember);
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 10px;
  padding: 0.6875rem 1.375rem;
  transition: background var(--transition), transform var(--transition);
}
.cta:hover { background: var(--ember-deep); }
.cta:active { transform: translateY(1px); }
@media (prefers-color-scheme: dark) {
  .cta { color: #140a06; }
}

/* ---------- Footer ---------- */

footer {
  position: relative;
  z-index: 1;
  padding: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Focus, motion, mobile ---------- */

a:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .chip, .judgment::after { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

@media (max-width: 720px) {
  .article { padding: 2.75rem 1.5rem 4rem; }
  .site-bar { padding: 1.5rem 1.5rem 0; }

  .sf-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 1.25rem;
  }
  .sf-signals {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .chip { margin-left: 0 !important; animation: none; }
  .sf-paths { display: none; }
  .sf-out { flex-direction: column; gap: 0.625rem; }
  .sf-out::before {
    content: '';
    width: 1px;
    height: 1.5rem;
    background: var(--border);
    display: block;
  }
  .sf-arrow svg { transform: rotate(90deg); }

  .experiment { padding: 1.625rem 1.375rem; }
  .question-list li { border-radius: 20px; padding: 0.75rem 1.125rem; }
}
