/* ==========================================================================
   Kongla Group Company Limited — kongla.hk
   Single stylesheet, no build step. Design tokens first, then components.
   ========================================================================== */

:root {
  /* Brand teals, sampled from the Kongla logo:
     #178d7c is the logo field, #0c5046 the glyph. */
  --jade-900: #0c5046;
  --jade-700: #0f6759;
  --jade-500: #178d7c;
  --jade-300: #6ec6bc;
  --jade-100: #dcf0ed;

  /* Warm accent for CTAs and app-card highlights. */
  --amber-600: #b4690e;
  --amber-500: #e08a1e;
  --amber-200: #f7d9a8;

  --ink-900: #10201e;
  --ink-700: #2c3d3a;
  --ink-500: #5b6b68;
  --ink-300: #8fa09d;

  --paper: #ffffff;
  --paper-tint: #f5faf9;
  --line: #dde8e6;

  --bg: var(--paper);
  --bg-alt: var(--paper-tint);
  --fg: var(--ink-900);
  --fg-muted: var(--ink-500);
  --border: var(--line);
  --brand: var(--jade-700);
  --brand-soft: var(--jade-100);
  --accent: var(--amber-600);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgb(16 32 30 / 8%);
  --shadow: 0 4px 16px rgb(16 32 30 / 8%);
  --shadow-lg: 0 18px 48px rgb(16 32 30 / 14%);

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.5rem, 9vw, 7rem);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang HK", "Hiragino Sans CNS", "Microsoft JhengHei",
    "Noto Sans HK", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1615;
    --bg-alt: #111f1d;
    --fg: #eaf4f2;
    --fg-muted: #9db3af;
    --border: #223835;
    --brand: var(--jade-300);
    --brand-soft: #16302c;
    --accent: #f0a94a;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 4px 16px rgb(0 0 0 / 40%);
    --shadow-lg: 0 18px 48px rgb(0 0 0 / 55%);
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1.15em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  width: min(100% - (var(--gutter) * 2), 1120px);
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - (var(--gutter) * 2), 760px);
  margin-inline: auto;
}

.section { padding-block: var(--section-y); }
.section--tint { background: var(--bg-alt); }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  color: var(--fg-muted);
  max-width: var(--measure);
}

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

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  flex-wrap: wrap;
}

.nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

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

.hero {
  padding-block: clamp(3.5rem, 10vw, 7.5rem) clamp(3rem, 8vw, 6rem);
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--brand-soft), transparent 60%),
    var(--bg);
}

.hero h1 { max-width: 16ch; }

.hero__lede {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--fg-muted);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.975rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--brand);
  color: var(--bg);
  box-shadow: var(--shadow);
}
.btn--primary:hover { box-shadow: var(--shadow-lg); }

.btn--ghost {
  border-color: var(--border);
  color: var(--fg);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* --------------------------------------------------------------- apps ---- */

.app {
  display: grid;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  grid-template-columns: 1fr;
  padding-block: var(--section-y);
  border-top: 1px solid var(--border);
}

@media (min-width: 860px) {
  .app { grid-template-columns: 1fr 1fr; }
  .app:nth-child(even) .app__media { order: -1; }
}

.app__body { max-width: 52ch; }

.app__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.app__name-zh {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app__name-en {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--fg-muted);
  font-weight: 600;
}

.app__tagline {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin-bottom: 1.4rem;
}

.app__note {
  font-size: 0.975rem;
  color: var(--fg-muted);
  border-left: 3px solid var(--brand);
  padding-left: 0.9rem;
  margin-bottom: 1.4rem;
}

.features {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.features li {
  position: relative;
  padding-left: 1.85rem;
  line-height: 1.5;
}

.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 0.85rem;
  height: 0.45rem;
  border-left: 2.5px solid var(--brand);
  border-bottom: 2.5px solid var(--brand);
  transform: rotate(-45deg);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
}

.status--soon {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}

/* ------------------------------------------------------- phone frame ---- */
/* Screenshot slot. Drop a 1170x2532 (or any 9:19.5) PNG into assets/img/
   and point the <img src> at it — no other change needed.               */

.app__media {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #2a3a38, #0e1a18);
  box-shadow: var(--shadow-lg);
  flex: none;
}

.phone::after {
  /* Notch */
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 20px;
  background: #0e1a18;
  border-radius: 999px;
  z-index: 2;
}

.phone__screen {
  width: 100%;
  height: 100%;
  border-radius: 29px;
  overflow: hidden;
  background: var(--bg-alt);
  display: grid;
  place-items: center;
}

.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone__placeholder {
  text-align: center;
  padding: 1.5rem;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.phone__placeholder strong {
  display: block;
  font-size: 0.9rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
}

/* -------------------------------------------------------------- prose ---- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin-bottom: 1.15em; }
.prose li { margin-bottom: 0.45em; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th { font-weight: 700; }

.page-head {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.updated {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin: 0;
}

.callout {
  border-left: 4px solid var(--brand);
  background: var(--bg-alt);
  padding: 1.1rem 1.35rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5em;
}
.callout p:last-child { margin-bottom: 0; }

.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--bg-alt);
  margin-bottom: 2rem;
}
.contact-card p:last-child { margin-bottom: 0; }

.contact-card__email {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 700;
  word-break: break-word;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  font-size: 0.95rem;
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2.5rem;
}

@media (min-width: 700px) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.site-footer h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 0.9rem;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--brand); }

.site-footer__blurb { color: var(--fg-muted); max-width: 34ch; }

.site-footer__legal {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
  font-size: 0.875rem;
}
.site-footer__legal p { margin: 0; }
