/* HoneyCrisp manual — builds on styles.css tokens */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.m-layout {
  max-width: 1240px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: start;
}

/* ── Sidebar contents ── */
.m-side { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); padding-top: 28px; max-height: calc(100vh - 100px); overflow: auto; scrollbar-width: thin; }
.m-toc summary {
  list-style: none; cursor: pointer;
  font: 600 .95rem/1 var(--f-display); color: var(--frost);
  padding: 0 0 14px;
}
.m-toc summary::-webkit-details-marker { display: none; }

.m-search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; margin-bottom: 14px; border-radius: 12px;
  background: rgba(19, 27, 69, 0.8); box-shadow: inset 0 0 0 1px var(--line);
}
.m-search:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 179, 0, 0.6); }
.m-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--mist); stroke-width: 2; stroke-linecap: round; }
.m-search input {
  flex: 1; min-width: 0; min-height: 42px; border: 0; background: none; outline: none;
  color: var(--frost); font: 500 .95rem/1.2 var(--f-body);
}
.m-search input::placeholder { color: rgba(167, 178, 228, 0.7); }

.m-toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.m-toc__list li { counter-increment: toc; }
.m-toc__list a {
  display: grid; grid-template-columns: 26px 1fr; align-items: baseline;
  padding: 7px 10px; border-radius: 10px;
  color: var(--mist); text-decoration: none; font-size: .95rem; line-height: 1.35;
  transition: color .15s ease, background .15s ease;
}
.m-toc__list a::before { content: counter(toc); font: 600 .75rem/1 var(--f-display); color: rgba(136, 161, 255, 0.6); }
.m-toc__list a:hover { color: var(--frost); background: rgba(136, 161, 255, 0.08); }
.m-toc__list a[aria-current="true"] { color: var(--frost); background: rgba(255, 90, 60, 0.12); box-shadow: inset 2px 0 0 var(--crisp); }
.m-toc__list a[aria-current="true"]::before { color: var(--gold); }
.m-toc__list li[hidden] { display: none; }
.m-noresults { margin: 10px 0 0; color: var(--mist); font-size: .9rem; }

/* ── Main column ── */
.m-main { min-width: 0; padding-bottom: 40px; }
.m-hero { padding: clamp(28px, 7vh, 72px) 0 12px; max-width: 40rem; }
.m-hero h1 {
  margin: 0 0 .8rem;
  font: 600 clamp(2.2rem, 5vw, 3.6rem)/1 var(--f-display); letter-spacing: -0.035em;
  background: var(--crisp-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.m-hero p { margin: 0; color: var(--mist); font-size: 1.1rem; }

.m-sec { padding-top: clamp(40px, 7vh, 72px); scroll-margin-top: 90px; }
.m-sec[hidden] { display: none; }
.m-sec > h2 {
  margin: 0 0 1.2rem; padding-bottom: .8rem;
  font: 600 clamp(1.5rem, 3vw, 2.1rem)/1.15 var(--f-display); letter-spacing: -0.025em;
  border-bottom: 1px solid var(--line);
}
.m-lede { margin: 0 0 1.6rem; color: var(--mist); max-width: 44rem; }

.m-topic { max-width: 44rem; margin-bottom: 1.8rem; scroll-margin-top: 90px; }
.m-topic[hidden] { display: none; }
.m-topic h3 { margin: 0 0 .5rem; font: 600 1.08rem/1.3 var(--f-display); letter-spacing: -0.01em; }
.m-topic p { margin: 0 0 .8rem; color: var(--mist); }
.m-topic a:not(.m-try):not(.btn) { color: var(--frost); text-decoration-color: rgba(255, 179, 0, 0.6); text-underline-offset: 3px; }
.m-topic strong { color: var(--frost); font-weight: 600; }
.m-note { font-size: .92rem; padding-left: 12px; box-shadow: inset 2px 0 0 rgba(0, 229, 255, 0.4); }

.m-list, .m-steps { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--mist); }
.m-list li, .m-steps li { margin: .35rem 0; padding-left: .2rem; }
.m-steps li::marker { color: var(--gold); font-weight: 700; }
.m-list li::marker { color: var(--crisp); }

.m-defs { display: grid; gap: 10px; margin: 0 0 1rem; }
.m-defs div { padding: 12px 16px; border-radius: 14px; background: var(--plate); box-shadow: inset 0 0 0 1px var(--line); }
.m-defs dt { font-weight: 600; color: var(--frost); }
.m-defs dd { margin: 2px 0 0; color: var(--mist); }

.m-try {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px; margin-top: .2rem;
  border-radius: 999px; text-decoration: none;
  font: 700 .9rem/1 var(--f-body); color: #22060B; background: var(--crisp-grad);
  box-shadow: 0 8px 22px -10px rgba(255, 59, 78, 0.7);
}
.m-try::before { content: ""; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.m-try:hover { transform: translateY(-1px); }

/* ── Home-screen map ── */
.m-map { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: center; margin: 0 0 2rem; max-width: 44rem; }
.m-map svg { width: 100%; height: auto; }
.m-map__phone { fill: rgba(10, 14, 36, 0.8); stroke: rgba(136, 161, 255, 0.35); stroke-width: 1.5; }
.m-map__globe, .m-map__line { fill: none; stroke: var(--moon); stroke-width: 1.3; opacity: .7; }
.m-map__dock { fill: rgba(60, 72, 150, 0.35); stroke: rgba(136, 161, 255, 0.4); }
.m-map__gem { fill: rgba(136, 161, 255, 0.55); }
.m-map__gem--orb { fill: var(--gold); }
.m-map__orb { fill: none; stroke: var(--hud); stroke-width: 1.5; }
.m-map__wing { fill: rgba(0, 229, 255, 0.08); stroke: rgba(0, 229, 255, 0.5); }
.m-map__tags text { font: 700 13px var(--f-display); fill: var(--gold); }
.m-legend { margin: 0; padding-left: 1.3rem; color: var(--mist); }
.m-legend li { margin: 0 0 .7rem; }
.m-legend li::marker { color: var(--gold); font: 700 .9rem var(--f-display); }
.m-legend strong { color: var(--frost); }

/* ── Gesture cards ── */
.m-gestures { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 2.2rem; }
.m-g {
  margin: 0; max-width: none; padding: 18px;
  border-radius: 20px; background: var(--plate); box-shadow: inset 0 0 0 1px var(--line);
}
.m-g:target { box-shadow: inset 0 0 0 1px rgba(255, 179, 0, 0.6); }
.m-g h3 { font-size: 1rem; }
.m-g p { font-size: .95rem; margin: 0; }
.m-g__art { width: 64px; height: 96px; margin-bottom: 12px; overflow: visible; }

.m-g__art .ph { fill: rgba(8, 12, 32, 0.7); stroke: rgba(136, 161, 255, 0.4); stroke-width: 1.4; }
.m-g__art .app { fill: rgba(136, 161, 255, 0.35); }
.m-g__art .finger { fill: rgba(255, 179, 0, 0.9); }
.m-g__art .ring { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.m-g__art .sheet { fill: rgba(136, 161, 255, 0.22); stroke: rgba(136, 161, 255, 0.5); }
.m-g__art .half { fill: rgba(136, 161, 255, 0.4); }
.m-g__art .homebar { fill: var(--gold); }
.m-g__art .bar { fill: rgba(233, 237, 255, 0.25); }
.m-g__art .arc, .m-g__art .arc-head { fill: none; stroke: var(--moon); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.m-g__art .stroke { fill: none; stroke: var(--gold); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.m-g__art .letters text { font: 700 9px var(--f-display); fill: rgba(233, 237, 255, 0.55); }

/* Gesture animations — each loops once every ~2.4s */
.g-tap { transform-box: fill-box; transform-origin: center; animation: g-tap 2.4s ease-in-out infinite; }
@keyframes g-tap { 0%, 60%, 100% { transform: scale(1); opacity: 1; } 30% { transform: scale(.7); opacity: .6; } }

.g-hold { transform-box: fill-box; transform-origin: center; animation: g-hold 2.4s ease-out infinite; }
@keyframes g-hold { 0% { transform: scale(.8); opacity: 0; } 20% { opacity: 1; } 70%, 100% { transform: scale(2.4); opacity: 0; } }

.g-pop { transform-box: fill-box; transform-origin: bottom center; animation: g-pop 2.4s ease-out infinite; }
@keyframes g-pop { 0%, 35% { transform: scale(.4); opacity: 0; } 55%, 90% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }

.g-split-top { animation: g-split-top 2.4s ease-in-out infinite; }
.g-split-bot { animation: g-split-bot 2.4s ease-in-out infinite; }
@keyframes g-split-top { 0%, 25% { transform: translateY(0); } 55%, 85% { transform: translateY(-30px); } 100% { transform: translateY(0); } }
@keyframes g-split-bot { 0%, 25% { transform: translateY(0); } 55%, 85% { transform: translateY(30px); } 100% { transform: translateY(0); } }

.g-up { animation: g-up 2.4s ease-in-out infinite; }
@keyframes g-up { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 65% { transform: translateY(-46px); opacity: 1; } 80%, 100% { transform: translateY(-46px); opacity: 0; } }

.g-twist { transform-origin: 40px 60px; animation: g-twist 2.4s ease-in-out infinite; }
@keyframes g-twist { 0%, 15% { transform: rotate(0); } 65%, 85% { transform: rotate(70deg); } 100% { transform: rotate(0); } }

.g-edge { animation: g-edge 2.4s ease-in-out infinite; }
.g-drawer { transform-box: fill-box; transform-origin: left center; animation: g-drawer 2.4s ease-in-out infinite; }
@keyframes g-edge { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 60%, 85% { transform: translateX(30px); opacity: 1; } 100% { transform: translateX(30px); opacity: 0; } }
@keyframes g-drawer { 0%, 15% { transform: scaleX(0); } 60%, 90% { transform: scaleX(1); } 100% { transform: scaleX(0); } }

.g-letters { animation: g-letters 2.4s ease-in-out infinite; }
@keyframes g-letters { 0%, 20% { transform: translateY(0); } 70%, 90% { transform: translateY(38px); } 100% { transform: translateY(0); } }

.g-draw { stroke-dasharray: 80; stroke-dashoffset: 80; animation: g-draw 2.4s ease-in-out infinite; }
@keyframes g-draw { 0%, 15% { stroke-dashoffset: 80; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* ── Layout cards ── */
.m-layouts { display: grid; gap: 16px; }
.m-lay {
  display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 20px;
  margin: 0; padding: 22px 24px; border-radius: 22px;
  background: var(--plate); box-shadow: inset 0 0 0 1px var(--line);
}
.m-lay__art { width: 80px; height: 80px; fill: none; stroke: var(--moon); stroke-width: 1.4; }
.m-lay__art .dot { fill: var(--gold); stroke: none; }

/* ── Tables ── */
.m-table-wrap { overflow-x: auto; margin: 0 0 1rem; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.m-table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.m-table th, .m-table td { padding: 11px 16px; text-align: left; vertical-align: top; }
.m-table thead th { font: 600 .82rem/1.2 var(--f-body); color: var(--mist); background: rgba(19, 27, 69, 0.9); }
.m-table tbody th { width: 34%; font-weight: 600; color: var(--frost); }
.m-table td { color: var(--mist); }
.m-table tbody tr + tr { border-top: 1px solid var(--line); }
.m-table tbody tr:nth-child(even) { background: rgba(19, 27, 69, 0.35); }

/* ── Closing call-to-action ── */
.m-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px;
  max-width: 44rem; margin-top: 2.4rem; padding: 22px 24px; border-radius: 24px;
  background: radial-gradient(80% 120% at 100% 0%, rgba(255, 59, 78, 0.2), transparent 60%), rgba(19, 27, 69, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 140, 70, 0.3);
}
.m-cta img { width: 72px; height: 72px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5)); }
.m-cta div { flex: 1 1 220px; }
.m-cta h3 { margin: 0 0 .3rem; font: 600 1.05rem/1.3 var(--f-display); }
.m-cta p { margin: 0; color: var(--mist); }

/* ── Phone / tablet ── */
@media (max-width: 899px) {
  .m-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .m-side {
    position: sticky; top: calc(66px + env(safe-area-inset-top, 0px)); z-index: 10;
    max-height: none; overflow: visible; padding: 10px 0;
    background: linear-gradient(180deg, rgba(10, 16, 48, 0.97) 70%, rgba(10, 16, 48, 0));
  }
  .m-toc { border-radius: 16px; background: rgba(19, 27, 69, 0.95); box-shadow: inset 0 0 0 1px var(--line), 0 20px 40px -20px rgba(0, 0, 0, 0.8); }
  .m-toc summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 16px; }
  .m-toc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--mist); border-bottom: 2px solid var(--mist); transform: rotate(45deg); transition: transform .2s; }
  .m-toc[open] summary::after { transform: rotate(-135deg); }
  .m-toc[open] { max-height: 70vh; overflow: auto; padding-bottom: 12px; }
  .m-search, .m-toc__list, .m-noresults { margin-left: 12px; margin-right: 12px; }
  .m-map { grid-template-columns: 1fr; }
  .m-map svg { max-width: 180px; }
  .m-lay { grid-template-columns: 1fr; }
  .m-lay__art { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-tap, .g-hold, .g-pop, .g-split-top, .g-split-bot, .g-up, .g-twist,
  .g-edge, .g-drawer, .g-letters, .g-draw { animation: none !important; }
  .g-draw { stroke-dashoffset: 0; }
  .g-hold { opacity: 1; transform: scale(1.6); }
}
