/* ── /features: the page is a board ──────────────────────────────────────
   Each feature is a key, sized as big as the feature is. The regions are the
   phone's own (the buttons, the rail, the controls, the keyboard) plus the PC,
   each a module that wears the chosen look through the generated skin tokens
   ([data-skin] in moard.css). Beside the board, a real picture of the phone
   (or the PC) highlights where a pressed key
   lives. `features_page.py` writes the markup from `features.json`. */
.features-page { --fx-gap: clamp(10px, 1vw, 14px); --fx-panel: clamp(300px, 27vw, 420px); background: var(--moard-ground-sunk); }
.features-page main { padding: 0; }
.fx { position: relative; padding: 132px clamp(16px, 3.4vw, 56px) 0; color: var(--moard-ink);
  background: var(--moard-ground-sunk); }

.fx-top { display: grid; justify-items: center; max-width: 1180px; margin: 0 auto; text-align: center; }
.launch .fx-title { display: inline-flex; align-items: center; gap: .3em; margin: 0; font-size: clamp(44px, 5.4vw, 84px); line-height: 1; font-weight: 800; letter-spacing: -.045em; }

.launch .fx-say { max-width: 52ch; margin: 12px auto 0; color: var(--moard-ink); font-size: clamp(17px, 1.4vw, 21px); line-height: 1.5; text-wrap: balance; }
.fx-looks { width: 100%; scroll-margin-top: 24px; }
.fx-looks summary { width: fit-content; margin: auto; padding: 10px 4px; min-height: 44px; color: var(--moard-ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.launch .fx-legend { margin: 12px 0 0; color: var(--moard-ink-dim); font-size: 13px; }
.fx-legend b { color: var(--moard-ink); font-weight: 750; }

/* ── The looks: each chip is a corner of a real key in that look ─────────── */
.look-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; max-width: 1400px; margin-inline: auto; }
.look-chip { display: grid; justify-items: center; align-content: start; gap: 5px; width: 62px; padding: 0 0 2px; border: 0; background: none; color: var(--moard-ink-dim); font: 650 11.5px/1.2 var(--site-font); cursor: pointer; }
.look-chip::before { content: ""; display: block; width: 62px; height: 31px; border-radius: 6px; background: url('/assets/feature-look-chips.webp') 0 0 / calc(var(--chips) * 100%) 100% no-repeat; box-shadow: 0 0 0 1px var(--moard-hairline); transition: transform 140ms, box-shadow 140ms; }
.look-chips { --chips: 19; }
.look-chip--0::before { background-position-x: 0%; } .look-chip--1::before { background-position-x: calc(1 / 18 * 100%); }
.look-chip--2::before { background-position-x: calc(2 / 18 * 100%); } .look-chip--3::before { background-position-x: calc(3 / 18 * 100%); }
.look-chip--4::before { background-position-x: calc(4 / 18 * 100%); } .look-chip--5::before { background-position-x: calc(5 / 18 * 100%); }
.look-chip--6::before { background-position-x: calc(6 / 18 * 100%); } .look-chip--7::before { background-position-x: calc(7 / 18 * 100%); }
.look-chip--8::before { background-position-x: calc(8 / 18 * 100%); } .look-chip--9::before { background-position-x: calc(9 / 18 * 100%); }
.look-chip--10::before { background-position-x: calc(10 / 18 * 100%); } .look-chip--11::before { background-position-x: calc(11 / 18 * 100%); }
.look-chip--12::before { background-position-x: calc(12 / 18 * 100%); } .look-chip--13::before { background-position-x: calc(13 / 18 * 100%); }
.look-chip--14::before { background-position-x: calc(14 / 18 * 100%); } .look-chip--15::before { background-position-x: calc(15 / 18 * 100%); }
.look-chip--16::before { background-position-x: calc(16 / 18 * 100%); } .look-chip--17::before { background-position-x: calc(17 / 18 * 100%); }
.look-chip--18::before { background-position-x: 100%; }
.look-chip__plan { color: var(--moard-ink-dim); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.look-chip:hover::before { transform: translateY(-2px); }
.look-chip:active::before { transform: translateY(1px); }
.look-chip[aria-pressed=true] { color: var(--moard-ink); }
.look-chip[aria-pressed=true]::before { box-shadow: 0 0 0 2px var(--moard-ground-sunk), 0 0 0 4px var(--moard-intent); }

/* ── The opener: a cut of the launch film, the keys re-forming as the PC's app changes ──
   It plays muted and loops only when motion is welcome; its button pauses it. */
.fx-film { position: relative; max-width: 1680px; margin: 34px auto 0; overflow: hidden; border-radius: 18px; background: var(--moard-ground-sunk); box-shadow: 0 0 0 1px var(--moard-hairline); }
.fx-film video { display: block; width: 100%; height: clamp(240px, 34vw, 520px); object-fit: cover; object-position: 58% 55%; }
.fx-film__toggle { position: absolute; right: 14px; bottom: 14px; min-height: 40px; padding: 0 14px; border: 1px solid var(--moard-hairline); border-radius: 999px; background: color-mix(in srgb, var(--moard-ground-sunk) 80%, transparent); color: var(--moard-ink); font: 650 13px var(--site-font); cursor: pointer; }
.fx-film__toggle:hover { border-color: var(--moard-intent); }
.fx-under { display: grid; justify-items: center; gap: 4px; max-width: 1180px; margin: 18px auto 0; text-align: center; }
.fkey__art { width: 48px; height: 48px; margin: -4px 0 2px -4px; }
.fkey-cell--l .fkey__art { width: 64px; height: 64px; margin: 0 0 auto -4px; }
.fx-close__art { display: block; width: min(100%, 720px); height: auto; margin: 0 auto 28px; border-radius: 16px; box-shadow: 0 0 0 1px var(--moard-hairline); }

/* ── The board and the phone beside it ──────────────────────────────────── */
.fx-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--fx-panel); align-items: start; gap: clamp(20px, 2.6vw, 44px); max-width: 1680px; margin: 32px auto 0; }
.fx-board { display: grid; grid-template-columns: minmax(0, 1fr) clamp(118px, 10vw, 160px); grid-template-areas: "top top" "buttons rail" "controls controls" "keyboard keyboard" "pc pc" "link link"; gap: 34px var(--fx-gap); min-width: 0; }
.fx-region { min-width: 0; }
.fx-region--top { grid-area: top; } .fx-region--link { grid-area: link; }
.fx-region--buttons { grid-area: buttons; } .fx-region--rail { grid-area: rail; }
.fx-region--controls { grid-area: controls; } .fx-region--keyboard { grid-area: keyboard; } .fx-region--pc { grid-area: pc; }
/* A region's name is printed on the panel's edge, the way a module's legend is. */
.launch .fx-region__name { margin: 0 0 10px; color: var(--moard-ink-dim); font: 650 14px/1.3 var(--site-font); }
.fx-region__guide { margin: 0 0 14px; font-size: .875rem; }
.fx-region__guide a { text-underline-offset: .18em; }
.fx-keys { display: grid; gap: var(--fx-gap); margin: 0; padding: var(--fx-gap); list-style: none; border-radius: calc(var(--moard-skin-radius) + 10px); background: var(--moard-skin-background); box-shadow: 0 0 0 1px color-mix(in srgb, var(--moard-skin-border) 45%, transparent), 0 30px 60px color-mix(in srgb, var(--moard-ground-sunk) 70%, transparent); transition: background 260ms; }
.fx-keys--buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); grid-auto-flow: dense; }
.fx-keys--rail { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(92px, auto); }
.fx-keys--pc, .fx-keys--link { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); grid-auto-flow: dense; }
.fx-keys--top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fx-keys--keyboard { grid-template-columns: repeat(10, minmax(0, 1fr)); grid-auto-rows: minmax(84px, auto); grid-auto-flow: dense; }
/* The controls stand where the phone puts them: three keys, the touchpad, and four small ones. */
.fx-keys--controls { grid-template-columns: 1.15fr 1.7fr 1fr 1fr; grid-template-areas: "menu pad talk talk" "camera pad back right" "keys pad paste copy"; grid-auto-rows: minmax(96px, auto); }
.fx-keys--controls > :nth-child(1) { grid-area: menu; } .fx-keys--controls > :nth-child(2) { grid-area: camera; }
.fx-keys--controls > :nth-child(3) { grid-area: keys; } .fx-keys--controls > :nth-child(4) { grid-area: pad; }
.fx-keys--controls > :nth-child(5) { grid-area: talk; } .fx-keys--controls > :nth-child(6) { grid-area: back; }
.fx-keys--controls > :nth-child(7) { grid-area: right; } .fx-keys--controls > :nth-child(8) { grid-area: paste; }
.fx-keys--controls > :nth-child(9) { grid-area: copy; }
.fkey-cell { display: grid; min-width: 0; }
.fkey-cell--l { grid-column: span 2; grid-row: span 2; }
.fkey-cell--w { grid-column: span 2; }
.fkey-cell--t { grid-row: span 2; }
.fx-keys--keyboard .fkey-cell { grid-column: span 2; }
.fx-keys--keyboard .fkey-cell--w { grid-column: span 4; }

/* ── A key ──────────────────────────────────────────────────────────────── */
.fkey { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 7px; width: 100%; min-width: 0; padding: 14px 14px 24px; border: var(--moard-skin-border-width) solid var(--moard-skin-border); border-radius: calc(var(--moard-skin-radius) * 1.4 + 2px); background: var(--moard-skin-fill); color: var(--moard-skin-ink); text-align: left; cursor: pointer; box-shadow: 0 3px 0 color-mix(in srgb, var(--moard-skin-background) 70%, var(--moard-ground-sunk)); transition: transform 110ms, box-shadow 110ms, background 260ms, color 260ms, border-color 260ms; }

.fkey__legend { max-width: 100%; font: 750 clamp(14px, 1.05vw, 16px)/1.15 var(--moard-skin-face); letter-spacing: .03em; text-transform: var(--moard-skin-legend-case); overflow-wrap: break-word; hyphens: manual; }
.fkey__line { font: 500 13.5px/1.42 var(--site-font); opacity: .86; text-wrap: pretty; }
/* Once the panel works, a medium key shows its name only: the board reads at a glance, and pressing
   a key says the rest beside the phone. Large and wide keys keep their line; without the script, all do. */
.fx[data-ready] .fkey-cell--m .fkey__line { display: none; }
.fx[data-ready] .fx-keys--buttons, .fx[data-ready] .fx-keys--pc, .fx[data-ready] .fx-keys--link { grid-auto-rows: minmax(84px, auto); }
.fx[data-ready] .fx-keys--rail { grid-auto-rows: minmax(64px, auto); }
.fx[data-ready] .fx-keys--keyboard { grid-auto-rows: minmax(60px, auto); }
.fx[data-ready] .fx-keys--controls { grid-auto-rows: minmax(70px, auto); }
.fkey__head { display: block; width: 100%; }
.fkey__plan { float: right; margin: 1px 0 4px 8px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--moard-skin-accent) 18%, transparent); color: var(--moard-skin-ink); font: 750 10px/1.3 var(--site-font); letter-spacing: .08em; text-transform: uppercase; }
.fkey-cell--l .fkey { justify-content: flex-end; padding: 20px 20px 30px; }
.fkey-cell--l .fkey__plan { position: absolute; top: 14px; right: 14px; margin: 0; }
.fkey-cell--l .fkey__legend { font-size: clamp(22px, 2vw, 32px); letter-spacing: .01em; }
.fkey-cell--l .fkey__line { max-width: 34ch; font-size: 15px; }
.fkey-cell--w .fkey__legend, .fkey-cell--t .fkey__legend { font-size: clamp(16px, 1.3vw, 20px); }
.fx-keys--keyboard .fkey { padding: 11px 11px 20px; gap: 5px; }
.fx-keys--keyboard .fkey__legend { font-size: 13.5px; }
.fx-keys--keyboard .fkey__line { font-size: 12.5px; }
.fx-keys--rail .fkey { align-items: center; text-align: center; padding: 12px 8px 22px; }
.fx-keys--rail .fkey__line { font-size: 12px; }
.fx-keys--rail .fkey__plan { float: none; display: table; margin: 0 auto 5px; }
.fkey:hover { transform: translateY(-1px); }
.fkey:active, .fkey[aria-pressed=true] { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--moard-skin-background) 70%, var(--moard-ground-sunk)); }
.fkey[aria-pressed=true] { box-shadow: 0 0 0 2px var(--moard-skin-accent); }

.launch .fkey:focus-visible { outline: var(--moard-stroke-focus) solid var(--moard-focus); outline-offset: 3px; }

/* ── The phone (or the PC) beside the board ─────────────────────────────── */
.fx-panel { position: sticky; top: 20px; display: grid; justify-items: center; gap: 14px; max-height: calc(100svh - 40px); }
.fx-panel:focus { outline: none; }
.fx-device { --device-h: min(calc(100svh - 300px), 640px); position: relative; padding: 9px; border-radius: 34px; background: color-mix(in srgb, var(--moard-ground-sunk) 80%, var(--moard-ink) 6%); box-shadow: 0 0 0 1px var(--moard-hairline), 0 40px 80px color-mix(in srgb, var(--moard-ground-sunk) 85%, transparent); transition: border-radius 240ms; }
.fx-screen { position: relative; overflow: hidden; height: var(--device-h); max-width: calc(var(--fx-panel) - 18px); aspect-ratio: 363 / 804; border-radius: 26px; background: var(--moard-ground-sunk); }
.fx-device--pc { padding: 7px; border-radius: 12px; }
.fx-device--pc .fx-screen { height: auto; width: calc(var(--fx-panel) - 14px); aspect-ratio: 1600 / 907; border-radius: 6px; }
.fx-zoom { position: absolute; inset: 0; transform-origin: 0 0; transition: transform 520ms cubic-bezier(.2, .8, .2, 1); }
.fx-zoom img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fx-lights { position: absolute; inset: 0; pointer-events: none; }
/* A lit place: Moard's own corners round it, in the mark's amber. */
.fx-light { position: absolute; border-radius: 6px; animation: fx-light-in 300ms cubic-bezier(.2, .8, .2, 1) both; }
.fx-light::before { content: ""; position: absolute; inset: -3px; border: 3px solid var(--moard-intent); border-radius: 8px;
  -webkit-mask-image: linear-gradient(to right, var(--moard-ink) 14px, transparent 14px calc(100% - 14px), var(--moard-ink) calc(100% - 14px)), linear-gradient(to bottom, var(--moard-ink) 14px, transparent 14px calc(100% - 14px), var(--moard-ink) calc(100% - 14px));
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, var(--moard-ink) 14px, transparent 14px calc(100% - 14px), var(--moard-ink) calc(100% - 14px)), linear-gradient(to bottom, var(--moard-ink) 14px, transparent 14px calc(100% - 14px), var(--moard-ink) calc(100% - 14px));
  mask-composite: intersect; }
@keyframes fx-light-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
.fx-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: var(--fx-panel); }
.fx-tab { min-height: 32px; padding: 5px 9px; border: 1px solid var(--moard-hairline); border-radius: 999px; background: none; color: var(--moard-ink-dim); font: 650 12px var(--site-font); cursor: pointer; }
.fx-tab[aria-pressed=true] { border-color: var(--moard-intent); color: var(--moard-ink); }

.fx-readout { width: 100%; max-width: var(--fx-panel); min-height: 9.5em; }
.launch .fx-readout__name { margin: 0; color: var(--moard-ink); font: 800 19px/1.3 var(--site-font); letter-spacing: -.01em; }
.fx-readout__name .fx-readout__plan { margin-left: 8px; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--moard-intent) 20%, transparent); color: var(--moard-intent); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; vertical-align: 3px; }
.launch .fx-readout__text p { margin: 8px 0 0; color: var(--moard-ink); font-size: 15px; line-height: 1.58; }
.launch .fx-readout__more { margin: 12px 0 0; font-size: 14px; }
.fx-readout__more a { display: inline-flex; gap: 8px; min-height: 44px; align-items: center; color: var(--moard-ink); text-decoration: none; border-bottom: 1px solid var(--moard-intent); }
.fx-readout__more a:hover { color: var(--moard-intent); }
.fx-panel__close { display: none; }

/* ── The close ──────────────────────────────────────────────────────────── */
.fx-close { display: grid; justify-items: center; max-width: 760px; margin: 0 auto; padding: 110px 0 96px; text-align: center; }
.launch .fx-close h2 { font-size: clamp(32px, 4vw, 60px); letter-spacing: -.035em; }
.launch .fx-close p { max-width: 54ch; margin: 16px auto 0; color: var(--moard-ink); font-size: 16px; text-wrap: balance; }
.fx-close__acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 28px; margin-top: 30px; }
.fx-get { display: inline-flex; align-items: center; min-height: 50px; padding: 14px 30px; border: 1px solid var(--moard-intent); border-bottom: 4px solid var(--moard-intent-deep); border-radius: 8px; background: var(--moard-intent); color: var(--moard-ground-sunk); font: 750 15px var(--site-font); text-decoration: none; }
.fx-get:hover { background: var(--moard-ink); border-color: var(--moard-ink); }
.fx-get:active { transform: translateY(2px); }
.fx-pricing { display: inline-flex; align-items: center; min-height: 44px; color: var(--moard-ink); font-size: 15px; text-decoration: none; border-bottom: 1px solid var(--moard-intent); }
.fx-pricing:hover { color: var(--moard-intent); }

/* ── Narrower: the phone becomes a sheet that rises when a key is pressed ── */
@media (max-width: 1099px) {
  .fx-layout { grid-template-columns: minmax(0, 1fr); }
  .fx-panel { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "close close" "device tabs" "device readout"; grid-template-rows: auto auto 1fr; align-items: start; justify-items: start; gap: 4px 18px; max-height: 78svh; padding: 18px clamp(16px, 4vw, 32px) 22px; overflow: auto; border-top: 1px solid var(--moard-hairline); border-radius: 18px 18px 0 0; background: var(--moard-ground-sunk); box-shadow: 0 -30px 60px color-mix(in srgb, var(--moard-ground-sunk) 90%, transparent); transform: translateY(105%); visibility: hidden; transition: transform 300ms cubic-bezier(.2, .8, .2, 1), visibility 0s 300ms; }
  .fx-panel.is-open { transform: none; visibility: visible; transition: transform 300ms cubic-bezier(.2, .8, .2, 1); }
  .fx-device { --device-h: min(52svh, 420px); grid-area: device; }
  .fx-device--pc .fx-screen { width: min(56vw, 460px); }
  .fx-tabs { grid-area: tabs; justify-content: flex-start; }
  .fx-readout { grid-area: readout; min-height: 0; }
  .fx-panel__close { position: sticky; top: 0; z-index: 2; grid-area: close; justify-self: end; display: inline-flex; align-items: center; min-height: 44px; margin: -8px -6px -40px 0; padding: 0 16px; border: 1px solid var(--moard-hairline); border-radius: 999px; background: var(--moard-ground-sunk); color: var(--moard-ink); font: 650 14px var(--site-font); cursor: pointer; }
  .fx-panel__close[hidden] { display: none; }
}
@media (max-width: 899px) {
  .fx-board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "buttons" "rail" "controls" "keyboard" "pc" "link"; }
  .fx-keys--rail { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(84px, auto); }
}
@media (max-width: 699px) {
  .fx { padding-top: 132px; padding-inline: 12px; }
  .features-page .fx { padding-top: 24px; }
  .launch.features-page .site-header { position: relative; height: auto; min-height: 112px; background: var(--moard-ground-sunk); }
  .look-chips { flex-wrap: nowrap; justify-content: flex-start; width: calc(100% + 24px); margin-inline: -12px; padding: 4px 12px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .look-chip { flex: 0 0 auto; scroll-snap-align: start; }
  .fx-layout { margin-top: 30px; }
  .fx-keys { padding: 8px; gap: 8px; }
  .fx-keys--buttons, .fx-keys--pc, .fx-keys--link, .fx-keys--top { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(104px, auto); }
  .fx-keys--top .fkey-cell--w { grid-column: span 1; }
  .fkey-cell--l { grid-row: span 1; }
  .fkey-cell--l .fkey { justify-content: flex-start; padding: 16px 16px 28px; }
  .fkey-cell--t { grid-row: span 1; }
  .fx-keys--rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-keys--rail > :last-child:nth-child(odd) { grid-column: span 2; }
  .fx-keys--controls { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "pad pad" "menu talk" "camera keys" "back right" "paste copy"; }
  .fx-keys--keyboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-keys--keyboard .fkey-cell, .fx-keys--keyboard .fkey-cell--w { grid-column: span 1; }
  .fkey { padding: 12px 12px 22px; }
  .fkey__line { font-size: 13px; }
  .fx-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "close" "device" "tabs" "readout"; grid-template-rows: auto; justify-items: center; max-height: 86svh; padding-top: 14px; }
  .fx-device { --device-h: min(46svh, 380px); }
  .fx-device--pc .fx-screen { width: calc(100vw - 48px); }
  .fx-tabs { justify-content: center; }
  .fx-close { padding: 80px 8px 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-zoom, .fx-panel, .fkey, .fx-keys { transition: none !important; }
  .fx-light { animation: none; }
}
