:root {
  --fg: #303133;
  --bg: #ffffff;
  --border: #ddd;
  --max: 1100px;
  --pad: 28px;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Topbar + header */
.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: none;
  z-index: 1000;
  width: 100%;
}
.header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Bas-brand (används även av brand--fit) */
.brand{
  font: 700 15px/1 "Inter", sans-serif; /* 15px, vikt 700 */
  text-decoration: none;
  color: var(--fg);
  text-transform: lowercase;
  letter-spacing: -0.01em; /* fix: little tighter */
}

/* Final text-only logotype (med mjuk in/ut-övergång) */
.brand--final{
  font: 700 15px/1 "Inter", sans-serif;
  letter-spacing: 0;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--fg);

  /* långsammare ut (mouseleave) */
  transition: color .60s ease-out;
}

/* de två bokstäver som ska stanna svarta */
.brand--final .keep{
  transition: color .60s ease-out; /* samma långsammare ut */
}

/* IN: snabbare till grått när man hovrar */
.brand--final:hover{
  color: #999;
  transition: color .22s ease-in;   /* snabb in */
}

/* IN: a och i stannar svarta (snabb in) */
.brand--final:hover .keep{
  color: var(--fg);
  transition: color .22s ease-in;
}

/* respekt för reduced motion */
@media (prefers-reduced-motion: reduce){
  .brand--final, .brand--final .keep,
  .brand--final:hover, .brand--final:hover .keep{
    transition: none;
  }
}
/* Navigation */
.nav a {
  font: 600 15px/1 "Inter", sans-serif;
  text-decoration: none;
  color: var(--fg);
  margin-left: 20px;
  text-transform: lowercase;
}

/* Layout */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.spacer-top { margin-top: clamp(60px, 12vh, 140px); }

/* Headings */
.h-section {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(25px, 6vw, 60px);
  line-height: 1.1;
  margin: 0 0 28px 0;
  color: var(--fg);
}

/* Text */
p { margin: 0 0 18px 0; }
.intro { max-width: 760px; margin: 0 auto 40px auto; }

/* About layout */
.about-centered {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 60px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.about-centered img { width: 220px; border-radius: 8px; }
.about-centered div { max-width: 500px; }
.links a {
  font: 600 15px/1 "Inter", sans-serif;
  color: var(--fg);
  margin-right: 18px;
  text-decoration: none;
  text-transform: lowercase;
}

/* Chat box */
.chat-box-mini {
  margin: 30px auto 0 auto;
  max-width: 700px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font: 600 15px/1 "Inter", sans-serif;
  text-align: center;
  text-transform: lowercase;
  color: #4d4d4d;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chat-box-mini:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #eee;
  text-align: center;
  text-transform: lowercase;
}

/* Hover underline (nav, links, footer) */
.nav a, .links a, .footer a {
  position: relative;
  text-decoration: none;
  color: var(--fg);
  transition: color 0.4s ease;
}
.nav a:hover, .links a:hover, .footer a:hover { color: #999; }

.nav a::after, .links a::after, .footer a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 70%;
  height: 2px;
  border-radius: 2px;
  background: rgba(153, 153, 153, 0.7);
  opacity: 0;
  transform: scaleX(0) translateX(-50%);
  transform-origin: center;
  transition: transform 0.45s ease, opacity 0.45s ease, background-color 0.45s ease;
}
.nav a:hover::after, .links a:hover::after, .footer a:hover::after {
  opacity: 1;
  transform: scaleX(1) translateX(-50%);
  transition: transform 0.45s ease 0.1s, opacity 0.45s ease 0.1s, background-color 0.45s ease;
}

/* Responsive */
@media(max-width:700px){
  .about-centered{ flex-direction: column; align-items: center; text-align: center; }
}