/* myhabibi.net: shared layout for the landing page and the legal pages. Tokens come from myhabibi-crush.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  background: var(--mh-bg); color: var(--mh-text);
  font-family: var(--mh-font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
main { overflow-x: clip; }
:focus-visible { outline: 2px solid var(--mh-focus); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; }

/* Slow drifting warm and cool glows behind the dark sections: transform only, so it stays cheap. */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--mh-bg); }
.glow i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; top: 10vh; left: 20vw; will-change: transform;
  background: radial-gradient(closest-side, rgba(242,154,74,.26), transparent); animation: orbit 38s linear infinite; }
.glow b { position: absolute; inset: 0; background: var(--mh-grain); opacity: .07; mix-blend-mode: overlay; }
@keyframes orbit { from { transform: rotate(0) translateX(14vmax) rotate(0); } to { transform: rotate(360deg) translateX(14vmax) rotate(-360deg); } }
.glow::before, .glow::after {
  content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  will-change: transform;
}
.glow::before { top: -30vmax; right: -25vmax; background: radial-gradient(closest-side, rgba(196,42,85,.42), transparent); animation: drift-a 26s ease-in-out infinite alternate; }
.glow::after { bottom: -35vmax; left: -30vmax; background: radial-gradient(closest-side, rgba(75,20,170,.42), transparent); animation: drift-b 32s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(-12vmax, 10vmax) scale(1.1); } }
@keyframes drift-b { to { transform: translate(14vmax, -8vmax) scale(1.08); } }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.top { padding: 20px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; }
.top img { display: block; height: 32px; width: auto; }

.foot { padding: 40px 0 48px; color: var(--mh-text-faint); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; border-top: 1px solid var(--mh-line); padding-top: 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; display: inline-block; padding-block: 6px; }
@media (max-width: 759px) { .foot a { padding-block: 11px; } .foot nav { row-gap: 0; } }
.foot a:hover { color: var(--mh-text); text-decoration: underline; }
.foot small { font-size: 13px; margin-inline-start: auto; }
@media (max-width: 640px) { .foot small { margin-inline-start: 0; width: 100%; } }

/* Legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.legal h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.15; font-weight: 600; margin: 24px 0 4px; }
.legal h2 { font-size: 19px; font-weight: 600; margin: 32px 0 6px; }
.legal .meta { color: var(--mh-text-faint); font-size: 14px; margin: 0; }
.legal .note { background: rgba(255,255,255,.05); border: 1px solid var(--mh-line); border-radius: var(--mh-radius-md); padding: 12px 16px; font-size: 15px; margin: 24px 0; color: var(--mh-text-muted); }
.legal p, .legal li { color: var(--mh-text-muted); }
.legal strong { color: var(--mh-text); font-weight: 500; }
.legal li { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) {
  .glow::before, .glow::after, .glow i { animation: none; }
}

/* Skip link: visible only when focused */
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 12px;
  background: #fff; color: var(--mh-ink, #2A1240); font-weight: 600; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* Member guide */
.guide { scroll-behavior: smooth; }
.guide h2[id] { scroll-margin-top: 16px; font-size: 22px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--mh-line); }
.guide a { color: var(--mh-text); }
.guide ol, .guide ul { padding-inline-start: 22px; }
.toc { background: rgba(255,255,255,.05); border: 1px solid var(--mh-line); border-radius: var(--mh-radius-md); padding: 12px 16px; margin: 24px 0; }
.toc ol { margin: 0; }
.toc li { margin: 0; padding: 3px 0; }
.toc a { display: inline-block; padding: 3px 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
