:root {
  /* ViLabs logo palette: sky blue, deep blue, brushed silver, graphite */
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --surface-hover: #F7FBFE;
  --field: #F3F5F7;
  --border: #E1E5EA;
  --border-strong: #CDD3DA;
  --border-hover: #8FCDEB;
  --text: #1F2328;
  --muted: #5C636B;
  --accent: #0072BC;
  --accent-bright: #00A8E8;
  --on-accent: #FFFFFF;
  --silver: #B9BCBF;
  --graphite: #55585C;
  --radius-lg: 18px;
  --radius-md: 16px;
  --glass: rgba(255,255,255,.82);
  --footer-bg: #0B2E4F;
  --footer-text: #D3E0EC;
  --footer-link: #8FD8FF;
  --font-display: "Ubuntu", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding-inline: 32px; }

/* Top bar */
.topbar { position: relative; z-index: 2; background: rgba(255,255,255,.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo { height: 46px; width: auto; display: block; }
.brand__sub { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--graphite); letter-spacing: .04em; padding-left: 14px; border-left: 1px solid var(--border-strong); }

.search { position: relative; flex: 1 1 260px; max-width: 420px; margin-inline: auto; color: var(--muted); }
.search svg { position: absolute; left: 14px; top: 13px; }
.search input {
  width: 100%; height: 44px; padding: 0 44px 0 42px;
  background: var(--field); border: 1px solid var(--border-strong); border-radius: 12px;
  font: inherit; font-size: 15px; color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(0,168,232,.18); background: var(--surface); }
.search kbd {
  position: absolute; right: 10px; top: 10px; min-width: 24px; height: 24px;
  display: grid; place-items: center; font: 600 12px var(--font-body);
  border: 1px solid var(--border-strong); border-radius: 6px; color: var(--muted);
}

.topbar__actions { display: flex; gap: 8px; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); display: grid; place-items: center; color: var(--graphite);
}
.iconbtn:hover { background: var(--surface-hover); border-color: var(--border-hover); }

/* Grid */
.main { position: relative; z-index: 1; flex: 1; padding-block: 36px 56px; }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 96px;
  grid-auto-flow: dense;
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
}

.tile {
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease, opacity .18s ease;
}
a.tile:hover { border-color: var(--border-hover); background: var(--surface-hover); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,80,140,.10); }
.tile.is-dim { opacity: .3; }
.tile .arw { color: var(--accent); transition: transform .18s ease; flex: none; }
a.tile:hover .arw { transform: translate(3px, -3px); }

/* Hero */
.tile--hero {
  grid-column: span 6; grid-row: span 2;
  background: var(--accent); color: var(--on-accent); border: none; position: relative; overflow: hidden;
  padding: 20px 24px; display: flex; flex-direction: column; justify-content: space-between;
}
.hero__top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.hero__greeting { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hero__date { font-weight: 500; }
.tile--hero::after { content: ""; position: absolute; right: -50px; top: -70px; width: 200px; height: 320px; border-radius: 100px; background: var(--accent-bright); opacity: .35; transform: rotate(32deg); pointer-events: none; }
.tile--hero::before { content: ""; position: absolute; right: 110px; top: -30px; width: 86px; height: 280px; border-radius: 43px; background: var(--silver); opacity: .22; transform: rotate(-32deg); pointer-events: none; }
.hero__top, .hero__bottom { position: relative; z-index: 1; }
.hero__bottom { display: flex; flex-direction: column; gap: 6px; }
.hero__time { font-family: var(--font-display); font-size: 60px; font-weight: 600; line-height: .95; letter-spacing: -0.05em; }
.tile--hero h1 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

/* App icon */
.icon {
  flex: none; display: grid; place-items: center; border-radius: 15px;
  width: 52px; height: 52px; color: var(--on-accent); overflow: hidden;
}
.icon img { width: 78%; height: 78%; object-fit: contain; }
.icon--empty {
  border: 1.5px dashed var(--silver); color: var(--muted);
  font-size: 9px; font-weight: 600; letter-spacing: .08em;
}
.name { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.desc { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Tall */
.tile--tall { grid-column: span 3; grid-row: span 2; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; }
.tile--tall .icon { width: 60px; height: 60px; border-radius: 16px; }
.tile--tall .head { display: flex; justify-content: space-between; align-items: flex-start; }
.tile--tall .body { display: flex; flex-direction: column; gap: 6px; }
.tile--tall .name { font-size: 22px; letter-spacing: -0.02em; }
.tile--tall .desc { font-size: 14px; }

/* Wide */
.tile--wide { grid-column: span 3; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.tile--wide .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile--wide .name { font-size: 17px; white-space: nowrap; }
.tile--wide .icon { width: 48px; height: 48px; border-radius: 13px; }

/* Small */
.tile--small { grid-column: span 2; padding: 18px; border-radius: var(--radius-md); display: flex; flex-direction: column; justify-content: space-between; }
.tile--small .icon { width: 44px; height: 44px; border-radius: 13px; }
.tile--small .name { font-size: 16px; }

/* Utility tiles */
.tile--util {
  grid-column: span 6; padding: 20px 24px; border-radius: var(--radius-md);
  background: transparent; border: 1px dashed var(--border-strong);
  display: flex; align-items: center; gap: 18px;
}
.tile--util .icon { width: 48px; height: 48px; border-radius: 14px; background: #E5F4FC; color: var(--accent); }
.tile--util .body { display: flex; flex-direction: column; gap: 2px; }
.tile--util .name { font-size: 17px; }

.nomatch { margin: 20px 0 0; color: var(--muted); }
.site-footer { position: relative; z-index: 1; width: 100%; background: var(--footer-bg); color: var(--footer-text); }
.footer { padding-block: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.footer__brand { font-family: var(--font-display); font-weight: 500; letter-spacing: .02em; color: #FFFFFF; }
.site-footer .linkbtn { color: var(--footer-link); }
.site-footer .linkbtn:hover { color: #FFFFFF; }
.footer__logo { height: 44px; width: auto; display: block; }
.footer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }

/* Buttons */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: #005A94; }
.btn { height: 44px; padding: 0 18px; border-radius: 12px; font: 600 14px var(--font-body); cursor: pointer; white-space: nowrap; }
.btn--primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.btn--primary:hover { background: #005A94; border-color: #005A94; }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn--ghost:hover { border-color: var(--border-hover); background: var(--surface-hover); }

/* Privacy notice bar */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.consent__inner {
  pointer-events: auto; max-width: 980px; margin: 0 auto; padding: 16px 18px 16px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 40px rgba(16,40,70,.16);
  animation: rise .35s ease both;
}
.consent__icon { flex: none; color: var(--accent); }
.consent p { flex: 1 1 360px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.consent__actions { display: flex; gap: 10px; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Policies pop-up */
.policies {
  width: min(680px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(10,30,60,.30); overflow: hidden;
}
.policies[open] { display: flex; flex-direction: column; animation: rise .25s ease both; }
.policies::backdrop { background: rgba(15,25,40,.45); backdrop-filter: blur(2px); }
.policies__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 16px 28px; border-bottom: 1px solid var(--border); }
.policies__eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.policies h2 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.policies__body { overflow-y: auto; padding: 8px 28px 24px; font-size: 15px; line-height: 1.6; color: #2F343A; }
.policies__body h3 { margin: 22px 0 6px; font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--text); }
.policies__body p { margin: 0 0 10px; max-width: 62ch; }
.policies__body ul { margin: 0 0 10px; padding-left: 20px; }
.policies__body li { margin-bottom: 4px; }
.policies__updated { font-size: 13px; color: var(--muted); }
.policies__foot { display: flex; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg); }
body.has-consent .main { padding-bottom: 140px; }


/* Animated background */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0,114,188,.10) 1px, transparent 1px); background-size: 26px 26px; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.blob--1 { width: 520px; height: 520px; background: #8FD8FF; top: -140px; left: -120px; animation: drift1 26s ease-in-out infinite alternate; }
.blob--2 { width: 460px; height: 460px; background: #9CC3E6; bottom: -160px; right: -100px; animation: drift2 32s ease-in-out infinite alternate; }
.blob--3 { width: 360px; height: 360px; background: #D5D8DC; top: 35%; left: 45%; animation: drift3 28s ease-in-out infinite alternate; }
.blob--4 { width: 280px; height: 280px; background: #5FC4F0; top: 55%; left: 8%; opacity: .35; animation: drift2 36s ease-in-out infinite alternate-reverse; }
.blob--1.is-following { top: 0; left: 0; animation: none; opacity: .6; transition: opacity .4s ease; }
@keyframes drift1 { to { transform: translate(38vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-32vw, -26vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-20vw, 18vh) scale(1.2); } }

/* Tablet */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile--hero { grid-column: span 6; }
  .tile--tall { grid-column: span 3; }
  .tile--wide { grid-column: span 3; }
  .tile--util { grid-column: span 3; }
}

/* Phone */
@media (max-width: 640px) {
  .consent__actions { width: 100%; }
  .consent__actions .btn { flex: 1; }
  .policies__body { padding-inline: 20px; }
  .policies__head { padding-left: 20px; }
  .brand__logo { height: 42px; }
  .brand__sub { font-size: 15px; padding-left: 10px; }
  .wrap { padding-inline: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tile--hero, .tile--tall, .tile--wide, .tile--util { grid-column: span 2; grid-row: auto; }
  .tile--small { grid-column: span 1; min-height: 128px; }
  .tile--tall { min-height: 150px; }
  .tile--wide { min-height: 76px; }
  .tile--hero { min-height: 180px; padding: 20px; }
  .hero__time { font-size: 52px; }
  .blob { filter: blur(50px); }
  .search kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .blob { animation: none !important; }
}
