/* Shared stylesheet for Pinehold sub-pages (/get.html, /access.html, /faq.html, etc.).
   Unified on the canonical nocturnal Pinehold design system (Pinehold_Rework_Mockup & native apps). */

@font-face {
  font-family: 'Instrument Serif';
  src: url(/fonts/instrument-serif.woff2) format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url(/fonts/instrument-serif-italic.woff2) format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url(/fonts/figtree.woff2) format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --backdrop: #06050D;
  --bg: #0A0915;
  --surface: #12101F;
  --surface-alt: #19162B;
  --input: #141223;
  --divider: rgba(246, 239, 230, 0.10);
  --border-strong: rgba(246, 239, 230, 0.20);
  --text: #F6EFE6;
  --text-sec: #B8B0C8;
  --muted: #8E87A3;
  --accent: #F0A36A;
  --accent-soft: rgba(240, 163, 106, 0.12);
  --on-accent: #140F1D;
  --success: #79C9A2;
  --danger: #E07A7A;
  --font-ui: 'Figtree', 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'IBM Plex Sans Arabic', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Compatibility aliases for existing sub-page inline rules */
  --night: var(--bg);
  --bg-deep: var(--backdrop);
  --surface-2: var(--surface-alt);
  --line: var(--divider);
  --line-soft: var(--divider);
  --ink: var(--text);
  --ink-2: var(--text-sec);
  --ink-3: var(--muted);
  --cream: var(--text);
  --mist: var(--text-sec);
  --hush: var(--muted);
  --lantern: var(--accent);
  --accent-ink: var(--on-accent);
  --accent-line: rgba(240, 163, 106, 0.36);
  --good: var(--success);
}

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

html, body {
  min-height: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
}

body, h1, h2, h3, p, ul, ol, dd, dl {
  margin: 0;
}

body {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.9;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

/* Signature painted Moon crest — radial dissolve directly onto --bg (no enclosing card) */
.moon-crest {
  display: block;
  width: 156px;
  height: 156px;
  object-fit: cover;
  border-radius: 50%;
  margin-inline: auto;
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 48%, rgba(0, 0, 0, 0) 74%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 48%, rgba(0, 0, 0, 0) 74%);
}

.moon-crest-sm {
  width: 112px;
  height: 112px;
}

.moon-crest-lg {
  width: 220px;
  height: 220px;
}

/* Page layout */
.wrap {
  width: min(100% - 2.5rem, 44rem);
  margin-inline: auto;
  padding-block: 3rem 5rem;
}

.wide {
  width: min(100% - 2.5rem, 64rem);
  margin-inline: auto;
  padding-block: 3rem 5rem;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}

.brand svg,
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--divider);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-sec);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Editorial Typography */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.35rem);
  line-height: 1.06;
  margin-block: 2.5rem 0.85rem;
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.9rem);
  line-height: 1.18;
  margin-block: 2.4rem 0.65rem;
}

h3 {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

p {
  color: var(--text-sec);
  text-wrap: pretty;
}

p + p, ul + p, p + ul, ol + p {
  margin-top: 1rem;
}

h1 + p.lede,
.lede {
  color: var(--text-sec);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.fine {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.kicker {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.sec-head {
  max-width: 44rem;
  margin-bottom: 2rem;
}

.sec-head p {
  margin-top: 0.8rem;
}

ul {
  padding-inline-start: 1.2rem;
  color: var(--text-sec);
}

ol {
  padding-inline-start: 1.35rem;
  color: var(--text-sec);
  margin-top: 1rem;
}

li + li {
  margin-top: 0.45rem;
}

ol li {
  margin-bottom: 0.5rem;
  padding-inline-start: 0.2rem;
}

strong, ol strong, ol em {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  border: 1px solid var(--divider);
  padding: 0.12em 0.38em;
  border-radius: 6px;
  color: var(--text);
  direction: ltr;
  unicode-bidi: isolate;
}

pre {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  line-height: 1.55;
  direction: ltr;
  unicode-bidi: isolate;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85em;
  white-space: pre;
}

/* Surfaces & Hairline Lists */
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.hairline-list {
  border-top: 1px solid var(--divider);
  margin-top: 1.25rem;
}

.hairline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--divider);
}

/* Buttons — flat Pinehold amber pill, zero neon halo */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.72rem 1.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn.ghost:hover {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin-block: 2.75rem 1.5rem;
}

footer {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

footer a {
  color: var(--text-sec);
}

/* Forms (/access.html, /account.html, /unlock.html) */
.field {
  margin-top: 1.15rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 140ms ease;
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field .err {
  display: block;
  color: var(--danger);
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

.field .err[hidden],
.compose[hidden] {
  display: none;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.compose {
  margin-top: 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-sec);
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
}

.req-star {
  color: var(--accent);
}

/* Tables (/permissions.html) */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--divider);
  border-radius: 16px;
  background: var(--surface);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 38rem;
  font-size: 0.92rem;
}

th, td {
  text-align: start;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}

thead th {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  background: var(--surface-alt);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  font-size: 0.83rem;
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
}

td.why,
td.never {
  color: var(--text-sec);
}

td.never em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.req {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.req.core {
  background: var(--accent-soft);
  color: var(--accent);
}

.req.opt {
  background: var(--surface-alt);
  color: var(--text-sec);
  border: 1px solid var(--divider);
}

.scrollhint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

@media (min-width: 1000px) {
  .scrollhint {
    display: none;
  }
}

/* Honest limits (/faq.html) */
.trust-lead {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 1.25rem;
  padding-block: 0.1rem;
  margin-bottom: 2rem;
  max-width: 44rem;
}

.trust-lead p {
  color: var(--text-sec);
}

.trust-lead b {
  color: var(--text);
}

.limits {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  margin-top: 1.5rem;
}

.limit {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  background: transparent;
}

.limit + .limit {
  border-top: 1px solid var(--divider);
}

.limit svg {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: var(--accent);
}

.limit b {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.limit p {
  color: var(--text-sec);
  font-size: 0.94rem;
  max-width: 72ch;
  margin: 0;
}

/* Hairline FAQ accordion (/faq.html) */
.faq {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--divider);
  margin-top: 1.5rem;
}

.faq details {
  border-bottom: 1px solid var(--divider);
  background: transparent;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.04rem;
  list-style: none;
  color: var(--text);
  transition: color 140ms ease;
}

.faq summary:hover {
  color: var(--accent);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  margin-inline-start: auto;
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-inline-end: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 200ms ease, border-color 140ms ease;
}

.faq details[open] summary {
  color: var(--accent);
}

.faq details[open] summary::after {
  border-color: var(--accent);
  transform: rotate(225deg) translateY(-2px);
}

.faq .body {
  padding: 0 0 1.25rem;
  color: var(--text-sec);
  font-size: 0.95rem;
}

.faq .body p {
  margin: 0;
}

.faq .body p + p {
  margin-top: 0.8rem;
}

.faq .body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Callout / Notice */
.note,
.callout {
  display: flex;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 1.15rem 1.3rem;
  font-size: 0.94rem;
  color: var(--text-sec);
  margin-top: 1.75rem;
}

.note svg,
.callout svg {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: var(--accent);
}

.note b,
.callout b {
  color: var(--text);
  font-weight: 600;
}

.note p,
.callout p {
  margin: 0;
  color: inherit;
}

/* Footer navigation */
.pagefoot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--divider);
}

.pagefoot .spacer {
  flex: 1;
}

/* Clean restrained art framing for sub-pages when rectangular artwork is shown */
.banner-art {
  width: 100%;
  height: auto;
  aspect-ratio: 14 / 5;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--divider);
  margin: 1.75rem 0 1rem;
}

@media (max-width: 760px) {
  .banner-art {
    max-height: 140px;
    margin: 1.25rem 0 0.85rem;
  }
}

/* RTL adjustments — natural Arabic rhythm with zero tracked letters */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', 'Figtree', system-ui, sans-serif;
  letter-spacing: 0;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  letter-spacing: 0;
  line-height: 1.35;
}

[dir="rtl"] .back svg,
[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

[dir="rtl"] .mono,
[dir="rtl"] .sha-box {
  direction: ltr;
  unicode-bidi: isolate;
}
