/* Portly website: one static page per language, no external requests (no web fonts, no analytics). */
:root {
  --bg: #0b1020;
  --bg-2: #0f172a;
  --card: #131c33;
  --card-border: #22305a;
  --text: #e6ebf5;
  --muted: #9aa8c4;
  --blue: #2563eb;
  --sky: #0ea5e9;
  --yellow: #facc15;
  --green: #22c55e;
  --radius: 16px;
  --max: 1160px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: #7cc4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgb(11 16 32 / .72);
  border-bottom: 1px solid rgb(255 255 255 / .06);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav .lang { border: 1px solid var(--card-border); border-radius: 8px; padding: 3px 10px; color: var(--text); }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: 72px 0 0; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -200px 0 auto; height: 900px; z-index: -1;
  background:
    radial-gradient(600px 380px at 30% 30%, rgb(37 99 235 / .35), transparent 70%),
    radial-gradient(520px 360px at 72% 22%, rgb(14 165 233 / .28), transparent 70%);
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; font-size: 14px;
  background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); color: var(--muted);
}
.badge b { color: var(--yellow); font-weight: 600; }
h1 {
  margin: 22px auto 16px; max-width: 880px;
  font-size: clamp(36px, 6vw, 64px); line-height: 1.08; letter-spacing: -0.02em;
}
h1 .grad { background: linear-gradient(90deg, #60a5fa, #38bdf8 60%, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 auto; max-width: 680px; color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 32px 0 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: 16px;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--sky)); color: #fff; box-shadow: 0 10px 30px rgb(37 99 235 / .35); }
.btn-primary:hover { box-shadow: 0 14px 36px rgb(37 99 235 / .5); }
.btn-ghost { background: rgb(255 255 255 / .04); border-color: var(--card-border); color: var(--text); }
.btn-ghost:hover { background: rgb(255 255 255 / .08); }
.btn small { font-weight: 400; opacity: .85; }
.meta { color: var(--muted); font-size: 14px; }
.meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* the app window: tilted in 3D at first, flat and close once it is scrolled into view (--p goes 0 -> 1, see site.js) */
.stage { perspective: 1400px; margin: 48px auto 0; width: min(1080px, 100% - 32px); --p: 0; }
.shot {
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgb(255 255 255 / .1);
  box-shadow: 0 40px 120px rgb(0 0 0 / .55), 0 0 0 1px rgb(37 99 235 / .15);
  transform-origin: 50% 0;
  transform:
    rotateX(calc((1 - var(--p)) * 28deg))
    scale(calc(.86 + var(--p) * .14))
    translateY(calc((1 - var(--p)) * -20px));
  will-change: transform;
}
.glow { position: relative; }
.glow::after {
  content: ""; position: absolute; inset: 10% 8% -6%; z-index: -1; filter: blur(70px);
  background: linear-gradient(90deg, rgb(37 99 235 / .55), rgb(14 165 233 / .45));
  opacity: calc(.35 + var(--p) * .4);
}

/* ---------- sections ---------- */
section { padding: 110px 0 0; }
.kicker { color: #60a5fa; font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
h2 { margin: 8px 0 14px; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: -0.015em; }
.sub { color: var(--muted); max-width: 680px; margin: 0 0 36px; font-size: 18px; }
.center { text-align: center; }
.center .sub, .sub.mx-auto { margin-inline: auto; }
.sub.flush { margin-bottom: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: linear-gradient(180deg, rgb(255 255 255 / .03), transparent), var(--card);
  border: 1px solid var(--card-border); border-radius: var(--radius); padding: 22px;
}
.card h3 { margin: 12px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: rgb(37 99 235 / .15); color: #7cc4ff; border: 1px solid rgb(37 99 235 / .3);
}
.icon svg { width: 22px; height: 22px; }

/* feature rows with a screenshot */
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: center; margin-bottom: 90px; }
.row.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.row.flip .text { order: 2; }
.row .text h3 { font-size: clamp(24px, 3vw, 32px); margin: 6px 0 12px; line-height: 1.2; }
.row .text p { color: var(--muted); font-size: 17px; margin: 0 0 14px; }
.row ul { margin: 0; padding: 0; list-style: none; }
.row li { padding-left: 28px; position: relative; margin: 8px 0; }
.row li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: rgb(34 197 94 / .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.frame { border-radius: 12px; overflow: hidden; border: 1px solid rgb(255 255 255 / .1); box-shadow: 0 24px 70px rgb(0 0 0 / .45); }
.frame.small { max-width: 560px; margin-inline: auto; }
@media (max-width: 860px) {
  .row, .row.flip { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .row.flip .text { order: 0; }
}

/* stack chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-size: 15px;
  background: rgb(255 255 255 / .04); border: 1px solid var(--card-border); color: var(--text);
}

/* mac / linux */
.beta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 36px; align-items: center;
  background: radial-gradient(500px 260px at 90% 0%, rgb(14 165 233 / .18), transparent 70%), var(--card);
  border: 1px solid var(--card-border); border-radius: 22px; padding: 40px;
}
@media (max-width: 860px) { .beta { grid-template-columns: minmax(0, 1fr); padding: 26px; } }
.cmd {
  display: flex; align-items: center; gap: 10px;
  background: #060a16; border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 14px 14px 18px;
}
.cmd code { flex: 1; min-width: 0; font-size: 14px; color: #c7f9ff; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.cmd code::before { content: "$ "; color: var(--muted); }
.copy {
  flex: none; border: 1px solid var(--card-border); background: rgb(255 255 255 / .05); color: var(--text);
  border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.copy:hover { background: rgb(255 255 255 / .1); }
.copy.done { color: var(--green); border-color: rgb(34 197 94 / .4); }
.small-print { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* final call */
.final { text-align: center; padding-bottom: 40px; }
.final .cta { margin-top: 26px; }

footer { margin-top: 110px; border-top: 1px solid rgb(255 255 255 / .06); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* reveal on scroll (only when JS runs; without JS everything is visible) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage { --p: 1 !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
