/*
 * hrabbit.app — one stylesheet, no scripts (docs/architecture/site-hrabbit-app.md S6).
 * Colours: Len palette copied by hand from project/packages/design-tokens/src/colors.ts (token path in each comment).
 * Type: Newsreader 500 and Hanken Grotesk 400/600 (OFL 1.1, fonts/OFL.txt), sizes after design-tokens typography.ts.
 */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader_500Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --bg: #F7F2EA;            /* bg.screen */
  --card: #FFFDF9;          /* bg.card */
  --fill: #EFE7DA;          /* bg.fill */
  --ink: #2A2620;           /* text.primary */
  --ink-2: #4A4339;         /* text.secondary */
  --ink-3: #5E564A;         /* text.tertiary */
  --green: #3F6B4C;         /* green.accent */
  --green-fill: #4F7D5B;    /* green.fill */
  --green-dark: #2F5A3E;    /* green.dark */
  --green-soft: #E4ECDF;    /* green.soft */
  --green-ring: #D3DFCB;    /* green.bannerRing */
  --on-accent: #FFFDF8;     /* text.onAccent */
  --carrot: #E5783E;        /* orange.carrot */
  --peach: #F6DCC8;         /* orange.soft */
  --wash: #FFF1E6;          /* orange.wash */
  --rust-dark: #8A3F18;     /* rust.dark */
  --rust-bg: #FBE7DA;       /* rust.bg */
  --rust-ring: #E3B595;     /* rust.ring */
  --line: #E3D9C8;          /* line.card */
  --hairline: #DED5C6;      /* line.hairline */
  --row: #E7DFD2;           /* line.row */
  --soil: #DCCAAB;          /* soil.bed */
  --soil-edge: #CDB894;     /* soil.edge */

  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --radius-card: 18px;      /* radii.card */
  --radius-button: 14px;    /* radii.button */
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

::selection {
  background: var(--peach);
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

strong,
b,
th {
  font-weight: 600;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 1.7rem + 2.4vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4375rem, 1.3rem + 0.5vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--green);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--green) 45%, transparent);
  text-decoration-skip-ink: auto;
  transition: color 120ms ease-out, text-decoration-color 120ms ease-out;
}

a:hover {
  color: var(--green-dark);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.email {
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 10;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-button);
  background: var(--green-fill);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:hover,
.skip:focus-visible {
  color: var(--on-accent);
  text-decoration: none;
}

.skip:focus-visible {
  transform: none;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--hairline);
}

.site-header__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.22em;     /* receiptBrand */
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand:hover {
  color: var(--ink);
}

.site-nav ul,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--green-dark);
}

.site-nav a[aria-current="page"] {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* ---------- footer: the garden bed ---------- */

.site-footer {
  flex-shrink: 0;
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
  background: var(--soil);
  border-top: 2px solid var(--soil-edge);
  color: var(--ink);
}

.page-card .site-footer {
  margin-top: 0;
}

.site-footer__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1rem 1.5rem;
}

.footer-links a {
  color: var(--ink);
}

.footer-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

.site-footer :focus-visible {
  outline-color: var(--ink);
}

.copyright {
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- app card (/) ---------- */

.card-page {
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1 0 auto;
  display: grid;
  gap: 2rem;
  padding-top: clamp(2rem, 1rem + 6vw, 5rem);
  align-items: end;
}

.hero__text {
  display: grid;
  gap: 1.5rem;
  align-content: start;
  max-width: 34rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1;
  letter-spacing: 0.22em;
}

.wordmark img {
  width: 56px;
  height: 56px;
  border-radius: 15px;
}

.tagline {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.375rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.loop {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.loop li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--ink-2);
}

.loop__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.loop__mark svg {
  width: 22px;
  height: 22px;
}

.loop__mark--check {
  background: var(--green-fill);
}

.loop__mark--carrot {
  background: var(--card);
  border: 1px solid var(--line);
}

.loop__mark--carrot img {
  width: 13px;
  height: auto;
  transform: rotate(-28deg);   /* carrot.tiltDegrees */
}

.loop__mark--reward {
  background: var(--rust-bg);
}

.status {
  justify-self: start;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.5rem 0.875rem;
  border-radius: 14px;
  background: var(--fill);
  color: var(--ink-3);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.status::before {
  margin-top: 0.45em;
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--carrot);
}

.hero__art {
  justify-self: center;
  width: min(100%, 26rem);
  margin-bottom: -2px;   /* feet rest on the soil edge of the footer */
}

.hero-art {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-art .ear {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.hero-art .plant {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-art .ear-l {
    animation: ear-twitch 900ms cubic-bezier(0.22, 1, 0.36, 1) 700ms 1 both;
  }

  .hero-art .ear-r {
    animation: ear-twitch-r 900ms cubic-bezier(0.22, 1, 0.36, 1) 760ms 1 both;
  }

  .hero-art .plant {
    animation: sprout 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-art .plant-2 {
    animation-delay: 120ms;
  }
}

@keyframes ear-twitch {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-7deg); }
  65% { transform: rotate(3deg); }
}

@keyframes ear-twitch-r {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(8deg); }
  65% { transform: rotate(-3deg); }
}

@keyframes sprout {
  from { transform: translateY(18%) scaleY(0.9); }
  to { transform: none; }
}

@media (min-width: 48rem) {
  .hero__art {
    width: min(100%, 32rem);
  }
}

@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem 3rem;
  }

  .hero__text {
    align-self: start;
  }

  .hero__art {
    justify-self: end;
    width: 100%;
    max-width: 38rem;
  }
}

/* ---------- simple pages (/kontakt/, /usun-konto/, 404) ---------- */

.narrow {
  max-width: calc(46rem + 2 * var(--gutter));
}

.simple {
  padding-top: clamp(2rem, 1.25rem + 3vw, 4rem);
}

.simple h1 + p {
  margin-top: 0.75rem;
}

.simple h1 + .contact-lead {
  margin-top: 1.5rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--ink-3);
}

.contact-lead {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-block: 1.25rem 0.5rem;
}

.contact-lead strong {
  font-weight: 500;
}

.contact-lead a {
  display: inline-block;
  text-decoration-thickness: 2px;
}

.simple .prose {
  margin-top: 1.5rem;
}

/* ---------- prose (policy and simple pages) ---------- */

.prose {
  max-width: 68ch;
}

.prose > * + *,
.doc-section > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.75rem;
  scroll-margin-top: 1.5rem;
}

.prose h2 + * {
  margin-top: 0.875rem;
}

.prose ul,
.prose ol {
  padding-left: 1.375rem;
}

.prose li + li {
  margin-top: 0.375rem;
}

.prose ul li::marker {
  color: var(--green-fill);
}

.prose ol li::marker {
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.todo {
  background: var(--wash);
  color: var(--rust-dark);
  border: 1px dashed var(--rust-ring);
  border-radius: 6px;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  line-height: 1.4;
  padding: 0.1em 0.4em;
  font-size: 0.9375em;
}

/* tables: a card; on narrow screens every row becomes a small labelled block */

.table {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
}

thead th {
  font-size: 0.8125rem;
  color: var(--ink-3);
  background: var(--fill);
  border-bottom: 1px solid var(--line);
}

tbody tr + tr td {
  border-top: 1px solid var(--row);
}

td:first-child {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 40rem) {
  .table {
    overflow: visible;
  }

  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table tr,
  .table td {
    display: block;
  }

  .table tbody tr {
    padding: 0.875rem 1rem;
  }

  .table tbody tr + tr {
    border-top: 1px solid var(--row);
  }

  .table td {
    padding: 0;
    border: 0;
  }

  .table tbody tr + tr td {
    border-top: 0;
  }

  .table td + td {
    margin-top: 0.375rem;
    font-weight: 400;
  }

  .table td + td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-3);
  }
}

/* ---------- privacy policy ---------- */

.doc-layout {
  display: grid;
  gap: 2rem;
  padding-top: clamp(2rem, 1.25rem + 3vw, 4rem);
}

.doc-head {
  display: grid;
  gap: 1rem;
  max-width: 46rem;
}

.doc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-3);
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--rust-bg);
  color: var(--rust-dark);
  border: 1px solid var(--rust-ring);
}

.sep {
  color: var(--ink-3);
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 1rem 1.25rem 1.125rem;
}

.toc__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  margin: -0.5rem 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.2;
}

.toc--full {
  display: none;
}

.toc--full .toc__title {
  margin-bottom: 0.25rem;
}

summary.toc__title {
  list-style: none;
  cursor: pointer;
}

.toc__title::-webkit-details-marker {
  display: none;
}

summary.toc__title::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-3px) rotate(45deg);
}

.toc[open] .toc__title::after {
  transform: translateY(2px) rotate(-135deg);
}

.toc[open] .toc__title {
  margin-bottom: 0.25rem;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
}

.toc li {
  break-inside: avoid;
}

.toc a {
  display: block;
  padding-block: 0.3125rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.doc-aside {
  max-width: 68ch;
}

.doc {
  min-width: 0;
}

.doc-section {
  margin: 0;
}

.doc-section + .doc-section {
  margin-top: 2.75rem;
}

.doc-section h2 {
  margin-top: 0;
}

.doc-section--w-skrocie {
  padding: 1.25rem 1.375rem 1.375rem;
  border-radius: var(--radius-card);
  background: var(--green-soft);
  border: 1px solid var(--green-ring);
}

.doc-section--w-skrocie ul {
  padding-left: 1.25rem;
}

.doc-section--w-skrocie li::marker {
  color: var(--green);
}

.doc-section--historia-zmian {
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

@media (min-width: 40rem) {
  .toc ol {
    columns: 2;
    column-gap: 2rem;
  }
}

@media (min-width: 68rem) {
  .doc-layout {
    grid-template-columns: 17rem minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "aside doc";
    column-gap: 4rem;
    row-gap: 3rem;
  }

  .doc-head {
    grid-area: head;
  }

  .doc-aside {
    grid-area: aside;
    max-width: none;
  }

  .doc {
    grid-area: doc;
  }

  .toc {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
  }

  .toc--compact {
    display: none;
  }

  .toc--full {
    display: block;
  }

  .toc ol {
    columns: 1;
  }
}

/* ---------- usun-konto ---------- */

.steps-page ol {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0.625rem;
}

.steps-page ol li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  margin: 0;
}

.steps-page ol li::before {
  content: counter(step);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.1rem);
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.25rem;
  padding-block: clamp(3rem, 2rem + 6vw, 7rem) 0;
  text-align: center;
}

.lost__art {
  width: 132px;
  height: auto;
  margin-bottom: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius-button);
  background: var(--green-fill);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms ease-out;
}

.button:hover {
  background: var(--green-dark);
  color: var(--on-accent);
}

@media (prefers-reduced-motion: reduce) {
  a,
  .button {
    transition: none;
  }
}

.nowrap {
  white-space: nowrap;
}
