/* Tweeba site. Colours come from the app's DESIGN.md ("Zeszyt w kratkę"): paper, ballpoint blue, red pen. */
:root {
  color-scheme: light dark;
  --paper: #FBFAF6; --page: #FFFFFE; --ink: #1C2030; --soft: #50566A; --line: #D6DEEE;
  --blue: #1D3A9E; --blue-deep: #10225F; --blue-tint: #DDE4FB; --red: #C8362E;
  --hero: #1D3A9E; --mark: #E8473C; --hero-ink: #FFFFFF; --hero-soft: #C9D5FF; --bezel: #0B0F1A;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12151C; --page: #1F2430; --ink: #E3E5EC; --soft: #A8AEC0; --line: #2E3648;
    --blue: #A9BCFF; --blue-deep: #DDE4FB; --blue-tint: #283F8F; --red: #FF8A7E;
    --hero: #172E7E; --bezel: #000; --mark: #FF8A7E;
  }
}
* { box-sizing: border-box; }
/* Anchor jumps land below the sticky header */
html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
}
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible { outline-color: #fff; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
p { margin: 0; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

/* PL/EN: the element whose lang differs from <html lang> is hidden (site.js switches it) */
html[lang="pl"] [lang="en"], html[lang="en"] [lang="pl"] { display: none !important; }

/* Top bar. The same name on every page keeps it still during page transitions. */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); view-transition-name: bar; }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 64px; }
.logo { display: flex; padding: 8px 4px 8px 0; margin-right: auto; color: var(--ink); }
.logo svg { width: 118px; height: 25px; }
.logo .logo-t { stroke: var(--mark); }
/* The list is a popover on phones; these reset the browser's popover box for the inline layout */
.menu { list-style: none; display: flex; gap: 2px; position: static; inset: auto; width: auto; height: auto; margin: 0; padding: 0; overflow: visible; border: 0; background: none; color: inherit; }
.nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--soft); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.menu-btn { display: none; }
.switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.switch button { border: 0; background: none; color: var(--soft); font: 600 12px/1 var(--font); letter-spacing: .06em; height: 30px; min-width: 38px; border-radius: 7px; cursor: pointer; }
.switch button:hover { color: var(--ink); }
.switch button[aria-pressed="true"] { background: var(--page); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.bar-cta { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--blue); color: var(--paper); font-weight: 600; font-size: 14px; text-decoration: none; }
.bar-cta:hover { background: var(--blue-deep); }
@media (max-width: 860px) {
  .bar-cta { display: none; }
  /* Browsers without popovers keep the links inline; the bar wraps instead */
  @supports selector(:popover-open) {
    .nav:has(.menu) { order: 1; } /* menu button sits after the language switch */
    .menu-btn { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
    .menu-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
    .menu-btn .i-close, .nav:has(.menu:popover-open) .i-open { display: none; }
    .nav:has(.menu:popover-open) .i-close { display: block; }
    .menu { position: fixed; inset: 65px 0 auto; width: auto; padding: 4px 16px 16px; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(0,0,0,.12); }
    .menu:not(:popover-open) { display: none; }
    .menu a { padding: 14px 4px; border-radius: 0; border-top: 1px solid var(--line); font-size: 17px; color: var(--ink); }
    .menu li:first-child a { border-top: 0; }
    .menu a:hover { background: none; color: var(--blue); }
  }
}

/* Hero: the app's blue squared page with the red margin line */
.hero { position: relative; overflow: hidden; background: var(--hero); color: var(--hero-ink);
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px; }
.hero::before { content: ""; position: absolute; top: 0; bottom: 0; left: max(24px, calc(50% - 600px)); width: 2px; background: rgba(255,120,110,.55); }
.hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 72px 0 0; }
.hero-copy { padding-bottom: 72px; }
.app-id { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.app-id img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.app-id b { display: block; font-size: 18px; }
.app-id span { color: var(--hero-soft); font-size: 14px; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 700; }
.mark { position: relative; white-space: nowrap; }
.mark svg { position: absolute; left: -2%; bottom: -.18em; width: 104%; height: .32em; overflow: visible; }
.lead { margin-top: 24px; font-size: clamp(18px, 2vw, 21px); color: var(--hero-soft); max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 28px; font-weight: 600; text-decoration: none; }
.btn-light { background: #fff; color: #1D3A9E; }
.btn-light:hover { background: #DDE4FB; }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.phones { position: relative; height: 560px; align-self: end; }
.phone { width: 260px; border-radius: 40px; padding: 9px; background: var(--bezel); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.phone img { height: auto; border-radius: 32px; aspect-ratio: 9 / 20; object-fit: cover; object-position: top; width: 100%; }
.phones .phone { position: absolute; bottom: -120px; }
.phones .phone:first-child { left: 0; transform: rotate(-4deg); }
.phones .phone:last-child { right: 0; bottom: -40px; transform: rotate(5deg); }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-copy { padding-bottom: 0; }
  .hero::before { display: none; }
  .phones { height: 380px; max-width: 420px; width: 100%; margin-inline: auto; }
  .phone { width: 200px; border-radius: 32px; padding: 7px; }
  .phone img { border-radius: 26px; }
}

/* Sections */
section { padding: 96px 0; }
.kicker { color: var(--blue); font-weight: 600; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.title { font-size: clamp(30px, 4vw, 44px); margin-top: 10px; max-width: 20ch; }
.intro { color: var(--soft); margin-top: 16px; max-width: 56ch; font-size: 18px; }

/* Features on a notebook page: ticks left of the red margin, words right of it */
.features { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: start; margin-top: 48px; }
.sheet { position: relative; background: var(--page); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.06);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px; padding: 24px 24px 24px 72px; }
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 56px; width: 2px; background: color-mix(in srgb, var(--red) 60%, transparent); }
.feat { position: relative; padding: 20px 0; }
.feat + .feat { border-top: 1px dashed var(--line); }
.feat svg { position: absolute; left: -54px; top: 22px; width: 28px; height: 28px; color: var(--red); }
.feat h3 { font-size: 20px; color: var(--blue); font-weight: 600; letter-spacing: -0.01em; }
.feat p { margin-top: 6px; color: var(--soft); max-width: 58ch; }
.features .phone { position: sticky; top: 96px; width: 100%; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } .features .phone { display: none; } }

/* Screens: one row of six on wide screens, a swipeable strip on narrow ones */
.gallery { background: var(--page); border-block: 1px solid var(--line); }
.shots { display: flex; gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 40px 16px 24px; margin-inline: -16px; }
.shots figure { margin: 0; flex: 0 0 220px; scroll-snap-align: start; }
.shots .phone { width: 100%; box-shadow: 0 16px 32px rgba(0,0,0,.18); }
.shots figcaption { margin-top: 14px; font-weight: 500; color: var(--soft); font-size: 15px; text-align: center; }
@media (min-width: 1000px) {
  .shots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; overflow: visible; padding: 40px 0 0; margin-inline: 0; }
  .shots .phone { border-radius: 28px; padding: 7px; }
  .shots .phone img { border-radius: 22px; }
}
/* Fade the edge that has more screens behind it (scrollability hint) */
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes reveal-fade-start { to { --fade-start: var(--fade-size); } }
@keyframes hide-fade-end { from { --fade-end: var(--fade-size); } }
@supports (animation-timeline: scroll()) {
  @media (max-width: 999px) {
    .shots {
      --fade-size: 3rem;
      scroll-padding-inline: var(--fade-size);
      mask:
        linear-gradient(black, black) no-clip subtract,
        linear-gradient(to right, black, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
        linear-gradient(to right, transparent, black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
      animation: reveal-fade-start linear both, hide-fade-end linear both;
      animation-timeline: scroll(self inline);
      animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
    }
  }
}

/* Apps on Google Play */
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; margin-top: 40px; }
.apps h3 { font-size: 14px; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 4px; }
.apps ul { list-style: none; margin: 0; padding: 0; }
.apps a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.apps a::after { content: "↗"; content: "↗" / ""; color: var(--blue); }
.apps a:hover { color: var(--blue); }
.all-apps { display: inline-block; margin-top: 20px; font-weight: 600; padding: 10px 0; }
@media (max-width: 860px) { .apps { grid-template-columns: 1fr; } }

/* Ads and contact */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.card { background: var(--page); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.card h3 { font-size: 22px; }
.card p { color: var(--soft); margin-top: 12px; }
.card address { font-style: normal; margin-top: 12px; line-height: 1.5; }
.card .btn { margin-top: 24px; min-height: 48px; padding: 0 22px; background: var(--blue); color: var(--paper); }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } section { padding: 64px 0; } }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--soft); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.foot address { font-style: normal; }
.foot nav { display: flex; gap: 20px; }

/* Privacy policy subpage */
.doc { max-width: 820px; margin: 48px auto 72px; background: var(--page); border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 5vw, 56px); }
.doc h1 { font-size: clamp(30px, 4vw, 40px); }
.doc .meta { color: var(--soft); margin-top: 8px; font-size: 15px; }
.doc h2 { font-size: 21px; margin: 40px 0 10px; color: var(--blue); }
.doc p, .doc li { color: var(--ink); }
.doc p { margin: 10px 0; }
.doc ul { padding-left: 1.3rem; }
.doc li { margin: 6px 0; }
.doc a { overflow-wrap: anywhere; }
.notice { padding: 16px 20px; background: var(--blue-tint); border-radius: 10px; margin: 20px 0; }
@media print { .bar, footer { display: none; } .doc { border: 0; margin: 0; } }
