:root {
  --ink: #0e1a22;
  --ink-soft: #243642;
  --paper: #eef3f6;
  --paper-2: #dce7ee;
  --teal: #0d6e6e;
  --teal-deep: #084848;
  --lime: #b8e03a;
  --lime-ink: #1a2e05;
  --line: rgba(14, 26, 34, 0.14);
  --shadow: 0 14px 32px rgba(14, 26, 34, 0.12);
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --radius: 6px;
  --sidebar: 260px;
  --sidebar-collapsed: 76px;
}

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

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow: hidden;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  height: 100vh;
  min-height: 100%;
  transition: grid-template-columns 0.28s ease;
}

body.sidebar-collapsed .shell {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.85rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: auto;
  transition: padding 0.28s ease;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  padding-bottom: 0.35rem;
}

.sidebar-brand {
  padding: 0.35rem 0.45rem 0.5rem;
  min-width: 0;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0.35rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: rgba(238, 243, 246, 0.85);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
  background: rgba(184, 224, 58, 0.14);
  border-color: var(--lime);
  color: var(--lime);
}

.sidebar-toggle-icon {
  display: block;
  width: 0.65rem;
  height: 0.65rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.28s ease;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 0.55rem;
  align-items: stretch;
}

body.sidebar-collapsed .sidebar-top {
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

body.sidebar-collapsed .sidebar-brand {
  padding: 0.2rem 0;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-name,
body.sidebar-collapsed .repo-pill-label {
  display: none;
}

body.sidebar-collapsed .brand-link {
  justify-content: center;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0.45rem;
}

body.sidebar-collapsed .nav-code {
  min-width: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 2.1rem;
  height: 2.1rem;
}

body.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(-135deg);
}

body.sidebar-collapsed .sidebar-foot {
  display: flex;
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .repo-pill {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

body.sidebar-collapsed .repo-pill svg {
  margin: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  background: var(--lime);
  color: var(--lime-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-text small {
  color: rgba(238, 243, 246, 0.65);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-label {
  margin: 0.85rem 0.55rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 243, 246, 0.45);
}

.nav-item {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(238, 243, 246, 0.82);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(184, 224, 58, 0.16);
  color: var(--lime);
}

.nav-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 1.6rem;
}

.nav-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem 0.35rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.5rem;
}

.repo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 0.85rem;
}

.repo-pill:hover {
  background: rgba(184, 224, 58, 0.16);
  border-color: var(--lime);
  color: var(--lime);
}

.repo-pill svg {
  width: 16px;
  height: 16px;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.workspace-meta {
  min-width: 0;
}

.workspace-code {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--teal-deep);
  font-size: 0.95rem;
}

.workspace-title {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.workspace-main {
  position: relative;
  flex: 1;
  min-height: 0;
}

.home-view {
  position: relative;
  height: 100%;
  overflow: auto;
}

.home-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 1.5rem 3rem;
}

.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(13, 110, 110, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(184, 224, 58, 0.22), transparent 50%),
    linear-gradient(165deg, #f4f8fa 0%, #e4eef3 45%, #d5e4ec 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 75%);
}

.org {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 36rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
}

.cta-primary {
  background: var(--ink);
  color: var(--lime);
}

.cta-primary:hover {
  background: var(--teal-deep);
  color: #fff;
}

.cta-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.cta-ghost:hover {
  background: var(--lime);
  border-color: var(--lime-ink);
  color: var(--lime-ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 100%;
  padding: 1.4rem 1.3rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(14, 26, 34, 0.04);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card::before {
  content: attr(data-h);
  position: absolute;
  right: 0.7rem;
  top: 0.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: rgba(13, 110, 110, 0.1);
  pointer-events: none;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: var(--teal);
  box-shadow: var(--shadow);
}

.h-num {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--teal-deep);
}

.h-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.h-desc {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex: 1;
}

.h-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-site {
  background: var(--ink);
  color: var(--lime);
}

.btn-site:hover {
  background: var(--teal-deep);
  color: #fff;
}

.btn-lup {
  background: rgba(13, 110, 110, 0.1);
  color: var(--teal-deep);
  border-color: var(--teal);
}

.btn-lup:hover {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: #fff;
}

.btn-repo {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-repo:hover {
  background: var(--lime);
  border-color: var(--lime-ink);
  color: var(--lime-ink);
}

.frame-view {
  height: 100%;
  min-height: 0;
}

.frame-view iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .shell,
  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    overflow-x: auto;
  }

  .sidebar-top {
    align-items: center;
    padding-bottom: 0;
    flex-shrink: 0;
  }

  body.sidebar-collapsed .sidebar-top {
    flex-direction: row;
    align-items: center;
  }

  .sidebar-brand,
  body.sidebar-collapsed .sidebar-brand {
    padding: 0;
    flex-shrink: 0;
  }

  .brand-text small {
    display: none;
  }

  body.sidebar-collapsed .brand-text {
    display: flex;
  }

  .sidebar-toggle {
    margin-top: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
  }

  .nav-name,
  body.sidebar-collapsed .nav-name {
    display: none;
  }

  body.sidebar-collapsed .nav-item {
    justify-content: flex-start;
  }

  body.nav-hidden .sidebar-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .shell,
  .sidebar,
  .sidebar-toggle-icon,
  .card,
  .cta,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}
