/* HoziBook website — mobile first, system fonts, light & dark.
   Brand colours come from the app icon: cream #F1E7D4, coffee #765439,
   caramel #AF8055. */

:root {
  color-scheme: light dark;
  --bg: #fbf7f0;
  --surface: #fffdf9;
  --surface-2: #f4ecdd;
  --cream: #f1e7d4;
  --text: #2b2118;
  --text-2: #54453a;
  --muted: #6f5f50;
  --primary: #765439;
  --primary-hover: #5f4330;
  --on-primary: #fffaf3;
  --accent: #af8055;
  --accent-soft: #ead9c2;
  --border: #e4d7c4;
  --focus: #9a6a3f;
  --shadow: 0 1px 2px rgb(68 45 25 / 6%), 0 8px 24px -12px rgb(68 45 25 / 18%);
  --shadow-lg: 0 2px 6px rgb(68 45 25 / 6%), 0 24px 48px -24px rgb(68 45 25 / 30%);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1120px;
  --font-sans: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1612;
    --surface: #241d18;
    --surface-2: #2d241d;
    --cream: #3a2e24;
    --text: #f1e8db;
    --text-2: #d3c5b3;
    --muted: #b1a291;
    --primary: #dcb184;
    --primary-hover: #e8c49d;
    --on-primary: #2a1c11;
    --accent: #c99a6c;
    --accent-soft: #3b2e22;
    --border: #3d3129;
    --focus: #e8c49d;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 30%), 0 24px 48px -24px rgb(0 0 0 / 70%);
  }
}

/* ---------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; outline: none; }

img, svg { max-width: 100%; height: auto; }
img { display: block; }

h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; color: var(--text); }
h1, h2 { font-family: var(--font-serif); font-weight: 700; letter-spacing: .01em; }
p { margin: 0 0 1em; }

a { color: var(--primary); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
}
.narrow { max-width: 640px; }
.muted { color: var(--muted); font-size: .925rem; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--on-primary); }

/* ------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover { border-color: var(--accent); color: var(--text); }
.button-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }

.text-link { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* -------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img { border-radius: 9px; box-shadow: 0 1px 3px rgb(68 45 25 / 18%); }
.brand:hover { color: var(--text); }

.nav-desktop { display: none; margin-left: auto; }
.nav-desktop ul, .nav-mobile ul, .lang-menu, .footer-grid ul, .chips, .platforms, .features {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-desktop ul { display: flex; gap: 4px; }
.nav-desktop a, .nav-mobile a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
}
.nav-desktop a:hover, .nav-mobile a:hover { background: var(--surface-2); color: var(--text); }
.nav-desktop a[aria-current="page"], .nav-mobile a[aria-current="page"] { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* <details> dropdowns (language and mobile menu): work without JS. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.lang-switch, .nav-mobile { position: relative; }
.lang-switch > summary, .nav-mobile > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: .95rem;
}
.lang-switch > summary:hover, .nav-mobile > summary:hover,
.lang-switch[open] > summary, .nav-mobile[open] > summary { background: var(--surface-2); color: var(--text); }
.lang-switch .icon-chevron { width: 1em; height: 1em; transition: transform .15s; }
.lang-switch[open] .icon-chevron { transform: rotate(180deg); }

.lang-menu, .nav-mobile nav {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.lang-menu a:not([aria-current]) { padding-left: calc(12px + 1.25em + 8px); }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current] { color: var(--primary); font-weight: 600; }

.nav-mobile nav { min-width: 220px; }
.nav-mobile a { padding: 12px 14px; border-radius: 8px; }

@media (min-width: 820px) {
  .nav-desktop { display: block; }
  .nav-mobile { display: none; }
  .header-actions { margin-left: 8px; }
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 0 56px;
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(700px 400px at -10% 110%, color-mix(in srgb, var(--cream) 80%, transparent), transparent 70%);
}
.hero-inner { display: grid; gap: 40px; align-items: center; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .08em;
}
:lang(en) .eyebrow { text-transform: uppercase; }

.hero h1 { margin-bottom: 16px; }
.hero-name {
  display: block;
  color: var(--primary);
  font-size: clamp(2.6rem, 9vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.hero-title {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.45rem, 4.6vw, 2.1rem);
  line-height: 1.4;
}
.hero-lead { max-width: 34em; color: var(--text-2); font-size: 1.08rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 20px; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--text-2);
  font-size: .92rem;
}
.chips .icon { color: var(--accent); width: 1.05em; height: 1.05em; }

/* Store buttons */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 4px; }
.store-badge img { height: 48px; width: auto; }
.store-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  min-height: 52px;
  padding: 8px 18px 8px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  line-height: 1.2;
}
.store-button > span { display: flex; flex-direction: column; font-weight: 700; font-size: 1.05rem; }
.store-button small { font-weight: 500; font-size: .72rem; opacity: .85; }
.store-button .icon { width: 26px; height: 26px; }
a.store-button:hover { background: var(--primary); color: var(--on-primary); }
.store-button.is-pending {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed var(--border);
  cursor: default;
}

/* Hero visual: real screenshots or a labelled placeholder */
.hero-visual { display: flex; justify-content: center; }
.phone-placeholder {
  width: min(280px, 62vw);
  aspect-ratio: 9 / 19.5;
  padding: 12px;
  border-radius: 44px;
  background: linear-gradient(160deg, #3b2a1d, #22180f);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgb(255 255 255 / 6%);
}
.phone-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 24px;
  border-radius: 34px;
  background: linear-gradient(180deg, #fbf7f0, #f1e7d4);
  color: #54453a;
  text-align: center;
}
.phone-screen img { width: 88px; border-radius: 22px; box-shadow: 0 8px 24px -8px rgb(68 45 25 / 40%); margin-bottom: 12px; }
.phone-title { margin: 0; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: #765439; }
.phone-note { margin: 8px 0 0; font-weight: 600; }
.phone-sub { margin: 0; font-size: .85rem; color: #6f5f50; }

.shots {
  display: flex;
  gap: 16px;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
}
.shot { margin: 0; flex: 0 0 auto; width: min(260px, 70vw); scroll-snap-align: center; }
.shot img { width: 100%; height: auto; border-radius: 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }

@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; gap: 56px; }
}

/* ------------------------------------------------------------ sections */

.section { padding: 56px 0; }
@media (min-width: 900px) { .section { padding: 88px 0; } }

.section-head { max-width: 680px; margin: 0 auto 36px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 4.6vw, 2.3rem); }
.section-head p { color: var(--text-2); }

.features { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--primary);
}
.feature-icon .icon { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 4px; font-size: 1.15rem; }
.feature-tagline { margin-bottom: 8px; color: var(--accent); font-weight: 600; }
.feature p:last-child { margin: 0; color: var(--text-2); font-size: .96rem; }

.features-note {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: .92rem;
}
.features-note .icon { margin-top: .2em; }

.section-quote { padding-top: 0; }
.quote {
  display: grid;
  gap: 16px;
  padding-block: 32px;
  border-radius: var(--radius);
  background: var(--surface-2);
  max-width: calc(var(--container) - 40px);
}
@media (min-width: 700px) {
  .quote { grid-template-columns: auto 1fr; gap: 28px; padding: 40px 48px; }
}
.quote-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
}
.quote-icon .icon { width: 30px; height: 30px; }
.quote h2 { font-size: 1.5rem; }
.quote p { color: var(--text-2); max-width: 46em; }
.quote p:last-child { margin: 0; }

.section-download { background: linear-gradient(180deg, var(--bg), var(--cream)); }
.download { text-align: center; max-width: 720px; }
.download-logo { margin: 0 auto 20px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.download h2 { font-size: clamp(1.6rem, 4.6vw, 2.3rem); }
.download > p { color: var(--text-2); }
.download .store-buttons { justify-content: center; }
.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 20px 0 12px;
  color: var(--text-2);
}
.platforms li { display: inline-flex; align-items: center; gap: 6px; }
.platforms .icon { color: var(--accent); }

/* ------------------------------------------------------------ doc pages */

.doc-layout {
  display: grid;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 72px;
}
.doc-header h1 { font-size: clamp(1.9rem, 6vw, 2.75rem); margin-bottom: 8px; }
.doc-dates { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: .92rem; }

.doc-toc {
  align-self: start;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .93rem;
}
.doc-toc h2 { font-family: var(--font-sans); font-size: .85rem; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.doc-toc ol { margin: 0; padding-left: 0; list-style: none; }
.doc-toc li { margin: 2px 0; }
.doc-toc a { color: var(--text-2); text-decoration: none; }
.doc-toc a:hover { color: var(--primary); text-decoration: underline; }

.doc { min-width: 0; max-width: 46rem; }
.doc .lead { font-size: 1.08rem; color: var(--text-2); }
.doc section { padding-top: 12px; margin-bottom: 20px; }
.doc h2 { font-size: 1.45rem; margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 1.08rem; margin-top: 20px; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin-bottom: .45em; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.doc th, .doc td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.doc td:first-child { font-weight: 600; min-width: 8em; }

.notice {
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
}

.contact-card {
  padding: 24px !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.contact-card h2 { border-top: 0; margin-top: 0; padding-top: 0; }
.contact-card p:last-child { margin-bottom: 0; }

.doc details {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.doc summary {
  position: relative;
  padding: 14px 48px 14px 18px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.doc summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .15s;
}
.doc details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.doc summary:hover { background: var(--surface-2); }
.details-body { padding: 0 18px 6px; color: var(--text-2); }

.back-top { margin-top: 32px; font-size: .92rem; }

@media (min-width: 960px) {
  .doc-layout { grid-template-columns: 240px minmax(0, 1fr); column-gap: 56px; padding-top: 56px; }
  .doc-header { grid-column: 1 / -1; }
  .doc-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
}

/* ----------------------------------------------------------------- 404 */

.not-found { text-align: center; }
.big-404 { margin: 0; font-family: var(--font-serif); font-size: clamp(4rem, 18vw, 7rem); font-weight: 700; color: var(--accent-soft); line-height: 1; }
.not-found h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }


/* -------------------------------------------------------------- footer */

.site-footer {
  padding: 48px 0 calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: .95rem;
}
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: 8px 0 0; color: var(--muted); }
.footer-title { font-family: var(--font-sans); font-size: .85rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.footer-grid ul li { margin: 6px 0; }
.footer-grid a:not(.brand) { color: var(--text-2); text-decoration: none; word-break: break-word; }
.footer-grid a:not(.brand):hover { color: var(--primary); text-decoration: underline; }
.footer-grid .lang-switch { margin-top: 10px; margin-left: -10px; }
.lang-switch-up .lang-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.footer-bottom p { margin: 0 0 4px; }

@media (min-width: 820px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }
  .footer-brand { grid-column: auto; }
}

/* -------------------------------------------------------- preferences */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  .store-button, .feature, .button { border: 1px solid CanvasText; }
}

@media print {
  .site-header, .site-footer, .doc-toc, .back-top, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .doc { max-width: none; }
  .doc details { border: 0; }
  a { color: inherit; }
}
