:root {
  --bg: #1e1e1e;
  --bg-elevated: #252526;
  --bg-sidebar: #181818;
  --bg-activity: #181818;
  --bg-title: #3c3c3c;
  --bg-tab: #2d2d2d;
  --bg-tab-active: #1e1e1e;
  --bg-status: #007acc;
  --bg-hover: #2a2d2e;
  --border: #2b2b2b;
  --border-soft: #3c3c3c;

  --fg: #cccccc;
  --fg-dim: #858585;
  --fg-muted: #6e6e6e;
  --fg-bright: #e8e8e8;

  --accent: #007acc;
  --accent-soft: #264f78;
  --token-kw: #569cd6;
  --token-fn: #dcdcaa;
  --token-str: #ce9178;
  --token-type: #4ec9b0;
  --token-cmt: #6a9955;
  --token-var: #9cdcfe;
  --token-op: #d4d4d4;
  --token-punc: #d4d4d4;
  --token-num: #b5cea8;

  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --title-h: 36px;
  --status-h: 24px;
  --activity-w: 48px;
  --sidebar-w: 240px;
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--fg);
  background:
    radial-gradient(1200px 700px at 10% -10%, #0d3a55 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #16352f 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 110%, #1a2a40 0%, transparent 45%),
    #0f1114;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.4;
  z-index: 0;
}

.vscode {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1280px, calc(100% - 32px));
  height: min(860px, calc(100dvh - 48px));
  margin: 24px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.35);
  animation: window-in 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Title bar */
.titlebar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: var(--title-h);
  padding: 0 12px;
  background: linear-gradient(180deg, #404040 0%, var(--bg-title) 100%);
  border-bottom: 1px solid #000;
  user-select: none;
  flex-shrink: 0;
}

.traffic {
  display: flex;
  gap: 7px;
  padding-left: 4px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.menubar {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--fg-bright);
}

.menubar a {
  opacity: 0.85;
  transition: opacity 120ms ease;
}

.menubar a:hover {
  opacity: 1;
}

.titlebar-center {
  justify-self: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #d0d0d0;
  letter-spacing: 0.01em;
}

.titlebar-right {
  display: flex;
  gap: 10px;
  opacity: 0.35;
}

.window-ctrl {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
}

/* Workspace */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Activity bar */
.activity {
  width: var(--activity-w);
  background: var(--bg-activity);
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  flex-shrink: 0;
}

.activity-top,
.activity-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.activity-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  position: relative;
  transition: color 150ms ease;
}

.activity-btn svg {
  width: 22px;
  height: 22px;
}

.activity-btn:hover,
.activity-btn.active {
  color: var(--fg-bright);
}

.activity-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #fff;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  animation: sidebar-in 800ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sidebar-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 600;
}

.folder-label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-align: left;
}

.folder-label .chevron {
  font-size: 10px;
  color: var(--fg-dim);
}

.tree {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
  border-left: 2px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
}

.tree-item:hover {
  background: var(--bg-hover);
}

.tree-item.active {
  background: #37373d;
  border-left-color: var(--accent);
}

.file-icon {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.95;
}

.file-icon.ts { color: #519aba; }
.file-icon.md { color: #519aba; }
.file-icon.json { color: #cbcb41; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #2a2a2a;
  padding: 10px 0 14px;
}

.outline-label {
  padding: 0 14px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 600;
}

.outline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.outline a {
  display: block;
  padding: 4px 14px 4px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
}

.outline a:hover {
  color: var(--fg-bright);
  background: var(--bg-hover);
}

/* Editor */
.editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

.tabs {
  display: flex;
  background: var(--bg-tab);
  border-bottom: 1px solid #000;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg-dim);
  background: transparent;
  border-right: 1px solid #252526;
  white-space: nowrap;
  position: relative;
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  background: var(--bg-tab-active);
  color: var(--fg-bright);
}

.tab.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.tab-close {
  opacity: 0;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
}

.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 0.55;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.breadcrumb .sep {
  opacity: 0.5;
}

.breadcrumb .current {
  color: var(--fg);
}

.pane {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  animation: pane-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pane.active {
  display: block;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Code */
.code-pane {
  display: grid;
  grid-template-columns: 48px 1fr;
  min-height: 100%;
}

.gutter {
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #858585;
  user-select: none;
  background: var(--bg);
}

.gutter span {
  padding-right: 14px;
}

.code {
  margin: 0;
  padding: 18px 20px 40px 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre;
  overflow-x: auto;
}

.kw { color: var(--token-kw); }
.fn { color: var(--token-fn); }
.str { color: var(--token-str); }
.type { color: var(--token-type); }
.cmt { color: var(--token-cmt); }
.var { color: var(--token-var); }
.op, .punc { color: var(--token-op); }

/* Hero overlay */
#hero {
  position: relative;
}

#hero .code-pane {
  min-height: 100%;
  opacity: 0.42;
  filter: blur(0.2px);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 64px);
  background:
    linear-gradient(105deg, rgba(30, 30, 30, 0.92) 0%, rgba(30, 30, 30, 0.72) 48%, rgba(30, 30, 30, 0.2) 100%),
    linear-gradient(180deg, transparent 0%, rgba(0, 122, 204, 0.08) 100%);
  pointer-events: none;
}

.hero-overlay > * {
  pointer-events: auto;
  max-width: 34rem;
}

.brand-mark {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg-bright);
  animation: rise 700ms 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-dot {
  color: var(--token-type);
}

.motto {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.motto-line {
  display: inline;
  color: var(--fg);
  animation: rise 750ms 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.motto-line.accent {
  color: var(--token-type);
  animation-delay: 380ms;
}

.motto-line + .motto-line::before {
  content: " ";
}

.lede {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #b5b5b5;
  max-width: 32rem;
  animation: rise 800ms 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: rise 850ms 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  border-radius: 2px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #1a8ad4;
  transform: translateY(-1px);
}

.btn.ghost {
  border: 1px solid var(--border-soft);
  color: var(--fg-bright);
  background: rgba(255, 255, 255, 0.03);
}

.btn.ghost:hover {
  border-color: #6a6a6a;
  background: rgba(255, 255, 255, 0.06);
}

/* About markdown */
.markdown {
  padding: clamp(24px, 4vw, 40px);
  max-width: 720px;
}

.markdown h2,
.markdown h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--fg-bright);
  margin: 0 0 14px;
}

.markdown h2 {
  font-size: 1.45rem;
}

.markdown h3 {
  font-size: 1.1rem;
  margin-top: 28px;
}

.md-hash {
  color: var(--token-cmt);
  margin-right: 6px;
}

.markdown p {
  margin: 0 0 16px;
  line-height: 1.65;
  color: #c2c2c2;
  font-size: 0.98rem;
}

.markdown strong {
  color: var(--fg-bright);
  font-weight: 600;
}

.md-table {
  margin: 0 0 20px;
  padding: 14px 16px;
  overflow-x: auto;
  background: #1a1a1a;
  border: 1px solid #2f2f2f;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c8c8c8;
}

.md-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--token-cmt) !important;
}

/* Services */
#services {
  display: none;
}

#services.active {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

#services .code-pane {
  border-right: 1px solid #2a2a2a;
}

.service-copy {
  padding: clamp(24px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(0, 122, 204, 0.06), transparent 40%),
    var(--bg);
}

.service-copy h2 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--fg-bright);
}

.service-copy p {
  margin: 0 0 22px;
  line-height: 1.6;
  color: #b8b8b8;
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.service-list li {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fg);
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2a;
}

.token-kw { color: var(--token-kw); }
.token-fn { color: var(--token-fn); }
.token-str { color: var(--token-str); }

/* Contact */
#contact {
  display: none;
}

#contact.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.contact-panel {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(500px 280px at 80% 20%, rgba(78, 201, 176, 0.1), transparent 60%),
    var(--bg-elevated);
  border-left: 1px solid #2a2a2a;
}

.contact-panel h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--fg-bright);
}

.contact-panel p {
  margin: 0;
  color: #b5b5b5;
  line-height: 1.55;
}

.contact-panel .btn {
  width: fit-content;
  margin-top: 6px;
}

.contact-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim) !important;
  margin-top: 8px !important;
}

/* Status bar */
.statusbar {
  height: var(--status-h);
  background: var(--bg-status);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  flex-shrink: 0;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.status-item {
  padding: 2px 8px;
  opacity: 0.95;
}

.status-item.accent-bg {
  background: rgba(0, 0, 0, 0.18);
}

.pulse {
  position: relative;
}

.pulse::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: #7ee787;
  box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.6);
  animation: pulse 2.2s ease infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(126, 231, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0); }
}

/* Cursor blink on hero code caret simulation */
#hero-code::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 2px;
  background: #aeafad;
  vertical-align: text-bottom;
  animation: blink 1.05s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Mobile */
@media (max-width: 900px) {
  body {
    background: #0f1114;
  }

  .vscode {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .sidebar,
  .activity {
    display: none;
  }

  .titlebar {
    grid-template-columns: auto 1fr;
  }

  .menubar,
  .titlebar-right {
    display: none;
  }

  .titlebar-center {
    justify-self: end;
    font-size: 11px;
  }

  #services.active,
  #contact.active {
    grid-template-columns: 1fr;
  }

  #services .code-pane,
  .contact-code {
    display: none;
  }

  .contact-panel {
    border-left: 0;
    min-height: 100%;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.88), rgba(30, 30, 30, 0.78));
  }

  .tabs {
    scrollbar-width: none;
  }

  .statusbar .status-right .status-item:nth-child(n + 3) {
    display: none;
  }
}

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