/* =============================================================================
   TOMASZ FRYZEL — DESIGN SYSTEM · COMPONENTS
   =============================================================================
   The third layer. Components are built ONLY from tokens — never raw values.
       tokens.css  →  base.css  →  components.css
   ========================================================================== */


/* --- Button --------------------------------------------------------------
   Red and white, like the flag. Filled in Polska Red at rest; on hover the two
   colours swap — white fill, red text, red outline. The 1px border exists in
   BOTH states, so the inversion animates with zero size shift.
   Height is pinned to the scale (--space-48), NOT left to accumulate from
   padding + border (that is what produced the off-grid 46px before).          */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--font-sans);
  font-size:var(--size-body);
  font-weight:var(--weight-medium);
  line-height:1;
  letter-spacing:var(--track-slight);
  height:var(--space-48);              /* 48px straight from the scale */
  padding:0 var(--space-24);           /* horizontal only — height owns the vertical */
  background:var(--color-red);
  color:var(--color-on-red);
  border:1px solid var(--color-red);
  cursor:pointer;
  text-decoration:none;
  transition:background-color .16s ease, color .16s ease, border-color .16s ease;
}

/* Hover = the inversion: the two flag colours swap.
   .is-hover mirrors it so the styleguide can show the state statically. */
.btn:hover,
.btn.is-hover{
  background:var(--color-on-red);   /* white */
  color:var(--color-red);           /* red   */
  border-color:var(--color-red);
}

/* Disabled — neutral grey, never red */
.btn:disabled,
.btn[aria-disabled="true"]{
  background:var(--color-surface-sunken);
  border-color:var(--color-surface-sunken);
  color:var(--color-text-muted);
  cursor:not-allowed;
}

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


/* --- Project card --------------------------------------------------------
   Editorial / type-led — the work is the hero, type does the talking. Square,
   1px hairline, quiet by default. ONE project per view can be FEATURED in
   Polska Red (the flag): that is how red enters content — a single bold card,
   never sprinkled accents.                                                    */
.card{
  display:flex; flex-direction:column;
  background:var(--color-surface);
  border:1px solid var(--color-border);
  padding:var(--space-32);
  color:var(--color-text);
  text-decoration:none;
  transition:border-color .16s ease;
}
.card__meta{ color:var(--color-text-secondary); }
.card__title{ margin-top:var(--space-12); }
.card__desc{ margin-top:var(--space-12); margin-bottom:var(--space-24); color:var(--color-text-secondary); }
.card__more{
  margin-top:auto;                                  /* pin CTA to the bottom */
  display:inline-flex; align-items:center; gap:var(--space-8);
  font-weight:var(--weight-medium);
}
.card__arrow{                               /* the link arrow — a system icon, recolours with the text */
  display:inline-block; width:13px; height:12px;
  background-color:currentColor;
  -webkit-mask:url("assets/icons/arrow.svg") no-repeat center / contain;
          mask:url("assets/icons/arrow.svg") no-repeat center / contain;
  transition:transform .16s ease;
}

.card:hover{ border-color:var(--color-text); }            /* hairline → ink */
.card:hover .card__arrow{ transform:translateX(4px); }

/* Featured — Polska Red, white text (the flag). One per view, max. */
.card--featured{
  background:var(--color-red);
  border-color:var(--color-red);
  color:var(--color-on-red);
}
.card--featured .card__meta,
.card--featured .card__desc{ color:var(--color-on-red); }  /* white; hierarchy via type */
.card--featured:hover{ border-color:var(--color-on-red); } /* white hairline on hover */

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


/* --- Navigation ----------------------------------------------------------
   Wordmark left; links + language toggle right. White, square, 1px bottom
   hairline, height pinned to the scale. The nav's one red moment is the
   toggle — links stay quiet (ink).                                           */
.nav{ background:var(--color-bg); }   /* sits on the grey page — no white box */
.nav__inner{
  display:flex; align-items:center; justify-content:space-between;
  max-width:var(--container); margin:0 auto;
  height:var(--space-64); padding:0 var(--gutter);
}
.nav__logo{
  font-size:var(--size-lead);
  font-weight:var(--weight-black);
  letter-spacing:var(--track-snug);
  color:var(--color-text);
  text-decoration:none;
}
.nav__right{ display:flex; align-items:center; gap:var(--space-32); }
.nav__links{ display:flex; align-items:center; gap:var(--space-32); }
.nav__link{
  position:relative;
  color:var(--color-text);
  text-decoration:none;
  font-weight:var(--weight-medium);
}
.nav__link::after{                          /* animated underline */
  content:""; position:absolute; left:0; right:0; bottom:-4px; height:2px;
  background:var(--color-text);
  transform:scaleX(0); transform-origin:left;
  transition:transform .16s ease;
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after{ transform:scaleX(1); }


/* --- Language link (EN ⇄ PL) ---------------------------------------------
   A plain text link: shows the invitation in the language you'd switch to —
   "Mówisz po polsku" in English mode, "Speak English" in Polish. Click swaps it.
   Pure CSS, no animation. Simple on purpose.                                 */
.lang-link{
  cursor:pointer;
  font-size:var(--size-meta); line-height:var(--lh-meta);
  font-weight:var(--weight-medium); color:var(--color-text);
}
.lang-link__input{ position:absolute; opacity:0; width:0; height:0; }
.lang-link__face--en{ display:none; }
.lang-link__input:checked ~ .lang-link__face--pl{ display:none; }
.lang-link__input:checked ~ .lang-link__face--en{ display:inline; }
.lang-link:hover{ text-decoration:underline; text-underline-offset:4px; }
.lang-link__input:focus-visible ~ .lang-link__face{ outline:2px solid var(--color-focus); outline-offset:3px; }

@media (prefers-reduced-motion: reduce){
  .nav__link::after{ transition:none; }
}


/* --- Form ----------------------------------------------------------------
   Square, hairline fields on the system. Labels in meta caps; a comments box
   that grows; the red button is the one bold note.                          */
.form{ display:grid; gap:var(--space-24); max-width:560px; }
.form__row{ display:grid; grid-template-columns:1fr 1fr; gap:var(--space-24); }
.field{ display:flex; flex-direction:column; }
.field__label{
  font-size:var(--size-meta); line-height:var(--lh-meta);
  font-weight:var(--weight-medium); letter-spacing:var(--track-wide);
  text-transform:uppercase; color:var(--color-text-secondary);
  margin-bottom:var(--space-8);
}
.input, .textarea{
  width:100%;
  font-family:var(--font-sans); font-size:var(--size-body); color:var(--color-text);
  background:var(--color-surface);
  border:1px solid var(--color-border-strong);
  transition:border-color .16s ease;
}
.input{ height:var(--space-48); padding:0 var(--space-16); }
.textarea{ padding:var(--space-16); line-height:var(--lh-body); min-height:var(--space-128); resize:vertical; }
.input::placeholder, .textarea::placeholder{ color:var(--color-text-secondary); }  /* grey-500 = AA; on the gate the placeholder IS the only visible label */
.input:focus, .textarea:focus{ border-color:var(--color-text); outline:none; }  /* darker border, like card hover — no red ring */


/* --- Footer --------------------------------------------------------------
   The flag, full-bleed: a Polska-Red block in white type — the page's
   deliberate bold close, the one loud note at the bottom. All text is white
   (hierarchy comes from the type scale, which keeps every line AA on red).    */
.footer{
  background:var(--color-red);
  color:var(--color-on-red);
  padding:var(--space-96) 0 var(--space-48);          /* no side padding here … */
}
.footer__inner{ width:100%; max-width:var(--container); margin:0 auto; padding:0 var(--gutter); }  /* width:100% so flex parent can't shrink it; gutter inside, like .container */
.footer__top{
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:var(--space-64);
}
.footer__kicker{
  font-size:var(--size-meta); line-height:var(--lh-meta);
  font-weight:var(--weight-medium); letter-spacing:var(--track-wide);
  text-transform:uppercase; margin:0 0 var(--space-16);
}
.footer__email{
  display:inline-block;
  font-size:var(--size-h2); line-height:var(--lh-h2); letter-spacing:var(--track-snug);
  font-weight:var(--weight-medium);
  color:var(--color-on-red); text-decoration:none;
  border-bottom:2px solid transparent; transition:border-color .16s ease;
}
.footer__email:hover{ border-color:var(--color-on-red); }
.footer__cols{ display:flex; gap:var(--space-64); }
.footer__col{ display:flex; flex-direction:column; gap:var(--space-8); }
.footer__heading{
  font-size:var(--size-meta); line-height:var(--lh-meta);
  font-weight:var(--weight-medium); letter-spacing:var(--track-wide);
  text-transform:uppercase; margin:0 0 var(--space-8);
}
.footer__col a{ color:var(--color-on-red); text-decoration:none; width:fit-content; }
.footer__col a:hover{ text-decoration:underline; text-underline-offset:4px; }
.footer__bottom{
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:var(--space-24);
  margin-top:var(--space-96); padding-top:var(--space-24);
  border-top:1px solid rgba(255,255,255,.24);   /* a hairline on red (decorative) */
  font-size:var(--size-meta); line-height:var(--lh-meta);
}


/* -----------------------------------------------------------------------------
   RESPONSIVE — phones (≤720px): nav stacks (no hidden menu), fields & footer
   stack, every tap target ≥ 48px.
   -------------------------------------------------------------------------- */
@media (max-width: 720px){
  /* Nav: wordmark on top, links + language below — all links stay visible. */
  .nav__inner{ flex-direction:column; align-items:stretch; height:auto;
               padding-block:var(--space-12); gap:var(--space-8); }
  .nav__right{ width:100%; flex-wrap:wrap; justify-content:space-between; gap:var(--space-16); }
  .nav__links{ gap:var(--space-16); }
  /* 48px tap targets (≥ the 44px a11y minimum, and on-scale) */
  .nav__link, .lang-link{ display:inline-flex; align-items:center; min-height:var(--space-48); }

  .form__row{ grid-template-columns:1fr; }        /* stack name + email */

  .footer__top{ flex-direction:column; gap:var(--space-32); }
  .footer__cols{ gap:var(--space-48); }
}
