/* Paleta jak w aplikacji Fizyka w kratkę (lib/theme/app_theme.dart): kolory marki – niebieski #5CB6EB,
   pomarańczowy #F47B20, szary #6E7882 – i ich odcienie Material 3 (ton = jasność 0–100).
   Role jak w AppColors.from: tło, karty, ramki, nagłówki – niebieskie; główna akcja – pomarańczowa. */
:root {
  --bg: #ecf4ff;          /* surfaceContainerLow */
  --surface: #ffffff;     /* surfaceContainerLowest – karty */
  --border: #d9e4ef;      /* surfaceContainerHighest */
  --text: #131d25;        /* onSurface */
  --muted: #3e4851;       /* onSurfaceVariant */
  --heading: #00587d;     /* niebieski, ton 35 */
  --link: #00658e;        /* primary */
  --header: #5cb6eb;      /* AppTheme.blue – pasek jak w aplikacji */
  --on-header: #131d25;
  --action: #f47b20;      /* AppTheme.orange */
  --on-action: #321200;   /* onTertiaryFixed */
  --accent-text: #873d00; /* pomarańczowy, ton 35 */
  --tag: #e4f3ff;         /* niebieski, ton 95 */
  --on-tag: #00587d;      /* niebieski, ton 35 */
  --disabled: #d9e4ef;    /* szary, ton 90 */
  --soon: #ffede5;        /* pomarańczowy, ton 95 */
  --on-soon: #873d00;     /* pomarańczowy, ton 35 */
  --cursor: #f47b20;      /* kursor w logo, na ciemnym kwadracie */
  --on-disabled: #3e4851; /* szary, ton 30 */
  --radius: 14px;
  --max: 960px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a141c;
    --surface: #172129;
    --border: #2c363f;
    --text: #d9e4ef;
    --muted: #bdc8d3;
    --heading: #84cfff;
    --link: #84cfff;
    --header: #004c6c;
    --on-header: #c7e7ff;
    --accent-text: #ffb68b;
    --tag: #003952;
    --on-tag: #84cfff;
    --disabled: #2c363f;
    --on-disabled: #bdc8d3;
    --soon: #592600;
    --on-soon: #ffb68b;
    --cursor: #994700;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a141c;          /* surface */
  --surface: #172129;     /* surfaceContainer */
  --border: #2c363f;      /* surfaceContainerHighest */
  --text: #d9e4ef;        /* onSurface */
  --muted: #bdc8d3;       /* onSurfaceVariant */
  --heading: #84cfff;     /* niebieski, ton 80 */
  --link: #84cfff;        /* primary */
  --header: #004c6c;      /* primaryContainer */
  --on-header: #c7e7ff;   /* onPrimaryContainer */
  --accent-text: #ffb68b; /* pomarańczowy, ton 80 */
  --tag: #003952;         /* niebieski, ton 22 */
  --on-tag: #84cfff;      /* niebieski, ton 80 */
  --disabled: #2c363f;    /* szary, ton 22 */
  --on-disabled: #bdc8d3; /* szary, ton 80 */
  --soon: #592600;        /* pomarańczowy, ton 22 */
  --on-soon: #ffb68b;     /* pomarańczowy, ton 80 */
  --cursor: #994700;      /* pomarańczowy, ton 40 – na jasnym kwadracie */
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* nagłówek – niebieski pasek jak w aplikacji */
.site-header { background: var(--header); color: var(--on-header); border-bottom: 4px solid var(--action); }
.site-header :focus-visible { outline-color: var(--on-header); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--on-header); text-decoration: none; font-weight: 600; font-size: 18px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand svg rect { fill: var(--on-header); }
.brand svg path { fill: none; stroke: var(--header); }
.brand svg path.cursor { stroke: var(--cursor); }
.brand .cmd { font-family: var(--mono); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--on-header); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.nav .lang { font-family: var(--mono); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid currentColor; border-radius: 999px;
  background: transparent; color: var(--on-header);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle[data-next="dark"] .icon-sun,
.theme-toggle[data-next="light"] .icon-moon { display: none; }

/* treść */
main { padding: 48px 0 64px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; color: var(--heading); }
h2 { font-size: 24px; line-height: 1.25; margin: 48px 0 16px; color: var(--heading); }
h3 { font-size: 18px; margin: 0 0 6px; }
p, ul { margin: 0 0 16px; }
.lead { font-size: 20px; color: var(--muted); max-width: 40em; }
.prompt { font-family: var(--mono); color: var(--accent-text); }
.caret { color: var(--action); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card p:last-child { margin-bottom: 0; }

.app-card { display: flex; gap: 18px; align-items: flex-start; text-decoration: none; color: inherit; }
.app-card:hover { border-color: var(--link); }
.app-card img { width: 72px; height: 72px; border-radius: 18px; flex: none; border: 1px solid var(--border); }
.app-card h3 { color: var(--heading); }
.app-card p { color: var(--muted); margin: 0 0 8px; }

.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tag);
  color: var(--on-tag);
}

.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  background: var(--action); color: var(--on-action);
  font-weight: 600; text-decoration: none;
}
.button.soon { cursor: default; }
.tag.soon { background: var(--soon); color: var(--on-soon); }

/* strona aplikacji */
.app-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.app-hero img { width: 120px; height: 120px; border-radius: 28px; border: 1px solid var(--border); background: #fff; }
.app-hero h1 { margin-bottom: 8px; }
.app-hero .lead { margin-bottom: 20px; }

.features .card h3::before { content: "› "; font-family: var(--mono); color: var(--action); }

/* teksty prawne */
.legal { max-width: 46em; }
.legal h2 { font-size: 20px; margin-top: 32px; }
.legal .meta { color: var(--muted); font-size: 15px; }

dl.data { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 16px; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; }

/* stopka */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
.site-footer p { margin: 0 0 8px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  main { padding: 32px 0 48px; }
  .lead { font-size: 18px; }
  .app-hero img { width: 96px; height: 96px; border-radius: 22px; }
  dl.data { grid-template-columns: 1fr; }
  dl.data dd { margin-bottom: 8px; }
}
