/* ============================================================
   undkonsorten — KI-Chat-Demo-Portfolio
   Design tokens taken from undkonsorten.com:
   Lato (body/headings) · Bitter (buttons) · dark green ground
   ============================================================ */

:root {
  --green-dark: #003300; /* page ground / hero (undkonsorten body bg) */
  --green-darker: #001a00; /* footer */
  --green-panel: #002900; /* code block on dark */
  --green: #a5bf3c; /* primary accent */
  --green-hover: #8ea434; /* link hover (undkonsorten) */
  --green-mid: #69aa5c; /* secondary green */
  --green-deep: #53601e; /* accent text on white */
  --amber: #ffae00; /* secondary accent */
  --ink: #0a0a0a;
  --ink-soft: #3d4a3d;
  --gray: #8a8a8a;
  --gray-light: #cacaca;
  --line: #e6e6e6;
  --white: #fff;

  --font-sans: 'Lato', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
  --font-serif: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-mono: Consolas, 'Liberation Mono', Courier, monospace;

  /* undkonsorten breakpoints: medium 40em · large 64em · xlarge 75em */
  --container: 71.25rem; /* 1140px */
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  padding: 0;
  background: var(--green-dark);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--green-deep);
}

img,
svg {
  max-width: 100%;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

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

/* Skip links (as on undkonsorten.com) */
.skip {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 100;
  background: var(--amber);
  color: var(--ink);
  padding: 0.5rem 1rem;
  font-weight: 700;
}
.skip:focus {
  left: 0;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.page-header {
  background: var(--green-dark);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--white);
  text-decoration: none;
}
.wordmark::after {
  content: '';
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.18em;
  border-radius: 50%;
  background: var(--green);
}

.main-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.25s ease-out;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--green);
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

@media (max-width: 64em) {
  .menu-btn {
    display: block;
  }
  .main-nav {
    width: 100%;
    display: none;
  }
  .main-nav.open {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.75rem;
  }
  .main-nav li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .main-nav a {
    display: block;
    padding: 0.65rem 0.1rem;
    font-size: 1.05rem;
  }
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  color: var(--white);
  padding: 4.5rem 0 9rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #003300 0%, #004400 55%, #00552a 100%);
}

.hero::before {
  /* abstract chat-bubble decoration */
  content: '';
  position: absolute;
  right: -6rem;
  top: -4rem;
  width: 26rem;
  height: 26rem;
  border: 2px solid rgba(165, 191, 60, 0.22);
  border-radius: 50% 50% 50% 12%;
}

.hero::after {
  content: '';
  position: absolute;
  right: 8rem;
  bottom: 3rem;
  width: 11rem;
  height: 11rem;
  border: 2px solid rgba(255, 174, 0, 0.28);
  border-radius: 12% 50% 50% 50%;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 47rem;
}

.hero .eyebrow {
  color: var(--amber);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  margin-bottom: 1rem;
}

.hero .subline {
  color: var(--gray-light);
  font-size: 1.15rem;
  max-width: 42rem;
  margin-bottom: 2.2rem;
}

@media (max-width: 40em) {
  .hero {
    padding: 3rem 0 7.5rem;
  }
  .hero::after {
    display: none;
  }
}

/* ------------------------------------------------------------
   Buttons (Bitter — as on undkonsorten.com)
   ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  padding: 0.8em 1.4em;
  border-radius: 3px;
  border: 1px solid transparent;
  background: var(--green);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.25s ease-out,
    color 0.25s ease-out,
    border-color 0.25s ease-out,
    transform 0.25s ease-out;
}
.btn:hover,
.btn:focus-visible {
  background: var(--green-hover);
  color: var(--ink);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--green);
  color: var(--white);
}

/* ------------------------------------------------------------
   Quick-link tiles (hero overlap)
   ------------------------------------------------------------ */
.tiles {
  margin-top: -5.5rem;
  position: relative;
  z-index: 2;
  padding-bottom: 1rem;
}

.tiles .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.4rem 1.5rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(0, 40, 0, 0.14);
  transition:
    border-color 0.25s ease-out,
    transform 0.25s ease-out;
}
.tile:hover,
.tile:focus-visible {
  border-color: var(--green);
  transform: translateY(-3px);
}

.tile svg {
  width: 1.9rem;
  height: 1.9rem;
  color: var(--green-deep);
  margin-bottom: 0.6rem;
}

.tile h2 {
  font-size: 1.15rem;
  margin: 0 0 0.15rem;
}

.tile p {
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.tile .arrow {
  font-weight: 700;
  color: var(--green-deep);
  font-size: 0.95rem;
}
.tile .arrow::after {
  content: ' →';
  display: inline-block;
  transition: transform 0.25s ease-out;
}
.tile:hover .arrow::after {
  transform: translateX(4px);
}

@media (max-width: 64em) {
  .tiles .container {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .tiles {
    margin-top: -4rem;
  }
}

/* ------------------------------------------------------------
   White content sections
   ------------------------------------------------------------ */
.section--white {
  background: var(--white);
  padding: 4.5rem 0;
}

.section--white h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.lead {
  font-size: 1.08rem;
  max-width: 46rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------
   Demo cards
   ------------------------------------------------------------ */
.demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition:
    border-color 0.25s ease-out,
    transform 0.25s ease-out,
    box-shadow 0.25s ease-out;
}
.card:hover,
.card:focus-within {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 40, 0, 0.1);
}

.card__body {
  padding: 1.2rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-deep);
  border: 1px solid var(--green);
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  flex: 1;
}

.card-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--green-deep);
  margin-top: 0.9rem;
}
.card-link::after {
  content: ' →';
  display: inline-block;
  transition: transform 0.25s ease-out;
}
.card:hover .card-link::after {
  transform: translateX(4px);
}
.card-link:hover,
.card-link:focus-visible {
  color: var(--green-hover);
}

/* ------------------------------------------------------------
   CSS mini-mockups — one abstract "screenshot" per demo card.
   Pure decoration, evokes each UI's signature layout.
   ------------------------------------------------------------ */
.mock {
  aspect-ratio: 16 / 8.2;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex;
}

/* 1 · Open WebUI — dark sidebar + centered composer */
.mock--openwebui {
  background: #f4f6f9;
}
.mock--openwebui .m-side {
  width: 28%;
  background: #17202b;
  padding: 7% 9%;
  display: flex;
  flex-direction: column;
  gap: 12%;
}
.mock--openwebui .m-side i {
  height: 7%;
  min-height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.mock--openwebui .m-side i:first-child {
  background: rgba(165, 191, 60, 0.75);
  width: 85%;
}
.mock--openwebui .m-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8%;
  gap: 8%;
}
.mock--openwebui .m-main i {
  height: 8%;
  min-height: 5px;
  border-radius: 3px;
  background: #dde4ee;
}
.mock--openwebui .m-main i:nth-child(2) {
  width: 45%;
  align-self: flex-end;
  background: #c9d6ea;
}
.mock--openwebui .m-main i:last-child {
  height: 14%;
  min-height: 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cfd9e6;
}

/* 2 · LibreChat — left rail + alternating bubbles, teal accent */
.mock--librechat {
  background: #fff;
}
.mock--librechat .m-rail {
  width: 22%;
  border-right: 1px solid #ececec;
  padding: 7% 12%;
  display: flex;
  flex-direction: column;
  gap: 14%;
}
.mock--librechat .m-rail i {
  height: 7%;
  min-height: 4px;
  border-radius: 3px;
  background: #e8e8e8;
}
.mock--librechat .m-rail i:first-child {
  background: #19c37d;
}
.mock--librechat .m-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10%;
  padding: 8% 10%;
}
.mock--librechat .m-main i {
  height: 9%;
  min-height: 5px;
  border-radius: 4px;
}
.mock--librechat .m-main i:nth-child(1) {
  width: 60%;
  background: #eef1f4;
}
.mock--librechat .m-main i:nth-child(2) {
  width: 45%;
  align-self: flex-end;
  background: #19c37d;
}
.mock--librechat .m-main i:nth-child(3) {
  width: 70%;
  background: #eef1f4;
}

/* 3 · LobeHub — centered bubbles + colorful dock */
.mock--lobehub {
  background: linear-gradient(150deg, #f7f5ff 0%, #eef6ff 100%);
  flex-direction: column;
}
.mock--lobehub .m-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9%;
  padding: 6%;
}
.mock--lobehub .m-chat i {
  height: 22%;
  min-height: 12px;
  width: 42%;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.22);
}
.mock--lobehub .m-chat i:nth-child(2) {
  background: rgba(255, 138, 76, 0.25);
}
.mock--lobehub .m-dock {
  display: flex;
  justify-content: center;
  gap: 7%;
  padding: 4.5% 0 6%;
  background: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(124, 92, 255, 0.14);
}
.mock--lobehub .m-dock i {
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
}
.mock--lobehub .m-dock i:nth-child(1) {
  background: #7c5cff;
}
.mock--lobehub .m-dock i:nth-child(2) {
  background: #ff8a4c;
}
.mock--lobehub .m-dock i:nth-child(3) {
  background: #38bdf8;
}
.mock--lobehub .m-dock i:nth-child(4) {
  background: #34d399;
}
.mock--lobehub .m-dock i:nth-child(5) {
  background: #fbbf24;
}

/* 4 · HuggingFace chat-ui — one centered column, yellow accents */
.mock--chatui {
  background: #fffdf4;
  justify-content: center;
  padding: 8% 10%;
}
.mock--chatui .m-col {
  width: 62%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12%;
}
.mock--chatui .m-col i {
  height: 10%;
  min-height: 6px;
  border-radius: 4px;
  background: #f0ecd8;
}
.mock--chatui .m-col i:nth-child(2) {
  width: 78%;
  align-self: flex-end;
  background: #ffd21e;
}
.mock--chatui .m-col i:last-child {
  height: 13%;
  min-height: 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eadfc0;
}

/* 5 · AnythingLLM — workspace: document panel + chat */
.mock--anythingllm {
  background: #f4f5fd;
}
.mock--anythingllm .m-docs {
  width: 34%;
  background: #fff;
  border-right: 1px solid #e4e6f5;
  padding: 8% 10%;
  display: flex;
  flex-direction: column;
  gap: 16%;
}
.mock--anythingllm .m-docs i {
  height: 12%;
  min-height: 8px;
  border-radius: 3px;
  background: #e6e9fb;
  border-left: 3px solid #6366f1;
}
.mock--anythingllm .m-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10%;
  padding: 8%;
}
.mock--anythingllm .m-main i {
  height: 9%;
  min-height: 5px;
  border-radius: 4px;
  background: #e2e5f7;
}
.mock--anythingllm .m-main i:nth-child(2) {
  width: 50%;
  align-self: flex-end;
  background: #6366f1;
}

/* 6 · Big-AGI — dark, centered column with a beam line */
.mock--bigagi {
  background: #0f1626;
  flex-direction: column;
  justify-content: center;
  gap: 12%;
  padding: 8% 12%;
}
.mock--bigagi .m-beam {
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  width: 80%;
  margin: 0 auto;
}
.mock--bigagi .m-col {
  width: 58%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14%;
}
.mock--bigagi .m-col i {
  height: 9px;
  min-height: 6px;
  border-radius: 4px;
  background: #22304d;
}
.mock--bigagi .m-col i:nth-child(2) {
  width: 75%;
  align-self: flex-end;
  background: #2563eb;
}

/* ------------------------------------------------------------
   "We ❤ Open Standards" — dark section
   ------------------------------------------------------------ */
.section--dark {
  background: var(--green-dark);
  color: var(--white);
  padding: 4.5rem 0;
}

.section--dark h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  color: var(--white);
}

.heart {
  color: var(--amber);
}

.open-standards {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: start;
}

.section--dark .lead {
  color: var(--gray-light);
}

.env-box {
  background: var(--green-panel);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  overflow: hidden;
}

.env-box__bar {
  display: flex;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.env-box__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.env-box__bar i:nth-child(1) {
  background: #ff8a80;
}
.env-box__bar i:nth-child(2) {
  background: #ffd54f;
}
.env-box__bar i:nth-child(3) {
  background: #81c784;
}

.env-box pre {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  color: #d8e8c8;
  overflow-x: auto;
}
.env-box .c {
  color: #7d9a70;
}
.env-box .v {
  color: var(--amber);
}
.env-box .k {
  color: #b5d99c;
  font-weight: 700;
}

@media (max-width: 64em) {
  .open-standards {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.page-footer {
  background: var(--green-darker);
  color: var(--gray-light);
  padding: 3.5rem 0 0;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-brand .wordmark {
  font-size: 1.2rem;
}

.footer-brand p {
  margin-top: 0.9rem;
  line-height: 1.7;
}

.page-footer h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--white);
  margin-bottom: 1rem;
}

.page-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.page-footer a {
  color: var(--gray-light);
  text-decoration: none;
}
.page-footer a:hover,
.page-footer a:focus-visible {
  color: var(--green);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.1rem 0;
  font-size: 0.85rem;
  color: var(--gray);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 64em) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 40em) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
