:root {
  /* dark is the default */
  --bg: #0d0f10;
  --surface: #15181a;
  --text: #eef2f0;
  --muted: #9ba7a2;
  --line: #262b2d;
  --brand: #4fb386;
  --brand-dark: #7fd1ab;
  --brand-soft: #16271f;
  --accent: #58958d;
  --ink: #0d0f10;
  --tip-bg: #112119;
  --tip-line: #4fb386;
  --warn-bg: #2a2310;
  --warn-line: #f0a020;
  --radius: 14px;
  --shadow: none;
  color-scheme: dark;

  /* fluid type scale (320px to 1440px viewport) */
  --fs-sm: clamp(.8rem, .76rem + .2vw, .9rem);
  --fs-0: clamp(.95rem, .9rem + .25vw, 1.06rem);
  --fs-md: clamp(1rem, .95rem + .3vw, 1.15rem);
  --fs-lg: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  --fs-xl: clamp(1.45rem, 1.15rem + 1.5vw, 2.15rem);
  --fs-hero: clamp(1.75rem, 1.2rem + 2.8vw, 3.1rem);
  /* fluid spacing scale */
  --sp-xs: clamp(.4rem, .35rem + .25vw, .6rem);
  --sp-s: clamp(.65rem, .55rem + .5vw, 1rem);
  --sp-m: clamp(1rem, .85rem + .75vw, 1.5rem);
  --sp-l: clamp(1.5rem, 1.15rem + 1.75vw, 2.6rem);
  --sp-xl: clamp(2rem, 1.3rem + 3.5vw, 4.2rem);
  --gutter: clamp(1rem, .6rem + 2vw, 2.25rem);
  --step: clamp(1.9rem, 1.7rem + .7vw, 2.3rem);
  --bar-h: clamp(3.4rem, 3.1rem + 1.4vw, 4.4rem);
}
:root[data-theme="light"] {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #101413;
  --muted: #56615d;
  --line: #e0e8e5;
  --brand: #317e5d;
  --brand-dark: #1f5a41;
  --brand-soft: #e6f2ec;
  --tip-bg: #ecf7f1;
  --tip-line: #317e5d;
  --warn-bg: #fff7e6;
  --shadow: 0 1px 2px rgba(13, 15, 16, .06), 0 6px 20px rgba(13, 15, 16, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-0)/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: .1em .4em;
  border-radius: 6px;
  font-size: .9em;
}

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

/* header */
.topbar { background: var(--ink); border-bottom: 1px solid #1d2123; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-s); min-height: var(--bar-h); }

.logo { display: inline-flex; align-items: center; gap: var(--sp-s); color: #fff; min-width: 0; }
.logo:hover { text-decoration: none; }
.logo-full { height: clamp(1.7rem, 1.35rem + 1.4vw, 2.6rem); width: auto; display: block; flex: none; }
.logo-tag {
  font-weight: 700; font-size: clamp(.58rem, .5rem + .35vw, .8rem); letter-spacing: .08em; text-transform: uppercase; color: #7fd1ab;
  border-left: 2px solid #2a3033; padding-left: var(--sp-s); line-height: 1.2; white-space: nowrap;
}
.lang { display: inline-flex; border: 1px solid #2a3033; border-radius: 999px; overflow: hidden; }
.lang button {
  border: 0; background: transparent; color: #a8b3ae;
  padding: .4rem clamp(.6rem, .45rem + .6vw, .95rem); min-height: 2.25rem; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.lang button.on { background: var(--brand); color: #fff; }
.lang button:hover:not(.on) { color: #fff; }

/* hero */
.hero { padding: var(--sp-xl) 0 var(--sp-l); text-align: center; }
.hero-title { margin: 0 0 var(--sp-xs); font-size: var(--fs-hero); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.hero p { margin: 0 auto var(--sp-m); color: var(--muted); max-width: 36rem; font-size: var(--fs-md); }
.search { position: relative; max-width: 38rem; margin: 0 auto; }
.search input {
  width: 100%; padding: clamp(.8rem, .7rem + .4vw, 1rem) var(--sp-m) clamp(.8rem, .7rem + .4vw, 1rem) clamp(2.8rem, 2.5rem + 1vw, 3.2rem); font: inherit; min-width: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.search input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.search svg { position: absolute; left: var(--sp-m); top: 50%; transform: translateY(-50%); color: var(--muted); }

/* cards */
.section-title { margin: var(--sp-l) 0 var(--sp-s); font-size: var(--fs-md); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.grid { display: grid; gap: var(--sp-s); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-m); color: var(--text);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.card h3 { margin: 0 0 .25rem; font-size: var(--fs-md); line-height: 1.35; }
.card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.cat-card .ico { font-size: var(--fs-xl); display: block; margin-bottom: var(--sp-xs); }
.cat-card .count { margin-top: var(--sp-xs); font-size: var(--fs-sm); color: var(--brand); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-xs); margin: var(--sp-m) 0 var(--sp-xs); }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .45rem clamp(.75rem, .6rem + .6vw, 1.1rem); min-height: 2.5rem; border-radius: 999px; font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.list { display: grid; gap: var(--sp-xs); }
.row {
  display: flex; align-items: center; gap: var(--sp-s); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: var(--sp-s) var(--sp-m); color: var(--text);
}
.row:hover { border-color: var(--brand); text-decoration: none; }
.row .ico { font-size: var(--fs-lg); flex: none; }
.row b { display: block; font-size: var(--fs-0); }
.row small { color: var(--muted); font-size: var(--fs-sm); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* article */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-l) var(--sp-l); box-shadow: var(--shadow); margin-top: var(--sp-m); }
.back { display: inline-block; margin-top: var(--sp-m); font-weight: 600; }
.article .crumb { color: var(--brand); font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; }
.article h1 { margin: .4rem 0 var(--sp-xs); font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.015em; }
.article .lead { color: var(--muted); margin: 0 0 var(--sp-m); font-size: var(--fs-md); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 var(--sp-m); }
.steps li {
  counter-increment: s; position: relative; padding: 0 0 var(--sp-m) calc(var(--step) + var(--sp-s)); min-height: var(--step);
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: var(--step); height: var(--step);
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: var(--fs-sm);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(var(--step) / 2 - 1px); top: calc(var(--step) + 4px); bottom: 4px; width: 2px; background: var(--line);
}
.callout { border-left: 4px solid; border-radius: 10px; padding: var(--sp-s) var(--sp-m); margin: var(--sp-s) 0; font-size: var(--fs-0); }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-line); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.callout b.k { display: block; margin-bottom: 2px; }

/* help footer */
.help {
  margin: var(--sp-xl) 0 0; background: var(--brand); color: #fff; border-radius: var(--radius);
  padding: var(--sp-l); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-s);
}
.help h3 { margin: 0 0 2px; }
.help p { margin: 0; opacity: .9; }
.help a.btn {
  background: #fff; color: var(--brand-dark); padding: .65rem clamp(1rem, .8rem + 1vw, 1.5rem); border-radius: 999px; font-weight: 700; display: inline-block;
}
.help-actions { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }
.help a.btn:hover { text-decoration: none; opacity: .92; }
footer { color: var(--muted); font-size: var(--fs-sm); text-align: center; padding: var(--sp-l) var(--gutter) var(--sp-xl); }

/* article toolbar */
.article-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-s); margin-top: var(--sp-m); }
.article-bar .back { margin-top: 0; }

/* step screenshots */
.shot { margin: var(--sp-xs) 0 0; }
.shot img {
  display: block; max-width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: 10px; cursor: zoom-in; box-shadow: var(--shadow);
}
.lb {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 24, .88);
  display: grid; place-items: center; padding: 20px; cursor: zoom-out;
}
.lb img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* video */
.video { margin: 0 0 var(--sp-m); }
.video video { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #000; }

/* feedback widgets */
.helpful {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: var(--sp-l); padding-top: var(--sp-m); border-top: 1px solid var(--line);
}
.helpful.done { justify-content: flex-start; color: var(--muted); }
.helpful form, .suggest form { width: 100%; display: grid; gap: var(--sp-xs); }
.helpful textarea, .suggest textarea, .suggest input {
  width: 100%; padding: var(--sp-s); font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
.helpful textarea:focus, .suggest textarea:focus, .suggest input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.helpful form .chip, .suggest form .chip { justify-self: start; }
.vote-count { color: var(--muted); font-size: .88rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { margin: 0; color: var(--muted); font-size: .92rem; }
.suggest {
  margin-top: var(--sp-xl); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: var(--sp-m) var(--sp-l); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-s);
}
.suggest h3 { margin: 0 0 2px; }
.suggest p { margin: 0; color: var(--muted); }
.suggest + .help { margin-top: var(--sp-m); }
.chip:disabled { opacity: .6; cursor: default; }


/* print: a clean one-page guide */
@media print {
  :root, :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #bbb;
    --brand: #222; --brand-dark: #222; --brand-soft: #eee; --tip-bg: #f2f2f2; --warn-bg: #f2f2f2; --shadow: none;
  }
  body { background: #fff; font-size: 12pt; }
  .topbar, .hero, .article-bar, .help, .suggest, .helpful, .video, footer, .section-title, .list, .lang { display: none !important; }
  .article { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .steps li { break-inside: avoid; }
  .steps li::before { background: #222; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .callout { break-inside: avoid; border: 1px solid #999; border-left-width: 4px; }
  .shot img { box-shadow: none; max-height: 8cm; width: auto; }
  main::after { content: "generate.gr"; display: block; margin-top: 24px; color: #666; font-size: 10pt; }
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.hero-title, .hero p, .search { animation: rise .5s ease both; }
.hero p { animation-delay: .06s; }
.search { animation-delay: .12s; }
.grid .card, .list .row { animation: rise .45s ease both; }
.grid .card:nth-child(1), .list .row:nth-child(1) { animation-delay: .10s; }
.grid .card:nth-child(2), .list .row:nth-child(2) { animation-delay: .16s; }
.grid .card:nth-child(3), .list .row:nth-child(3) { animation-delay: .22s; }
.grid .card:nth-child(4), .list .row:nth-child(4) { animation-delay: .28s; }
.grid .card:nth-child(n+5), .list .row:nth-child(n+5) { animation-delay: .34s; }
.article { animation: rise .45s ease both; }
.steps li { animation: fade .5s ease both; }
.steps li:nth-child(1) { animation-delay: .10s; } .steps li:nth-child(2) { animation-delay: .16s; }
.steps li:nth-child(3) { animation-delay: .22s; } .steps li:nth-child(n+4) { animation-delay: .28s; }
.card, .row, .chip, .help a.btn { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.row:hover { transform: translateX(3px); }
.help a.btn:hover { transform: translateY(-1px); }

/* ---------- preloader (first visit of a session, under 1 second) ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 100; background: var(--ink);
  display: grid; place-content: center; justify-items: center; gap: 22px;
  transition: opacity .4s ease, visibility .4s ease;
}
#preloader.out { opacity: 0; visibility: hidden; }
#preloader img { width: min(260px, 62vw); height: auto; animation: plIn .7s cubic-bezier(.2, .8, .2, 1) both; }
#preloader .pl-bar { width: min(160px, 40vw); height: 3px; border-radius: 3px; background: #1d2123; overflow: hidden; }
#preloader .pl-bar::after { content: ""; display: block; height: 100%; width: 40%; border-radius: 3px; background: #4fb386; animation: plBar 1s ease-in-out infinite; }
@keyframes plIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes plBar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  #preloader { display: none; }
}
@media print { #preloader { display: none !important; } }

/* header tools + theme button */
.tools { display: flex; align-items: center; gap: var(--sp-xs); flex: none; }
.theme-btn {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid #2a3033; background: transparent; color: #a8b3ae; transition: color .18s, border-color .18s;
}
.theme-btn:hover { color: #fff; border-color: #4a5256; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }

/* search stays on screen: shrinks on guide pages */
.hero { transition: padding .25s ease; }
.hero.compact { padding: var(--sp-m) 0 0; }
.hero.compact .hero-title, .hero.compact p { display: none; }
#view { animation: fade .3s ease both; min-height: 40vh; }

/* ---------- fluid extras ---------- */
@media (min-width: 1800px) { :root { --fs-0: 1.12rem; } .wrap { max-width: 78rem; } }
@media (hover: none) { .card:hover, .row:hover { transform: none; } }
.row > span:last-child, .card { min-width: 0; }
.row b, .row small, .card h3, .card p { overflow-wrap: anywhere; }
