:root {
  --bg: #080c0b;
  /* Frosted glass: see-through white panels with neutral edges. Green is kept
     for small accents and for the hover state of buttons. */
  --panel: rgba(255, 255, 255, .04);
  --panel-2: rgba(255, 255, 255, .065);
  --glass-blur: blur(16px) saturate(140%);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --mint: #2de0b0;
  --mint-2: #1bb892;
  --ink: #eef3f1;
  --muted: #a1aba8;
  --dim: #6c7774;
  font-family: 'Segoe UI', Inter, system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; min-height: 100vh;
  background:
    radial-gradient(ellipse 55% 45% at 12% 8%, rgba(90, 130, 150, .14), transparent 70%),
    radial-gradient(ellipse 60% 45% at 88% 0%, rgba(45, 224, 176, .07), transparent 70%),
    radial-gradient(ellipse 60% 50% at 60% 100%, rgba(120, 110, 170, .09), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .2s, border-color .2s, box-shadow .2s, transform .2s; }
/* Glass buttons: no green until the pointer is on them. */
.btn-primary, .btn-ghost { border-color: var(--line-2); color: var(--ink); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn-primary { background: rgba(255, 255, 255, .09); }
.btn-ghost { background: rgba(255, 255, 255, .03); }
.btn-primary:hover, .btn-ghost:hover { border-color: rgba(45, 224, 176, .45); background: rgba(45, 224, 176, .13); color: #dcfbf1; box-shadow: 0 0 18px rgba(45, 224, 176, .16), inset 0 1px 0 rgba(255, 255, 255, .08); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 20px; max-width: 1440px; min-height: 100vh; padding: 20px; margin: 0 auto; }

.sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; height: calc(100vh - 40px); padding: 22px 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.brand { display: block; padding: 4px 10px 22px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.brand-logo { display: block; width: 132px; aspect-ratio: 256 / 51; background: var(--mint); -webkit-mask: url('/grobern-logo.webp') left center / contain no-repeat; mask: url('/grobern-logo.webp') left center / contain no-repeat; }
.side-nav { display: grid; gap: 4px; margin-top: 10px; }
.side-item, .side-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; text-align: left; transition: background .2s, color .2s; }
.side-item svg, .side-link svg { width: 19px; height: 19px; flex: none; }
.side-item:hover, .side-link:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.side-item.is-active { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); font-weight: 600; }
.side-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12px; }
.side-item.is-active .side-count { background: rgba(255, 255, 255, .1); }
.side-sep { height: 1px; margin: 12px 4px; background: var(--line); }
.side-card { padding: 16px; margin-top: auto; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .07), transparent 60%), rgba(255, 255, 255, .02); }
.side-card-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .07); color: var(--mint); }
.side-card-icon svg { width: 19px; height: 19px; }
.side-card strong { display: block; margin-top: 12px; font-size: 14px; }
.side-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 6px 0 4px; }
.hello { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.hello-avatar { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(255, 255, 255, .07); color: var(--ink); font: 700 17px Georgia, serif; }
.hello-copy { display: grid; line-height: 1.25; }
.hello-copy strong { font-size: 15px; }
.hello-copy small { color: var(--dim); font-size: 12px; }
.search { display: flex; align-items: center; gap: 9px; width: min(340px, 34vw); height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--dim); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: rgba(255, 255, 255, .28); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--dim); }
.search kbd { padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--dim); font: 12px ui-monospace, monospace; }
.live-pill { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(45, 224, 176, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(45, 224, 176, 0); } }

/* ---------- Banner ---------- */
.banner { position: relative; display: flex; align-items: center; min-height: 250px; padding: 36px 40px; margin-top: 8px; overflow: hidden; scroll-margin-top: 20px; border: 1px solid var(--line-2); border-radius: 20px; background: linear-gradient(115deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, .035) 55%, rgba(255, 255, 255, .02) 100%); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.banner-copy { position: relative; z-index: 2; max-width: 520px; }
.banner h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -.8px; line-height: 1.15; }
.banner p { margin: 10px 0 0; color: #b9c3c0; font-size: 15px; line-height: 1.6; }

.banner-art { position: absolute; top: 0; right: 0; bottom: 0; width: 46%; }
/* GroBern logo, extruded in 3D: it floats, turns gently and shines. */
.logo-stage { position: absolute; top: 50%; left: 50%; display: grid; width: min(64%, 300px); place-items: center; perspective: 600px; transform: translate(-50%, -50%); animation: hover 5s ease-in-out infinite; }
@keyframes hover { 50% { transform: translate(-50%, calc(-50% - 10px)); } }
.logo3d { position: relative; width: 100%; aspect-ratio: 256 / 51; transform-style: preserve-3d; animation: logo-swing 7s ease-in-out infinite; }
.logo-layer { position: absolute; inset: 0; background: #0c5c48; -webkit-mask: url('/grobern-logo.webp') center / contain no-repeat; mask: url('/grobern-logo.webp') center / contain no-repeat; transform: translateZ(calc(var(--z, 0) * 1.2px)); }
.logo-layer:nth-child(1) { --z: -9; background: #03231b; }
.logo-layer:nth-child(2) { --z: -8; background: #042a21; }
.logo-layer:nth-child(3) { --z: -7; background: #053228; }
.logo-layer:nth-child(4) { --z: -6; background: #063a2e; }
.logo-layer:nth-child(5) { --z: -5; background: #074335; }
.logo-layer:nth-child(6) { --z: -4; background: #094c3c; }
.logo-layer:nth-child(7) { --z: -3; background: #0b5543; }
.logo-layer:nth-child(8) { --z: -2; background: #0d5f4b; }
.logo-layer:nth-child(9) { --z: -1; background: #116a53; }
.logo-face { --z: 0; background: linear-gradient(110deg, #c9ffe9 0%, #6fe8b8 35%, #ffffff 48%, #6fe8b8 60%, #34c995 100%); background-size: 260% 100%; filter: drop-shadow(0 0 8px rgba(110, 255, 200, .45)); animation: logo-shine 4.5s linear infinite; }
@keyframes logo-swing { 0%, 100% { transform: rotateY(-24deg) rotateX(10deg); } 50% { transform: rotateY(24deg) rotateX(4deg); } }
@keyframes logo-shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }

/* ---------- Demo cards ---------- */
.demos, .how { padding-top: 34px; scroll-margin-top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.count-chip { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 13px; font-weight: 600; }
.tabs-row { margin: 14px 0 18px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 10px 14px 12px; border: 0; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; transition: color .2s; }
.tab::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; border-radius: 2px; background: var(--ink); content: ''; transform: scaleX(0); transition: transform .25s; }
.tab:hover { color: var(--ink); }
.tab.is-selected { color: var(--ink); font-weight: 600; }
.tab.is-selected::after { transform: scaleX(1); }
.tab-count { margin-left: 6px; color: var(--dim); font-size: 12px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.demo-card { position: relative; display: flex; flex-direction: column; padding: 18px; overflow: hidden; scroll-margin-top: 90px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); transition: border-color .25s, transform .25s, box-shadow .25s; animation: fade-up .45s calc(var(--d) * .05s) backwards; }
/* On hover (or keyboard focus) the border turns green and a light runs round it. */
@property --edge-spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.demo-card::before { position: absolute; inset: 0; z-index: 1; padding: 1.5px; border-radius: inherit; background: conic-gradient(from var(--edge-spin), rgba(45, 224, 176, .25) 0%, rgba(45, 224, 176, .25) 55%, rgba(45, 224, 176, .9) 72%, #c8fff0 78%, rgba(45, 224, 176, .9) 84%, rgba(45, 224, 176, .25) 100%); content: ''; opacity: 0; pointer-events: none; transition: opacity .3s; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.demo-card:hover, .demo-card:focus-within { border-color: rgba(45, 224, 176, .4); box-shadow: 0 16px 40px rgba(0, 0, 0, .4), 0 0 26px rgba(45, 224, 176, .14), inset 0 1px 0 rgba(255, 255, 255, .07); transform: translateY(-3px); }
.demo-card:hover::before, .demo-card:focus-within::before { opacity: 1; animation: edge-spin 2.8s linear infinite; }
@keyframes edge-spin { to { --edge-spin: 360deg; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-avatar { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .07); color: var(--mint); }
.card-avatar svg { width: 23px; height: 23px; stroke-width: 1.7; }
.card-id { min-width: 0; }
.card-id h3 { margin: 0; font-size: 16px; font-weight: 650; }
.card-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.card-sub::before { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); content: ''; }
.card-badge { flex: none; padding: 4px 10px; margin-left: auto; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 11px; font-weight: 700; }
.card-desc { min-height: 42px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.feature-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 14px; list-style: none; }
.feature-list li { padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .03); color: #bcc5c2; font-size: 12px; }
.card-stats { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; margin-top: auto; border-top: 1px solid var(--line); }
.card-stats small { display: block; color: var(--dim); font-size: 11px; }
.card-stats strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; }
.card-stats div:last-child { text-align: right; }
.card-stats code { color: var(--mint); font: 600 12px ui-monospace, monospace; }
.card-open { width: 100%; }
.demo-card.is-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(45, 224, 176, .35); } }

.empty-state { padding: 50px 20px; border: 1px dashed var(--line-2); border-radius: 16px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* ---------- Live websites tab ---------- */
.section-head .btn svg { width: 16px; height: 16px; }
.site-card .card-desc { min-height: 0; white-space: pre-line; overflow-wrap: anywhere; }
.site-card .card-sub { overflow-wrap: anywhere; }
.site-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; margin-top: auto; }
.site-actions .card-open { flex: 1; width: auto; }
.btn-remove:hover { border-color: rgba(255, 122, 122, .5); background: rgba(255, 90, 90, .14); color: #ffd3d3; box-shadow: none; }
.btn-danger { border-color: rgba(255, 122, 122, .45); background: rgba(226, 85, 85, .85); color: #fff; }
.btn-danger:hover { background: #f06a6a; }

dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), rgba(18, 24, 22, .94); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
dialog::backdrop { background: rgba(2, 8, 7, .7); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 14px; padding: 24px; }
.dialog-form h2 { margin: 0; font-size: 20px; }
.dialog-text { margin: -4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.field { display: grid; gap: 6px; }
.field > span { color: #d6dcda; font-size: 13px; font-weight: 600; }
.field small { color: var(--dim); font-weight: 400; }
.field input, .field textarea { width: 100%; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; outline: none; background: var(--panel); color: var(--ink); font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.field input { height: 42px; }
.field textarea { padding-top: 10px; padding-bottom: 10px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(255, 255, 255, .3); box-shadow: 0 0 0 3px rgba(255, 255, 255, .07); }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.form-error { padding: 10px 12px; border: 1px solid rgba(255, 122, 122, .4); border-radius: 10px; background: rgba(255, 90, 90, .1); color: #ffc9c9; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: min(420px, calc(100% - 40px)); padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(24, 31, 29, .92); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.toast.is-shown { opacity: 1; transform: none; }
.toast.is-error { border-color: rgba(255, 122, 122, .5); background: #3a1717; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 16px 0 0; list-style: none; }
.steps li { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.step-no { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .07); color: var(--mint); font-weight: 700; }
.steps h3 { margin: 14px 0 6px; font-size: 16px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 26px 4px 8px; margin-top: 34px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-pill { display: none; }
}
@media (max-width: 900px) {
  .shell { display: block; padding: 12px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; padding: 12px; }
  .brand { padding: 4px 8px; margin: 0; border: 0; }
  .brand-logo { width: 110px; }
  .side-nav, .side-sep, .side-card { display: none; }
  .side-link { width: auto; padding: 8px 10px; margin-left: auto; font-size: 13px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 14px 0 4px; }
  .search { order: 3; width: 100%; }
  .banner { flex-direction: column; align-items: stretch; padding: 26px 22px 0; }
  .banner-art { position: relative; width: 100%; height: 190px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar .btn-primary { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .hello-copy small { display: none; }
  .page-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .logo3d { transform: rotateY(-18deg) rotateX(8deg); }
}
