/*
  MØFAS sub-pages (products, support, privacy): the same look as the home page.
  Stone ground, near-black ink, one blue accent; Mona Sans for Latin, the system's TC face for Han.
  Plain CSS with no script, so a page opened straight from the disk looks the same as the live site.
*/
:root {
  --bg: #dfdedb; --surface: #d3d2ce; --card: #ecebe8; --ink: #26251e; --muted: #5a5850;
  --line: rgb(38 37 30 / .12); --line-strong: rgb(38 37 30 / .24);
  --accent: #2456d6; --accent-ink: #fff;
  --inv-bg: #26251e; --inv-ink: #dfdedb; --inv-muted: #a3a29c;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --font: "Mona Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --nav: 72px; --gut: 80px;
}
@media (max-width: 1023px) { :root { --gut: 48px; } }
@media (max-width: 639px) { :root { --gut: 24px; --nav: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: calc(var(--nav) + 16px); -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; word-break: keep-all; overflow-wrap: anywhere; color: var(--ink); }

.container { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; }

.skip-link { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); text-decoration: none; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* header: fixed, opaque, one hairline; the logo on the left line, the main action on the right */
.site-header { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--nav); background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .nav { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 500 22px/1 var(--font); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.brand img { width: 24px; height: 24px; border-radius: 6px; }
.subpage-nav { display: flex; align-items: center; gap: 28px; margin-left: 48px; }
.subpage-nav a { position: relative; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.subpage-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.subpage-nav a:hover::after { transform: scaleX(1); }
.nav-cta { margin-left: auto; }

/* buttons: one filled main action, one outlined secondary */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 24px; border-radius: var(--r-sm);
  font: 500 16px/1 var(--font); text-decoration: none; white-space: nowrap; border: 1px solid transparent; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: #1d49bd; }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--ink); }

/* the page */
.document-main { padding: calc(var(--nav) + 96px) 0 128px; }
.document-hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 24px 48px; align-items: start; margin-bottom: 96px; }
.document-hero > * { min-width: 0; }
.document-hero--plain { display: block; max-width: 860px; margin-bottom: 64px; }
.document-kicker { margin: 0 0 16px; color: var(--muted); font: 500 13px/1.4 var(--mono); letter-spacing: .02em; }
.document-hero h1 { margin: 0; font-size: clamp(38px, 2.6vw + 22px, 64px); line-height: 1.08; letter-spacing: -0.03em; }
.document-lead { max-width: 62ch; margin: 24px 0 0; font-size: 20px; line-height: 1.6; }
.policy-date { margin: 16px 0 0; color: var(--muted); font: 400 14px/1.5 var(--mono); }
.document-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.document-meta span { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--muted); font: 500 13px/1.5 var(--mono); }
.document-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* the product's own screens on the lit ground, as on the home page */
.document-visual { padding: 32px; border-radius: var(--r-lg);
  background: radial-gradient(70% 60% at 18% 12%, #f2efe8, transparent 70%), #d9cdb5; }
.document-visual img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); box-shadow: 0 0 0 1px rgb(0 0 0 / .08), 0 18px 40px -20px rgb(0 0 0 / .45); }
.document-visual-grid { display: grid; gap: 16px; }

/* sections: one card style, two across */
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.document-section { min-width: 0; padding: 40px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.document-section--wide { grid-column: 1 / -1; }
.document-section h2 { margin: 0 0 16px; font-size: 28px; line-height: 1.25; }
.document-section h3 { margin: 28px 0 8px; font-size: 20px; line-height: 1.4; }
.document-section h2 + h3 { margin-top: 0; }
.document-section p, .document-section li { max-width: 72ch; margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; line-height: 1.75; }
.document-section p + p, .document-section p + ul, .document-section p + ol, .document-section ul + p, .document-section ol + p { margin-top: 12px; }
.document-section ul, .document-section ol { margin: 0; padding-left: 22px; }
.document-section li + li { margin-top: 8px; }
.document-section li::marker { color: var(--muted); }
.document-section a:not(.button) { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.document-section strong { font-weight: 500; }
code { padding: 1px 6px; border-radius: 4px; background: rgb(38 37 30 / .08); font: 400 .875em/1.5 var(--mono); overflow-wrap: anywhere; }
.document-note { margin-top: 20px !important; padding: 16px 20px; border-left: 2px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--bg); color: var(--ink); }

/* footer: the dark band the home page ends on */
.site-footer { background: var(--inv-bg); color: var(--inv-ink); padding: 64px 0 48px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer-inner p { margin: 0; color: var(--inv-muted); font-size: 14px; }
.footer-inner .brand { margin-right: auto; color: var(--inv-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--inv-ink); font-size: 14px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* click a screenshot to see it whole (image-viewer.js) */
.zoomable { cursor: zoom-in; }
.image-viewer-open, .image-viewer-open body { overflow: hidden; }
.image-viewer { position: fixed; z-index: 400; inset: 0; display: flex; align-items: center; justify-content: center; padding: 64px 24px 24px; background: rgb(20 19 15 / .92); cursor: zoom-out; opacity: 0; transition: opacity .3s ease; }
.image-viewer.open { opacity: 1; }
.image-viewer.closing { transition-duration: .25s; }
.image-viewer[hidden] { display: none; }
.image-viewer-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; justify-content: center; transform: translate(var(--from-x, 0px), var(--from-y, 0px)) scale(.9); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.image-viewer.open .image-viewer-figure { transform: none; }
.image-viewer.closing .image-viewer-figure { transition-duration: .25s; transition-timing-function: ease-in; }
.image-viewer-figure img { display: block; max-width: min(1600px, 100%); max-height: calc(100svh - 96px); width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 24px 60px rgb(0 0 0 / .55); cursor: default; }
.image-viewer-figure figcaption { display: none; }
.image-viewer-close { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; color: #fff; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .25); border-radius: var(--r-sm); font-size: 28px; line-height: 1; cursor: pointer; }
.image-viewer-close:hover { background: rgb(255 255 255 / .2); }

@media (prefers-reduced-motion: reduce) {
  .button, .subpage-nav a::after, .image-viewer, .image-viewer-figure { transition: none; }
  .button:hover, .button:active, .image-viewer-figure { transform: none; }
}

/* tablet: the hero stacks, words first */
@media (max-width: 1023px) {
  .document-hero { grid-template-columns: 1fr; gap: 48px; margin-bottom: 64px; }
  .document-visual { padding: 24px; }
  .subpage-nav { margin-left: 16px; gap: 20px; }
}
/* phone: one column; the bar keeps the logo and the page links, the main action moves to the page */
@media (max-width: 639px) {
  .site-header .nav { gap: 16px; }
  .brand { font-size: 20px; }
  .subpage-nav { margin-left: auto; gap: 16px; }
  .subpage-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
  .nav-cta { display: none; }
  .document-main { padding: calc(var(--nav) + 48px) 0 96px; }
  .document-hero--plain { margin-bottom: 40px; }
  .document-lead { font-size: 18px; }
  .document-actions .button { flex: 1 1 100%; }
  .document-visual { padding: 16px; border-radius: 16px; }
  .document-grid { grid-template-columns: 1fr; gap: 16px; }
  .document-section { padding: 24px; border-radius: 16px; }
  .document-section h2 { font-size: 24px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .image-viewer { padding: 64px 8px 12px; }
}
