/* fnr.dev — shared tokens, nav, buttons, forms, footer and mascot.
   Every public page loads this first, then its own page stylesheet. */

:root{
  --bg: #F3F1E9;
  --bg-tint: #EAE9E3;
  --card: #FFFFFF;
  --ink: #10131C;
  --ink-soft: #2A2E3A;
  --muted: #666A72;
  --line: rgba(16,19,28,0.10);
  --line-strong: rgba(16,19,28,0.18);
  --accent: #4A4E58;
  --spark: #F5A524;
  --spark-soft: #FCEBC8;
  --ok: #2F6B4A;
  --err: #9B3B2E;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 44px -30px rgba(16,19,28,0.45);
  --shadow-lg: 0 28px 70px -30px rgba(16,19,28,0.5);
  --grid:
    linear-gradient(rgba(16,19,28,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,19,28,0.055) 1px, transparent 1px);
  --grid-dark:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: 84px; }

body{
  margin: 0;
  background-color: var(--bg);
  background-image: var(--grid);
  background-size: 42px 42px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main{ flex: 1; }

h1, h2, h3, .display{
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

a{ color: inherit; }
img{ max-width: 100%; }
.mono{ font-family: var(--font-mono); }
[hidden]{ display: none !important; }

.wrap{
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
}

.kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.kicker::before{
  content: '';
  width: 8px;
  height: 8px;
  background: var(--spark);
  box-shadow: 0 0 0 2px var(--ink);
}

.skip-link{
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus{ top: 12px; }

/* ─── Nav ─── */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(243,241,233,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow .25s ease, background .25s ease;
}
.site-nav.is-scrolled{
  box-shadow: 0 1px 0 var(--line);
  background: rgba(243,241,233,0.95);
}
.site-nav .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.logo{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo img{
  width: 34px;
  height: auto;
  image-rendering: pixelated;
  transition: transform .2s ease;
}
.logo:hover img{ transform: translateY(-2px) rotate(-4deg); }
.nav-links{ display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav-links a{ text-decoration: none; color: var(--muted); transition: color .15s ease; }
.nav-links a.btn{ color: #fff; }
.nav-links a:not(.btn):hover,
.nav-links a.is-active,
.nav-links a[aria-current="page"]{ color: var(--ink); }

/* ─── Buttons ─── */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font: 500 15px/1.3 var(--font-body);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover{ background: var(--ink-soft); transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(16,19,28,0.6); }
.btn.ghost{ background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover{ background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.small{ padding: 8px 14px; font-size: 14px; }
.btn:disabled{ opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible{
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.text-link{
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.text-link:hover{ text-decoration-color: var(--ink); }

/* ─── Cards & forms ─── */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field{ display: grid; gap: 8px; }
label{ font-size: 14px; font-weight: 500; color: var(--ink); }
input, textarea, select{
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
input:hover, textarea:hover, select:hover{ border-color: var(--line); }
input:focus, textarea:focus, select:focus{
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(16,19,28,0.08);
  outline: none;
}
textarea{ resize: vertical; min-height: 110px; }
select{ cursor: pointer; }
input[type="checkbox"]{ width: auto; accent-color: var(--ink); }

/* ─── Mascot ─── */
.fenrir{
  display: block;
  image-rendering: pixelated;
  width: 88px;
  height: auto;
}
.fenrir.is-small{ width: 44px; }
.fenrir.is-bob{ animation: fenrir-bob 3.2s ease-in-out infinite; }
@keyframes fenrir-bob{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}

/* ─── Footer ─── */
.site-footer{
  background: var(--ink);
  color: #C7C9D1;
  padding: 22px 0 16px;
  font-size: 14px;
}
.site-footer a{ color: #C7C9D1; text-decoration: none; transition: color .15s ease; }
.site-footer a:hover{ color: #fff; }
.footer-main{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer .logo{ color: #fff; font-size: 16px; gap: 8px; }
.site-footer .logo img{ width: 26px; }
.footer-links{ display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer .footer-mail{ color: #fff; font-weight: 500; }
.footer-bottom{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  flex-wrap: wrap;
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #7C808A;
}
.footer-bottom p{ margin: 0; }
.footer-legal{ display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer .footer-legal a{ color: #9599A2; }
.site-footer .footer-legal a:hover{ color: #fff; }

/* ─── Reveal on scroll ─── */
html.js .reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
html.js .reveal.is-in{ opacity: 1; transform: none; }
.reveal-delay-1{ transition-delay: .08s; }
.reveal-delay-2{ transition-delay: .16s; }
.reveal-delay-3{ transition-delay: .24s; }


@media (max-width: 680px){
  .footer-main{ flex-direction: column; align-items: flex-start; }
  .footer-links{ gap: 4px 16px; }
  body{ font-size: 16px; }
  .wrap{ padding: 0 20px; }
  .nav-links{ gap: 14px; font-size: 14px; }
  .nav-links .nav-hide-sm{ display: none; }
  .nav-links .btn{ padding: 8px 13px; }
  .logo img{ width: 30px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation: none !important; transition: none !important; }
  html.js .reveal{ opacity: 1; transform: none; }
}

/* ─── Language menu (flag button) ─── */
.lang-menu{ position: relative; }
.lang-menu summary{
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(16,19,28,0.06);
  transition: background .15s ease;
  user-select: none;
}
.lang-menu summary::-webkit-details-marker{ display: none; }
.lang-menu summary:hover,
.lang-menu[open] summary{ background: rgba(16,19,28,0.11); }
.flag{
  display: block;
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(16,19,28,0.18);
  flex-shrink: 0;
}
.lang-menu .chev{
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  color: var(--ink);
  transition: transform .15s ease;
}
.lang-menu[open] .chev{ transform: rotate(180deg); }
.lang-list{
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 170px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
}
.nav-links .lang-list a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink);
  font-size: 14.5px;
  text-decoration: none;
}
.nav-links .lang-list a:hover{ background: var(--bg); }
.nav-links .lang-list a[aria-current="true"]{ font-weight: 600; }
.nav-links .lang-list a[aria-current="true"]::after{
  content: '';
  margin-left: auto;
  width: 4px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translate(-2px, -2px);
}
@media (max-width: 680px){
  .nav-links:has(.lang-menu) a[href*="/builder"]{ display: none; }
}
@media (max-width: 360px){
  .logo span, .logo{ font-size: 0; gap: 0; }
}
