/* Freelance OS website: shared base (tokens, header, buttons, windows, legal pages). Home sections live in home.css.
   World: the game's own OS. A blue desktop wallpaper, cream windows with coloured title bars, a navy taskbar.
   Colours and radii come from lib/app/theme/tokens.dart. */
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-Variable.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --wall: #4A7BD0;
  --wall-ledge: #3A63AB;
  --navy: #2D3A55;
  --navy-tile: #3C4A6B;
  --navy-text: #C3CCE2;
  --ink: #3D405B;
  --muted: #666B84;
  --window: #FFFFFF;
  --cream: #F7EFE4;
  --cream-line: #E2D6C6;
  --coral: #BC5234;
  --coral-ledge: #94401F;
  --blue: #3F6DBD;
  --gold: #FFD166;
  --warm-secondary: #F2CC8F;
  --green: #8DBBA5;
  --pad: clamp(14px, 3vw, 32px);
  --r: 18px;
  --t-small: 14px;
  --t-body: clamp(16px, 15.4px + .22vw, 18px);
  --t-lead: clamp(18px, 16px + .6vw, 22px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

/* Language switching: every text exists in both languages, the inactive one is hidden. */
html[data-lang="uk"] .en { display: none !important; }
html[data-lang="en"] .uk { display: none !important; }

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  scrollbar-color: var(--navy) var(--wall);
  background: var(--wall);
}
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: var(--t-body);
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; text-underline-offset: .2em; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 900; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--pad); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -80px; z-index: 60; background: var(--gold); color: var(--ink); padding: 10px 18px; border-radius: 12px; font-weight: 800; }
.skip:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.win :focus-visible, .doc :focus-visible { outline-color: var(--blue); }

/* Buttons: the game's "juicy" button, with a ledge that the press pushes down */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 26px; border: 0; border-radius: 14px;
  background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-ledge);
  font-weight: 800; font-size: var(--t-body); text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease;
}
.btn:hover { background: #A8482B; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--coral-ledge); }
.btn-small { min-height: 44px; padding: 8px 18px; font-size: var(--t-small); box-shadow: 0 3px 0 var(--coral-ledge); }
.btn-wide { width: 100%; }

/* Header: the game's status bar */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--navy); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 900; font-size: 19px; }
.brand img { border-radius: 10px; }
.nav { display: flex; gap: 22px; margin-left: 12px; font-weight: 700; font-size: var(--t-small); }
.nav a { color: var(--navy-text); text-decoration: none; padding: 10px 0; }
.nav a:hover { color: #fff; }
.header-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.lang { display: flex; background: var(--navy-tile); border-radius: 12px; padding: 3px; }
.lang button {
  border: 0; cursor: pointer; font-weight: 800; font-size: var(--t-small); min-width: 46px; min-height: 38px;
  border-radius: 10px; background: transparent; color: var(--navy-text); transition: background-color .2s ease, color .2s ease;
}
.lang button[aria-pressed="true"] { background: #fff; color: var(--ink); }

/* Window: coloured title bar + white body + a ledge, like the game's apps */
.win { background: var(--window); border-radius: var(--r); box-shadow: 0 6px 0 var(--wall-ledge); overflow: hidden; color: var(--ink); }
.tb { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; background: var(--c, var(--navy)); color: var(--on, #fff); }
.tb-ico { display: inline-flex; flex: none; width: 24px; height: 24px; }
.tb-ico svg, .dock svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: 0; line-height: 1.2; }
.tb-btns { display: flex; gap: 8px; }
.tb-btns i { width: 22px; height: 22px; border-radius: 7px; background: rgba(0, 0, 0, .16); position: relative; }
.tb-btns i:first-child::after { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; margin-top: -1px; background: currentColor; border-radius: 1px; }
.tb-btns i:last-child::after { content: ''; position: absolute; inset: 6px; border: 2px solid currentColor; border-radius: 2px; }
.win-body { padding: clamp(16px, 3vw, 32px); }

/* Legal pages and 404 */
.doc { max-width: 880px; margin: 32px auto 120px; padding: clamp(18px, 4vw, 40px); display: flex; flex-direction: column; gap: 22px; background: var(--window); border-radius: var(--r); box-shadow: 0 6px 0 var(--wall-ledge); }
.doc h1 { font-size: clamp(30px, 6vw, 48px); }
.doc h2 { font-size: 21px; line-height: 1.2; letter-spacing: 0; }
.doc-date { font-size: var(--t-small); font-weight: 700; color: var(--muted); }
.doc .lead { font-size: var(--t-lead); line-height: 1.4; font-weight: 600; }
.doc section { background: var(--cream); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.doc section p, .doc section li { font-size: 17px; }
.doc a { color: #2F5DB0; font-weight: 700; }
.doc ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.doc-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-tabs a {
  font-weight: 800; border-radius: 12px; padding: 8px 18px; min-height: 44px; display: inline-flex; align-items: center;
  text-decoration: none; color: var(--ink); background: var(--cream); transition: background-color .2s ease, color .2s ease;
}
.doc-tabs a:hover { background: var(--cream-line); }
.doc-tabs a[aria-current="page"] { background: var(--navy); color: #fff; }
.big-404 { font-size: clamp(96px, 22vw, 220px); font-weight: 1000; line-height: .8; color: var(--coral); }
.doc .btn { color: #fff; }

@media (max-width: 760px) {
  .nav { display: none; }
  .site-header .wrap { gap: 12px; }
  .brand { font-size: 18px; }
  .head-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
