/* Nikmesoft site styles. One stylesheet for the homepage, app pages and legal
   pages. Theme: CSS variables, light by default, dark via prefers-color-scheme. */
:root {
  --bg: #f3f5f0;
  --surface: #ffffff;
  --ink: #13201c;
  --muted: #5a6762;
  --line: #dbe1da;
  --accent: #0d8a6a;
  --accent-ink: #ffffff;
  --amber: #e89a0c;
  --phone: #13201c;
  --screen: #e7efe9;
  --warn-bg: #fff4dc;
  --warn-ink: #6b4a00;
  --f-display: "Be Vietnam Pro", system-ui, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1614; --surface: #17211e; --ink: #e8efeb; --muted: #9aa8a2; --line: #26332f;
    --accent: #3cc49c; --accent-ink: #0b1411; --amber: #f4b23c; --phone: #050807; --screen: #1d2a26;
    --warn-bg: #33280f; --warn-ink: #f4d58d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; padding: 0 20px; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, .shots:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 20px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Nav */
nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; }
.mark span { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); box-shadow: 6px 6px 0 -2px var(--amber); }
.links { display: flex; gap: 22px; font-size: 15px; color: var(--muted); }
.links a { text-decoration: none; }
.links a:hover { color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-block: 40px 72px; }
.hero > div { min-width: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--accent); }
h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(40px, 6vw, 68px); line-height: 1.04; letter-spacing: -0.035em; margin: 14px 0 20px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0 0 30px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { transform: translateY(-1px); }

/* Phone */
.phone { width: min(290px, 100%); aspect-ratio: 9 / 18.5; margin: 0 auto; background: var(--phone); border-radius: 44px; padding: 12px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); position: relative; }
.screen { height: 100%; background: var(--screen); border-radius: 34px; padding: 44px 20px 20px; display: flex; flex-direction: column; gap: 22px; position: relative; overflow: hidden; }
.screen::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; border-radius: 12px; background: var(--phone); }
.clock { font-family: var(--f-mono); font-size: 13px; color: var(--muted); text-align: center; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 12px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.icon { display: block; width: 100%; aspect-ratio: 1; border-radius: 22%; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.app small { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.new { outline: 3px solid var(--amber); outline-offset: 2px; animation: pop 2.4s ease-in-out infinite; }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.dock { margin-top: auto; background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 22px; padding: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Stats strip */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.stat { padding: 24px 22px; min-width: 0; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 4px; }
.stat span { font-size: 14px; color: var(--muted); }

/* Sections */
section { padding-block: 80px 0; }
h2 { font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 14px; text-wrap: balance; }
.sub { color: var(--muted); max-width: 60ch; margin: 0 0 36px; }

/* Release log */
.log { border-left: 2px solid var(--line); margin-left: 6px; display: grid; gap: 30px; }
.entry { position: relative; padding-left: 28px; display: grid; grid-template-columns: 120px 1fr; gap: 20px; }
.entry::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.entry:last-child::before { background: var(--accent); }
.ver { font-family: var(--f-mono); font-size: 14px; color: var(--accent); padding-top: 2px; }
.entry h3 { margin: 0 0 4px; font-size: 18px; }
.entry p { margin: 0; color: var(--muted); max-width: 60ch; }
.entry > div { min-width: 0; }

/* Contact */
.contact { margin-block: 80px 40px; background: var(--ink); color: var(--bg); border-radius: 28px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.contact h2 { margin-top: 0; }
.contact p { color: color-mix(in srgb, var(--bg) 72%, transparent); margin: 0; }
.mailbox { background: color-mix(in srgb, var(--bg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mailbox code { font-family: var(--f-mono); font-size: 16px; user-select: all; overflow-wrap: anywhere; }
.copy { font: 600 14px var(--f-body); padding: 10px 16px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; }

footer { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 24px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 64px; }
footer nav { padding: 0; gap: 16px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }

/* Featured */
.feature { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 44px); align-items: center; }
.feature > div { min-width: 0; }
.feature-head { display: flex; gap: 16px; align-items: center; }
.feature-head .icon { width: 72px; flex: none; }
.feature ul, .bullets { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 10px; }
.feature li, .bullets li { display: flex; gap: 10px; }
.feature li::before, .bullets li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 2px; background: var(--accent); }
.feature h3 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; margin: 4px 0 0; }
.feature p { color: var(--muted); margin: 18px 0 20px; }
.duo { display: flex; justify-content: center; align-items: flex-end; }
.duo img { width: 48%; max-width: 210px; height: auto; border-radius: 20px; border: 6px solid var(--phone); box-shadow: 0 24px 50px -28px rgba(0,0,0,.5); }
.duo img + img { margin-left: -8%; transform: translateY(-28px); }

/* App catalog */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip { font: 500 14px var(--f-body); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.catalog { display: grid; gap: 18px; }
.listing { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; min-width: 0; }
.listing-head { display: flex; gap: 16px; align-items: flex-start; }
.listing-head .icon { width: 64px; flex: none; }
.listing-head > div { min-width: 0; flex: 1; }
.listing h3 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; }
.listing h3 a { text-decoration: none; }
.listing h3 a:hover { color: var(--accent); }
.listing p { margin: 4px 0 10px; font-size: 15px; color: var(--muted); max-width: 70ch; }
.meta { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.meta b { color: var(--accent); font-weight: 500; }
.get { display: flex; flex-wrap: wrap; gap: 8px; }
.get a { font: 600 13px var(--f-body); text-decoration: none; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.get a.store { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.get a:hover { border-color: var(--accent); }
.shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 18px 2px 6px; margin-top: 4px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.shots img { flex: none; height: 340px; width: auto; border-radius: 16px; border: 1px solid var(--line); scroll-snap-align: start; background: var(--screen); }
.listing[hidden] { display: none; }

/* Compact app grid (homepage "All apps") */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; text-decoration: none; min-width: 0; }
.tile:hover { border-color: var(--accent); }
.tile .icon { width: 52px; flex: none; }
.tile b { display: block; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile span { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.tile[hidden] { display: none; }

/* App page */
.app-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding-block: 24px 40px; }
.app-hero .icon { width: 128px; border-radius: 28%; }
.app-hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 6px 0 12px; }
.app-hero .lede { margin-bottom: 22px; }
.crumbs { font-size: 14px; color: var(--muted); padding-top: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(20px, 4vw, 36px); }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 24px; margin-top: 0; }
.prose { max-width: 72ch; }
.prose p, .prose li { color: var(--muted); }
.prose h2 { font-size: 24px; margin: 40px 0 10px; }
.prose h3 { font-size: 18px; margin: 28px 0 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0 20px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.prose th { color: var(--ink); font-weight: 600; }
.desc { white-space: pre-line; color: var(--muted); max-width: 72ch; overflow-wrap: anywhere; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two > * { min-width: 0; }
.two > .panel + .panel { margin-top: 0; }
.app-hero > div { min-width: 0; }
.app-hero h1 { overflow-wrap: anywhere; }
.legal-links { display: flex; flex-wrap: wrap; gap: 10px; }
.pdf { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: 14px; padding: 14px 18px; margin: 8px 0 24px; font-size: 15px; }
.updated { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.notfound { text-align: center; padding-block: 80px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 24px 56px; }
  .strip { grid-template-columns: 1fr; }
  .stat { border-left: 0; padding-inline: 0; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .contact, .feature, .two { grid-template-columns: 1fr; }
  nav .links { display: none; }
}
@media (max-width: 520px) {
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .listing { padding: 16px; }
  .listing-head .icon { width: 52px; }
  .shots img { height: 280px; }
  .app-hero { grid-template-columns: 1fr; }
  .app-hero .icon { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .new { animation: none; }
  .btn:hover { transform: none; }
}
